dmlite
0.6
src
core
builtin
Authn.h
Go to the documentation of this file.
1
/// @file core/builtin/Authn.h
2
/// @brief User and group mapping using the system's ones.
3
/// @details This will be used by default when no other Authn
4
/// implementeation is loaded.
5
/// @author Alejandro Álvarez Ayllon <aalvarez@cern.ch>
6
#ifndef BUILTIN_AUTHN_H
7
#define BUILTIN_AUTHN_H
8
9
#include <
dmlite/cpp/authn.h
>
10
11
namespace
dmlite
{
12
13
class
BuiltInAuthn
:
public
Authn
{
14
public
:
15
BuiltInAuthn
(
const
std::string&,
const
std::string&);
16
~BuiltInAuthn
();
17
18
std::string
getImplId
(
void
)
const
throw
();
19
20
virtual
SecurityContext
*
createSecurityContext
(
const
SecurityCredentials
& cred)
throw
(
DmException
);
21
virtual
SecurityContext
*
createSecurityContext
()
throw
(
DmException
);
22
23
GroupInfo
newGroup
(
const
std::string& gname)
throw
(
DmException
);
24
GroupInfo
getGroup
(gid_t gid)
throw
(
DmException
);
25
GroupInfo
getGroup
(
const
std::string& groupName)
throw
(
DmException
);
26
GroupInfo
getGroup
(
const
std::string& key,
27
const
boost::any& value)
throw
(
DmException
);
28
void
updateGroup
(
const
GroupInfo
& group)
throw
(
DmException
);
29
void
deleteGroup
(
const
std::string& groupName)
throw
(
DmException
);
30
31
UserInfo
newUser
(
const
std::string& uname)
throw
(
DmException
);
32
UserInfo
getUser
(
const
std::string& userName)
throw
(
DmException
);
33
UserInfo
getUser
(
const
std::string& userName,
34
gid_t* group)
throw
(
DmException
);
35
UserInfo
getUser
(
const
std::string& key,
36
const
boost::any& value)
throw
(
DmException
);
37
void
updateUser
(
const
UserInfo
& user)
throw
(
DmException
);
38
void
deleteUser
(
const
std::string& userName)
throw
(
DmException
);
39
40
std::vector<GroupInfo>
getGroups
(
void
)
throw
(
DmException
);
41
std::vector<UserInfo>
getUsers
(
void
)
throw
(
DmException
);
42
43
void
getIdMap
(
const
std::string& userName,
44
const
std::vector<std::string>& groupNames,
45
UserInfo
* user,
46
std::vector<GroupInfo>* groups)
throw
(
DmException
);
47
private
:
48
std::string
nobody_
;
49
std::string
nogroup_
;
50
};
51
52
class
BuiltInAuthnFactory
:
public
AuthnFactory
{
53
public
:
54
BuiltInAuthnFactory
();
55
~
BuiltInAuthnFactory
();
56
57
void
configure(
const
std::string& key,
const
std::string& value)
throw
(
DmException
);
58
59
Authn
* createAuthn(
PluginManager
* pm)
throw
(
DmException
);
60
61
private
:
62
std::string
nobody_
;
63
std::string
nogroup_
;
64
};
65
66
};
67
68
#endif // BUILTIN_AUTHN_H
dmlite::UserInfo
Definition:
authn.h:42
dmlite::BuiltInAuthn::newUser
UserInfo newUser(const std::string &uname)
dmlite::BuiltInAuthn::BuiltInAuthn
BuiltInAuthn(const std::string &, const std::string &)
dmlite::BuiltInAuthn::updateUser
void updateUser(const UserInfo &user)
dmlite::SecurityContext
Security context. To be created by the Authn.
Definition:
authn.h:64
dmlite::DmException
Base exception class.
Definition:
exceptions.h:17
dmlite::BuiltInAuthn::updateGroup
void updateGroup(const GroupInfo &group)
dmlite::PluginManager
CatalogInterface can only be instantiated through this class.
Definition:
dmlite.h:42
dmlite::Authn
Definition:
authn.h:87
dmlite::BuiltInAuthnFactory::nobody_
std::string nobody_
Definition:
Authn.h:62
dmlite::BuiltInAuthn::~BuiltInAuthn
~BuiltInAuthn()
dmlite::BuiltInAuthn::nogroup_
std::string nogroup_
Definition:
Authn.h:49
dmlite::BuiltInAuthnFactory::nogroup_
std::string nogroup_
Definition:
Authn.h:63
authn.h
Authentication API. Any sort of security check is plugin-specific.
dmlite::AuthnFactory
AuthnFactory.
Definition:
authn.h:177
dmlite::BuiltInAuthn::getGroups
std::vector< GroupInfo > getGroups(void)
Get the group list.
dmlite::BuiltInAuthn::newGroup
GroupInfo newGroup(const std::string &gname)
dmlite::BuiltInAuthn::deleteUser
void deleteUser(const std::string &userName)
Delete a user.
dmlite::BuiltInAuthnFactory
Definition:
Authn.h:52
dmlite::BuiltInAuthn::getImplId
std::string getImplId(void) const
String ID of the user DB implementation.
dmlite::GroupInfo
Definition:
authn.h:53
dmlite::BuiltInAuthn
Definition:
Authn.h:13
dmlite::BuiltInAuthn::getIdMap
void getIdMap(const std::string &userName, const std::vector< std::string > &groupNames, UserInfo *user, std::vector< GroupInfo > *groups)
dmlite::BuiltInAuthn::getUsers
std::vector< UserInfo > getUsers(void)
Get the user list.
dmlite::BuiltInAuthn::getGroup
GroupInfo getGroup(gid_t gid)
dmlite::BuiltInAuthn::deleteGroup
void deleteGroup(const std::string &groupName)
Delete a group.
dmlite::SecurityCredentials
Security credentials. To be filled by the front-end.
Definition:
authn.h:22
dmlite
Namespace for the dmlite C++ API.
Definition:
authn.h:15
dmlite::BuiltInAuthn::nobody_
std::string nobody_
Definition:
Authn.h:48
dmlite::BuiltInAuthn::getUser
UserInfo getUser(const std::string &userName)
dmlite::BuiltInAuthn::createSecurityContext
virtual SecurityContext * createSecurityContext()
Generated on Fri Aug 31 2018 07:31:40 for dmlite by
1.8.13