Package org.yamcs.security
Class Directory
- java.lang.Object
-
- org.yamcs.security.Directory
-
public class Directory extends Object
Stores user, group and application information in the Yamcs database.
-
-
Constructor Summary
Constructors Constructor Description Directory()
-
Method Summary
-
-
-
Constructor Detail
-
Directory
public Directory() throws InitException- Throws:
InitException
-
-
Method Detail
-
addUser
public void addUser(User user) throws IOException
- Throws:
IOException
-
updateUserProperties
public void updateUserProperties(User user) throws IOException
- Throws:
IOException
-
addGroup
public void addGroup(Group group) throws IOException
- Throws:
IOException
-
renameGroup
public void renameGroup(String from, String to) throws IOException
- Throws:
IOException
-
updateGroupProperties
public void updateGroupProperties(Group group) throws IOException
- Throws:
IOException
-
deleteGroup
public void deleteGroup(Group group) throws IOException
- Throws:
IOException
-
addServiceAccount
public ApplicationCredentials addServiceAccount(ServiceAccount service) throws IOException
Creates a new service account. The service account is assumed to represent one application only, for which automatically generated credentials are returned. These may be used to identify as that application, for example to generate access tokens.- Throws:
IOException
-
deleteServiceAccount
public void deleteServiceAccount(String name)
-
updateApplicationProperties
public void updateApplicationProperties(ServiceAccount service) throws IOException
- Throws:
IOException
-
validateUserPassword
public boolean validateUserPassword(String username, char[] password)
Validates the provided password against the stored password hash of a user.
-
validateApplicationPassword
public boolean validateApplicationPassword(String applicationId, char[] password)
Validates the provided password against the stored password hash of an application.Currently this is only functional for service accounts (which map to one and only one application), but some day we may also want to support user applications.
-
changePassword
public void changePassword(User user, char[] password) throws IOException
- Throws:
IOException
-
getUser
public User getUser(int id)
-
getServiceAccount
public ServiceAccount getServiceAccount(String name)
-
getServiceAccounts
public List<ServiceAccount> getServiceAccounts()
-
-