Class AuthConfig

java.lang.Object
com.linecorp.centraldogma.server.auth.AuthConfig

public final class AuthConfig extends Object
An authentication configuration for the Central Dogma server.
  • Field Details

    • DEFAULT_SESSION_TIMEOUT_MILLIS

      public static final long DEFAULT_SESSION_TIMEOUT_MILLIS
      A default session timeout in milliseconds.
      See Also:
    • DEFAULT_SESSION_CACHE_SPEC

      public static final String DEFAULT_SESSION_CACHE_SPEC
      A default specification for a session cache.
      See Also:
    • DEFAULT_SESSION_VALIDATION_SCHEDULE

      public static final String DEFAULT_SESSION_VALIDATION_SCHEDULE
      A default schedule for validating sessions at 0:30, 4:30, 8:30, 12:30, 16:30 and 20:30 for every day.
      See Also:
  • Constructor Details

    • AuthConfig

      public AuthConfig(String factoryClassName, @Nullable Set<String> administrators, @Nullable Boolean caseSensitiveLoginNames, @Nullable String sessionCacheSpec, @Nullable Long sessionTimeoutMillis, @Nullable String sessionValidationSchedule, @Nullable JsonNode properties) throws Exception
      Creates a new instance.
      Parameters:
      factoryClassName - the fully-qualified class name of the AuthProviderFactory
      administrators - the login names of the administrators
      caseSensitiveLoginNames - the flag whether case-sensitive matching is performed when login names are compared
      sessionCacheSpec - the cache specification which determines the capacity and behavior of the cache for Session of the server
      sessionTimeoutMillis - the timeout for Sessions of the server
      sessionValidationSchedule - the schedule for validating sessions
      properties - the additional properties which are used in the factory
      Throws:
      Exception
    • AuthConfig

      public AuthConfig(AuthProviderFactory factory, Set<String> administrators, boolean caseSensitiveLoginNames, String sessionCacheSpec, long sessionTimeoutMillis, String sessionValidationSchedule, @Nullable JsonNode properties)
      Creates a new instance.
      Parameters:
      factory - the AuthProviderFactory instance
      administrators - the login names of the administrators
      caseSensitiveLoginNames - the flag whether case-sensitive matching is performed when login names are compared
      sessionCacheSpec - the cache specification which determines the capacity and behavior of the cache for Session of the server
      sessionTimeoutMillis - the timeout for Sessions of the server
      sessionValidationSchedule - the schedule for validating sessions
      properties - the additional properties which are used in the factory
  • Method Details

    • factory

      public AuthProviderFactory factory()
      Returns the AuthProviderFactory.
    • factoryClassName

      public String factoryClassName()
      Returns the class name of the AuthProviderFactory.
    • administrators

      public Set<String> administrators()
      Returns the usernames of the users with administrator rights.
    • caseSensitiveLoginNames

      public boolean caseSensitiveLoginNames()
      Returns whether login names are case-sensitive.
    • sessionCacheSpec

      public String sessionCacheSpec()
      Returns the spec of the session cache.
    • sessionTimeoutMillis

      public long sessionTimeoutMillis()
      Returns the timeout of an inactive session in milliseconds.
    • sessionValidationSchedule

      public String sessionValidationSchedule()
      Returns the cron expression that describes how often session validation task should run.
    • properties

      @Nullable public JsonNode properties()
      Returns the additional properties given to the AuthProviderFactory.
    • properties

      @Nullable public <T> T properties(Class<T> clazz) throws JsonProcessingException
      Returns the additional properties, converted to T.
      Throws:
      JsonProcessingException
    • loginNameNormalizer

      public Function<String,String> loginNameNormalizer()
      Returns a Function which normalizes a login name based on the caseSensitiveLoginNames() property.
    • toString

      public String toString()
      Overrides:
      toString in class Object