76#ifdef epicsExportSharedSymbols
77# define securityEpicsExportSharedSymbols
78# undef epicsExportSharedSymbols
83#include <epicsMutex.h>
87#include <pv/sharedPtr.h>
89#ifdef securityEpicsExportSharedSymbols
90# define epicsExportSharedSymbols
91# undef securityEpicsExportSharedSymbols
94#include <pv/pvaDefs.h>
95#include <pv/pvaConstants.h>
96#include <pv/serializationHelper.h>
122 static size_t num_instances;
131 pvData::PVStructure::const_shared_pointer
aux;
161 {
return epics::pvData::PVStructure::const_shared_pointer(); }
166 virtual void messageReceived(epics::pvData::PVStructure::const_shared_pointer
const & data) {}
194 const std::tr1::shared_ptr<PeerInfo>& peer) = 0;
221 const std::tr1::shared_ptr<PeerInfo>& peer,
222 std::tr1::shared_ptr<AuthenticationPluginControl>
const & control,
223 epics::pvData::PVStructure::shared_pointer
const & data) = 0;
237 mutable epicsMutex mutex;
258 void add(
int prio,
const std::string& name,
const AuthenticationPlugin::shared_pointer& plugin);
260 bool remove(
const AuthenticationPlugin::shared_pointer& plugin);
263 AuthenticationPlugin::shared_pointer
lookup(
const std::string& name)
const;
276 virtual void authorize(
const std::tr1::shared_ptr<PeerInfo>& peer) =0;
279class epicsShareClass AuthorizationRegistry
281 EPICS_NOT_COPYABLE(AuthorizationRegistry)
285 static AuthorizationRegistry &plugins();
287 AuthorizationRegistry();
288 ~AuthorizationRegistry();
294 mutable epicsMutex mutex;
297 void add(
int prio,
const AuthorizationPlugin::shared_pointer& plugin);
298 bool remove(
const AuthorizationPlugin::shared_pointer& plugin);
299 void run(
const std::tr1::shared_ptr<PeerInfo>& peer);
constexpr _ForwardIterator remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Callbacks for use by AuthenticationSession.
virtual void authenticationCompleted(const epics::pvData::Status &status, const std::tr1::shared_ptr< PeerInfo > &peer)=0
Called by server plugin to indicate the the exchange has completed.
virtual void sendSecurityPluginMessage(epics::pvData::PVStructure::const_shared_pointer const &data)=0
Send AUTHZ to peer with payload.
Actor through which authentication exchanges are initiated.
virtual std::tr1::shared_ptr< AuthenticationSession > createSession(const std::tr1::shared_ptr< PeerInfo > &peer, std::tr1::shared_ptr< AuthenticationPluginControl > const &control, epics::pvData::PVStructure::shared_pointer const &data)=0
Begin a new session with a peer.
virtual bool isValidFor(const PeerInfo &peer) const
Allow this plugin to be advertised to a particular peer.
bool remove(const AuthenticationPlugin::shared_pointer &plugin)
Remove an existing entry. Remove true if the entry was actually removed.
static AuthenticationRegistry & servers()
The server side of the conversation.
void add(int prio, const std::string &name, const AuthenticationPlugin::shared_pointer &plugin)
Add a new plugin to this registry.
void snapshot(list_t &plugmap) const
Save a copy of the current registry in order of increasing priority.
static AuthenticationRegistry & clients()
The client side of the conversation.
AuthenticationPlugin::shared_pointer lookup(const std::string &name) const
Fetch a single plugin explicitly by name.
A particular authentication exchange.
virtual void authenticationComplete(const epics::pvData::Status &status)
For client plugins only.
virtual epics::pvData::PVStructure::const_shared_pointer initializationData()
For client plugins only, call to find the payload returned with CONNECTION_VALIDATION.
virtual void messageReceived(epics::pvData::PVStructure::const_shared_pointer const &data)
Called when an AUTHZ message is recieved from the peer.
I modify PeerInfo after authentication is complete.
virtual void authorize(const std::tr1::shared_ptr< PeerInfo > &peer)=0
Hook to modify PeerInfo.
void osdGetRoles(const std::string &account, PeerInfo::roles_t &roles)
Query OS specific DB for role/group names assocated with a user account.
Copyright - See the COPYRIGHT that is included with this distribution.
Information provded by a client to a server-type ChannelProvider.
roles_t roles
Set of strings which may be used to modify access control decisions.
pvData::PVStructure::const_shared_pointer aux
NULL or extra authority specific information.
std::string peer
network address of remote peer. eg. "192.168.1.1:5075".
std::string realm
scope of authority. eg. "mylab.gov"
bool identified
Short-hand for authority!="anonymous".
bool local
Short-hand for transport=="local".
std::string authority
authentication mechanism used. eg. "anonymous" or "gssapi". Must not be empty.
unsigned transportVersion
If applicable, the protocol minor version number.
std::string account
aka. user name
std::string transport
transport protocol used eg. "pva". Must not be empty.