context_listener.hpp
Go to the documentation of this file.
/*
* ====================================================================
* Copyright (c) 2002-2009 The RapidSvn Group. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in the file GPL.txt.
* If not, see <http://www.gnu.org/licenses/>.
*
* This software consists of voluntary contributions made by many
* individuals. For exact contribution history, see the revision
* history and logs, available at http://rapidsvn.tigris.org/.
* ====================================================================
*/
#ifndef _SVNCPP_CONTEXT_LISTENER_HPP_
#define _SVNCPP_CONTEXT_LISTENER_HPP_
// stl
#include "svncpp/string_wrapper.hpp"
// Subversion api
#include "svn_client.h"
// svncpp
#include "svncpp/pool.hpp"
namespace svn
{
class ContextListener
{
public:
virtual bool
contextGetLogin(const std::string & realm,
std::string & username,
std::string & password,
bool & maySave) = 0;
virtual void
contextNotify(const char *path,
svn_wc_notify_action_t action,
svn_node_kind_t kind,
const char *mime_type,
svn_wc_notify_state_t content_state,
svn_wc_notify_state_t prop_state,
svn_revnum_t revision) = 0;
/*
* this method will be called periodically to allow
* the app to cancel long running operations
*
* @return cancel action?
* @retval true cancel
*/
virtual bool
contextCancel() = 0;
virtual bool
contextGetLogMessage(std::string & msg) = 0;
typedef enum
{
DONT_ACCEPT = 0,
ACCEPT_TEMPORARILY,
ACCEPT_PERMANENTLY
} SslServerTrustAnswer;
struct SslServerTrustData
{
public:
apr_uint32_t failures;
std::string hostname;
std::string fingerprint;
std::string validFrom;
std::string validUntil;
std::string issuerDName;
std::string realm;
bool maySave;
SslServerTrustData(const apr_uint32_t failures_ = 0)
: failures(failures_), hostname(""), fingerprint(""),
validFrom(""), validUntil(""), issuerDName(""),
realm(""), maySave(true)
{
}
SslServerTrustData(const SslServerTrustData & src)
: failures(src.failures)
{
hostname = src.hostname;
fingerprint = src.fingerprint;
validFrom = src.validFrom;
validUntil = src.validUntil;
issuerDName = src.issuerDName;
realm = src.realm;
maySave = src.maySave;
}
SslServerTrustData &
operator =(const SslServerTrustData & src)
{
if (this == &src)
return *this;
hostname = src.hostname;
fingerprint = src.fingerprint;
validFrom = src.validFrom;
validUntil = src.validUntil;
issuerDName = src.issuerDName;
realm = src.realm;
maySave = src.maySave;
failures = src.failures;
return *this;
}
};
virtual SslServerTrustAnswer
contextSslServerTrustPrompt(const SslServerTrustData & data,
apr_uint32_t & acceptedFailures) = 0;
virtual bool
contextSslClientCertPrompt(std::string & certFile) = 0;
virtual bool
contextSslClientCertPwPrompt(std::string & password,
const std::string & realm,
bool & maySave) = 0;
virtual ~ContextListener() { }
};
}
#endif
/* -----------------------------------------------------------------
* local variables:
* eval: (load-file "../../rapidsvn-dev.el")
* end:
*/
svn::ContextListener::SslServerTrustData::operator=
SslServerTrustData & operator=(const SslServerTrustData &src)
Definition: context_listener.hpp:160
svn::ContextListener::SslServerTrustData::SslServerTrustData
SslServerTrustData(const SslServerTrustData &src)
Definition: context_listener.hpp:147
string_wrapper.hpp
svn::ContextListener::contextGetLogMessage
virtual bool contextGetLogMessage(std::string &msg)=0
svn::ContextListener::SslServerTrustData::issuerDName
std::string issuerDName
Definition: context_listener.hpp:136
svn::ContextListener::SslServerTrustData::fingerprint
std::string fingerprint
Definition: context_listener.hpp:133
svn::ContextListener::SslServerTrustData::realm
std::string realm
Definition: context_listener.hpp:137
svn::ContextListener::SslServerTrustData::hostname
std::string hostname
Definition: context_listener.hpp:132
svn::ContextListener::contextGetLogin
virtual bool contextGetLogin(const std::string &realm, std::string &username, std::string &password, bool &maySave)=0
svn::ContextListener::ACCEPT_TEMPORARILY
Definition: context_listener.hpp:116
svn::ContextListener::contextSslClientCertPrompt
virtual bool contextSslClientCertPrompt(std::string &certFile)=0
svn::ContextListener::contextSslClientCertPwPrompt
virtual bool contextSslClientCertPwPrompt(std::string &password, const std::string &realm, bool &maySave)=0
svn::ContextListener::SslServerTrustData
Definition: context_listener.hpp:125
svn::ContextListener::SslServerTrustData::failures
apr_uint32_t failures
Definition: context_listener.hpp:129
svn::ContextListener::~ContextListener
virtual ~ContextListener()
Definition: context_listener.hpp:211
svn::ContextListener::contextSslServerTrustPrompt
virtual SslServerTrustAnswer contextSslServerTrustPrompt(const SslServerTrustData &data, apr_uint32_t &acceptedFailures)=0
svn::ContextListener::SslServerTrustAnswer
SslServerTrustAnswer
Definition: context_listener.hpp:113
svn::ContextListener::SslServerTrustData::validFrom
std::string validFrom
Definition: context_listener.hpp:134
svn::ContextListener::SslServerTrustData::maySave
bool maySave
Definition: context_listener.hpp:138
svn::ContextListener::contextCancel
virtual bool contextCancel()=0
svn::ContextListener::DONT_ACCEPT
Definition: context_listener.hpp:115
svn::ContextListener::SslServerTrustData::validUntil
std::string validUntil
Definition: context_listener.hpp:135
svn::ContextListener
Definition: context_listener.hpp:45
svn::ContextListener::ACCEPT_PERMANENTLY
Definition: context_listener.hpp:117
svn::ContextListener::SslServerTrustData::SslServerTrustData
SslServerTrustData(const apr_uint32_t failures_=0)
Definition: context_listener.hpp:140
svn::ContextListener::contextNotify
virtual void contextNotify(const char *path, svn_wc_notify_action_t action, svn_node_kind_t kind, const char *mime_type, svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state, svn_revnum_t revision)=0
pool.hpp