Class Directory

java.lang.Object
org.yamcs.security.Directory

public class Directory extends Object
Stores user, group and application information in the Yamcs database.
  • Field Details

  • Constructor Details

  • Method Details

    • addUser

      public void addUser(User user) throws IOException
      Throws:
      IOException
    • updateUserProperties

      public void updateUserProperties(User user)
    • deleteUser

      public void deleteUser(User user) throws IOException
      Throws:
      IOException
    • addGroup

      public void addGroup(Group group)
    • renameGroup

      public void renameGroup(String from, String to)
    • updateGroupProperties

      public void updateGroupProperties(Group group)
    • deleteGroup

      public void deleteGroup(Group group)
    • 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(ServiceAccount service)
    • updateApplicationProperties

      public void updateApplicationProperties(ServiceAccount service)
    • validateUserPassword

      public boolean validateUserPassword(String username, char[] password)
      Validates the provided password against the stored password hash of a user.
      Returns:
      true if the password is correct, false otherwise
    • 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)
    • getAccount

      public Account getAccount(String name)
    • getUser

      public User getUser(long id)
    • getUser

      public User getUser(String username)
    • getUsers

      public List<User> getUsers()
    • getAccountForApplication

      public Account getAccountForApplication(String applicationId)
    • getGroup

      public Group getGroup(String name)
    • getGroups

      public List<Group> getGroups()
    • getGroups

      public List<Group> getGroups(User user)
    • getServiceAccount

      public ServiceAccount getServiceAccount(String name)
    • getServiceAccounts

      public List<ServiceAccount> getServiceAccounts()
    • getRoles

      public List<Role> getRoles()
    • getRole

      public Role getRole(String name)