Poco::OSP::Auth

class PooledAuthAdminService

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 virtual

~PooledAuthAdminService();

Destroys the AuthAdminServiceImpl.

Member Functions

addRole virtual

void addRole(
    const std::string & rolename
);

addUser virtual

void addUser(
    const std::string & username,
    const std::string & password
);

assignRoleToUser virtual

void assignRoleToUser(
    const std::string & username,
    const std::string & rolename
);

attributesForUser virtual

void attributesForUser(
    const std::string & username,
    std::set < std::string > & attributes
) const;

attributesForUser virtual

void attributesForUser(
    const std::string & username,
    std::map < std::string, std::string > & attributes
) const;

authenticate virtual

bool authenticate(
    const std::string & username,
    const std::string & credentials
) const;

authorize virtual

bool authorize(
    const std::string & username,
    const std::string & permission
) const;

authorize virtual

bool authorize(
    const std::string & userName,
    const std::string & roleOrScope,
    const std::string & permission
) const;

changePassword virtual

void changePassword(
    const std::string & username,
    const std::string & password
);

effectivePermissionsForUser virtual

void effectivePermissionsForUser(
    const std::string & username,
    std::set < std::string > & permissions
) const;

findUsersByAttribute virtual

std::vector < std::string > findUsersByAttribute(
    const std::string & attribute,
    const std::string & value
) const;

getUserAttribute virtual

std::string getUserAttribute(
    const std::string & username,
    const std::string & attribute,
    const std::string & deflt = std::string ()
) const;

grantPermissionsToRole virtual

void grantPermissionsToRole(
    const std::string & rolename,
    const std::set < std::string > & permissions
);

grantPermissionsToUser virtual

void grantPermissionsToUser(
    const std::string & username,
    const std::set < std::string > & permissions
);

invalidateCaches virtual

void invalidateCaches(
    int what = INVALIDATE_ALL
);

isA virtual

bool isA(
    const std::type_info & otherType
) const;

isExternalUser virtual

bool isExternalUser(
    const std::string & username
) const;

isUserLockedOut virtual

bool isUserLockedOut(
    const std::string & username
) const;

lockOutUser virtual

void lockOutUser(
    const std::string & username,
    const Poco::DateTime & lockOutUntil
);

permissionsForRole virtual

void permissionsForRole(
    const std::string & rolename,
    std::set < std::string > & permissions
) const;

permissionsForUser virtual

void permissionsForUser(
    const std::string & username,
    std::set < std::string > & permissions
) const;

removeRole virtual

void removeRole(
    const std::string & rolename
);

removeRoleFromUser virtual

void removeRoleFromUser(
    const std::string & username,
    const std::string & rolename
);

removeUser virtual

void removeUser(
    const std::string & username
);

removeUserAttribute virtual

void removeUserAttribute(
    const std::string & username,
    const std::string & attribute
);

replacePermissionsForRole virtual

void replacePermissionsForRole(
    const std::string & rolename,
    const std::set < std::string > & permissions
);

replacePermissionsForUser virtual

void replacePermissionsForUser(
    const std::string & username,
    const std::set < std::string > & permissions
);

replaceRolesForUser virtual

void replaceRolesForUser(
    const std::string & username,
    const std::set < std::string > & permissions
);

replaceUserAttributes virtual

void replaceUserAttributes(
    const std::string & username,
    const std::map < std::string, std::string > & attributes
);

reset virtual

void reset();

revokePermission virtual

void revokePermission(
    const std::string & permission
);

revokePermissionsFromRole virtual

void revokePermissionsFromRole(
    const std::string & rolename,
    const std::set < std::string > & permissions
);

revokePermissionsFromUser virtual

void revokePermissionsFromUser(
    const std::string & username,
    const std::set < std::string > & permissions
);

roleExists virtual

bool roleExists(
    const std::string & rolename
) const;

roles virtual

void roles(
    std::set < std::string > & roles
) const;

rolesForUser virtual

void rolesForUser(
    const std::string & username,
    std::set < std::string > & roles
) const;

setUserAttribute virtual

void setUserAttribute(
    const std::string & username,
    const std::string & attribute,
    const std::string & value
);

type virtual

const std::type_info & type() const;

uncacheUser virtual

void uncacheUser(
    const std::string & username
);

unlockOutUser virtual

void unlockOutUser(
    const std::string & username
);

updateUserAttributes virtual

void updateUserAttributes(
    const std::string & username,
    const std::map < std::string, std::string > & attributes
);

userEnabled virtual

bool userEnabled(
    const std::string & username
) const;

userExists virtual

bool userExists(
    const std::string & username
) const;

users virtual

int users(
    std::set < std::string > & users,
    int first = 0,
    int limit = 0
) const;

usersWithAttribute virtual

int usersWithAttribute(
    std::set < std::string > & users,
    const std::string & attribute,
    const std::string & value,
    int first = 0,
    int limit = 0
) const;

usersWithName virtual

int usersWithName(
    std::set < std::string > & users,
    const std::string & pattern,
    int first = 0,
    int limit = 0
) const;

usersWithPermission virtual

int usersWithPermission(
    std::set < std::string > & users,
    const std::string & permission,
    int first = 0,
    int limit = 0
) const;

usersWithRole virtual

int usersWithRole(
    std::set < std::string > & users,
    const std::string & role,
    int first = 0,
    int limit = 0
) const;

any protected

AuthAdminService::Ptr any() const;

forUser protected

AuthAdminService::Ptr forUser(
    const std::string & username
) const;

onRoleAdded protected

void onRoleAdded(
    const std::string & rolename
);

onRoleRemoved protected

void onRoleRemoved(
    const std::string & rolename
);

onUserAdded protected

void onUserAdded(
    const std::string & username
);

onUserRemoved protected

void onUserRemoved(
    const std::string & username
);

onValidateUser protected

void onValidateUser(
    ValidateUserEvent & event
);