File Information
Library: OSP/Auth
Package: Auth
Header: Poco/OSP/Auth/PooledAuthAdminService.h
Description
This class implements the AuthAdminService interface in such a way that all methods are forwarded to one of multiple other AuthAdminService instances.
This can be used in systems with a large number of concurrent users to prevent a single AuthAdminService instance from becoming a bottleneck.
In order to improve caching behavior, requests for a specific user are always forwarded to the same backend.
Inheritance
Direct Base Classes: AuthAdminService
All Base Classes: AuthAdminService, AuthService, Poco::OSP::Service, Poco::RefCountedObject
Member Summary
Member Functions: addRole, addUser, any, assignRoleToUser, attributesForUser, authenticate, authorize, changePassword, effectivePermissionsForUser, findUsersByAttribute, forUser, getUserAttribute, grantPermissionsToRole, grantPermissionsToUser, invalidateCaches, isA, isExternalUser, isUserLockedOut, lockOutUser, onRoleAdded, onRoleRemoved, onUserAdded, onUserRemoved, onValidateUser, permissionsForRole, permissionsForUser, removeRole, removeRoleFromUser, removeUser, removeUserAttribute, replacePermissionsForRole, replacePermissionsForUser, replaceRolesForUser, replaceUserAttributes, reset, revokePermission, revokePermissionsFromRole, revokePermissionsFromUser, roleExists, roles, rolesForUser, setUserAttribute, type, uncacheUser, unlockOutUser, updateUserAttributes, userEnabled, userExists, users, usersWithAttribute, usersWithName, usersWithPermission, usersWithRole
Inherited Functions: addRole, addUser, assignRoleToUser, attributesForUser, authenticate, authorize, changePassword, duplicate, effectivePermissionsForUser, findUsersByAttribute, getUserAttribute, grantPermissionsToRole, grantPermissionsToUser, invalidateCaches, isA, isExternalUser, isUserLockedOut, lockOutUser, permissionsForRole, permissionsForUser, referenceCount, release, removeRole, removeRoleFromUser, removeUser, removeUserAttribute, replacePermissionsForRole, replacePermissionsForUser, replaceRolesForUser, replaceUserAttributes, reset, revokePermission, revokePermissionsFromRole, revokePermissionsFromUser, roleExists, roles, rolesForUser, setUserAttribute, type, uncacheUser, unlockOutUser, updateUserAttributes, userEnabled, userExists, users, usersWithAttribute, usersWithName, usersWithPermission, usersWithRole
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < PooledAuthAdminService >;
Constructors
PooledAuthAdminService
explicit PooledAuthAdminService(
const std::vector < AuthAdminService::Ptr > & backends
);
Creates the PooledAuthAdminService with the given backends. The vector must not be empty.
Destructor
~PooledAuthAdminService
Destroys the AuthAdminServiceImpl.
Member Functions
addRole
void addRole(
const std::string & rolename
);
addUser
void addUser(
const std::string & username,
const std::string & password
);
assignRoleToUser
void assignRoleToUser(
const std::string & username,
const std::string & rolename
);
attributesForUser
void attributesForUser(
const std::string & username,
std::set < std::string > & attributes
) const;
attributesForUser
void attributesForUser(
const std::string & username,
std::map < std::string, std::string > & attributes
) const;
authenticate
bool authenticate(
const std::string & username,
const std::string & credentials
) const;
authorize
bool authorize(
const std::string & username,
const std::string & permission
) const;
authorize
bool authorize(
const std::string & userName,
const std::string & roleOrScope,
const std::string & permission
) const;
changePassword
void changePassword(
const std::string & username,
const std::string & password
);
effectivePermissionsForUser
void effectivePermissionsForUser(
const std::string & username,
std::set < std::string > & permissions
) const;
findUsersByAttribute
std::vector < std::string > findUsersByAttribute(
const std::string & attribute,
const std::string & value
) const;
getUserAttribute
std::string getUserAttribute(
const std::string & username,
const std::string & attribute,
const std::string & deflt = std::string ()
) const;
grantPermissionsToRole
void grantPermissionsToRole(
const std::string & rolename,
const std::set < std::string > & permissions
);
grantPermissionsToUser
void grantPermissionsToUser(
const std::string & username,
const std::set < std::string > & permissions
);
invalidateCaches
void invalidateCaches(
int what = INVALIDATE_ALL
);
isA
bool isA(
const std::type_info & otherType
) const;
See also: Poco::OSP::Auth::AuthAdminService::isA()
isExternalUser
bool isExternalUser(
const std::string & username
) const;
isUserLockedOut
bool isUserLockedOut(
const std::string & username
) const;
lockOutUser
void lockOutUser(
const std::string & username,
const Poco::DateTime & lockOutUntil
);
permissionsForRole
void permissionsForRole(
const std::string & rolename,
std::set < std::string > & permissions
) const;
permissionsForUser
void permissionsForUser(
const std::string & username,
std::set < std::string > & permissions
) const;
removeRole
void removeRole(
const std::string & rolename
);
removeRoleFromUser
void removeRoleFromUser(
const std::string & username,
const std::string & rolename
);
removeUser
void removeUser(
const std::string & username
);
removeUserAttribute
void removeUserAttribute(
const std::string & username,
const std::string & attribute
);
replacePermissionsForRole
void replacePermissionsForRole(
const std::string & rolename,
const std::set < std::string > & permissions
);
replacePermissionsForUser
void replacePermissionsForUser(
const std::string & username,
const std::set < std::string > & permissions
);
replaceRolesForUser
void replaceRolesForUser(
const std::string & username,
const std::set < std::string > & permissions
);
replaceUserAttributes
void replaceUserAttributes(
const std::string & username,
const std::map < std::string, std::string > & attributes
);
reset
void reset();
revokePermission
void revokePermission(
const std::string & permission
);
revokePermissionsFromRole
void revokePermissionsFromRole(
const std::string & rolename,
const std::set < std::string > & permissions
);
revokePermissionsFromUser
void revokePermissionsFromUser(
const std::string & username,
const std::set < std::string > & permissions
);
roleExists
bool roleExists(
const std::string & rolename
) const;
roles
void roles(
std::set < std::string > & roles
) const;
rolesForUser
void rolesForUser(
const std::string & username,
std::set < std::string > & roles
) const;
setUserAttribute
void setUserAttribute(
const std::string & username,
const std::string & attribute,
const std::string & value
);
type
const std::type_info & type() const;
uncacheUser
void uncacheUser(
const std::string & username
);
unlockOutUser
void unlockOutUser(
const std::string & username
);
updateUserAttributes
void updateUserAttributes(
const std::string & username,
const std::map < std::string, std::string > & attributes
);
userEnabled
bool userEnabled(
const std::string & username
) const;
userExists
bool userExists(
const std::string & username
) const;
users
int users(
std::set < std::string > & users,
int first = 0,
int limit = 0
) const;
usersWithAttribute
int usersWithAttribute(
std::set < std::string > & users,
const std::string & attribute,
const std::string & value,
int first = 0,
int limit = 0
) const;
usersWithName
int usersWithName(
std::set < std::string > & users,
const std::string & pattern,
int first = 0,
int limit = 0
) const;
usersWithPermission
int usersWithPermission(
std::set < std::string > & users,
const std::string & permission,
int first = 0,
int limit = 0
) const;
usersWithRole
int usersWithRole(
std::set < std::string > & users,
const std::string & role,
int first = 0,
int limit = 0
) const;
any
AuthAdminService::Ptr any() const;
forUser
AuthAdminService::Ptr forUser(
const std::string & username
) const;
onRoleAdded
void onRoleAdded(
const std::string & rolename
);
onRoleRemoved
void onRoleRemoved(
const std::string & rolename
);
onUserAdded
void onUserAdded(
const std::string & username
);
onUserRemoved
void onUserRemoved(
const std::string & username
);
onValidateUser
void onValidateUser(
ValidateUserEvent & event
);