Package org.apache.druid.server.security
Class AuthConfig
- java.lang.Object
-
- org.apache.druid.server.security.AuthConfig
-
public class AuthConfig extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAuthConfig.BuilderAuthConfig object is created via Jackson in production.
-
Field Summary
Fields Modifier and Type Field Description static StringALLOW_ALL_NAMEstatic Set<String>ALLOWED_CONTEXT_KEYSSet of context keys which are always permissible because something in the Druid code itself sets the key before the security check.static StringANONYMOUS_NAMEstatic StringDRUID_ALLOW_UNSECURED_PATHstatic StringDRUID_AUTHENTICATION_RESULTHTTP attribute that holds an AuthenticationResult, with info about a successful authentication check.static StringDRUID_AUTHORIZATION_CHECKEDHTTP attribute set when a static method in AuthorizationUtils performs an authorization check on the request.static StringTRUSTED_DOMAIN_NAME
-
Constructor Summary
Constructors Constructor Description AuthConfig()AuthConfig(List<String> authenticatorChain, List<String> authorizers, List<String> unsecuredPaths, boolean allowUnauthenticatedHttpOptions, boolean authorizeQueryContextParams, Set<String> unsecuredContextKeys, Set<String> securedContextKeys, boolean enableInputSourceSecurity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthorizeQueryContextParams()Set<String>contextKeysToAuthorize(Set<String> userKeys)Filter the user-supplied context keys based on the context key security rules.booleanequals(Object o)List<String>getAuthenticatorChain()List<String>getAuthorizers()List<String>getUnsecuredPaths()inthashCode()booleanisAllowUnauthenticatedHttpOptions()booleanisEnableInputSourceSecurity()static AuthConfig.BuildernewBuilder()StringtoString()
-
-
-
Field Detail
-
DRUID_AUTHENTICATION_RESULT
public static final String DRUID_AUTHENTICATION_RESULT
HTTP attribute that holds an AuthenticationResult, with info about a successful authentication check.- See Also:
- Constant Field Values
-
DRUID_AUTHORIZATION_CHECKED
public static final String DRUID_AUTHORIZATION_CHECKED
HTTP attribute set when a static method in AuthorizationUtils performs an authorization check on the request.- See Also:
- Constant Field Values
-
DRUID_ALLOW_UNSECURED_PATH
public static final String DRUID_ALLOW_UNSECURED_PATH
- See Also:
- Constant Field Values
-
ALLOW_ALL_NAME
public static final String ALLOW_ALL_NAME
- See Also:
- Constant Field Values
-
ANONYMOUS_NAME
public static final String ANONYMOUS_NAME
- See Also:
- Constant Field Values
-
TRUSTED_DOMAIN_NAME
public static final String TRUSTED_DOMAIN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isAllowUnauthenticatedHttpOptions
public boolean isAllowUnauthenticatedHttpOptions()
-
authorizeQueryContextParams
public boolean authorizeQueryContextParams()
-
isEnableInputSourceSecurity
public boolean isEnableInputSourceSecurity()
-
contextKeysToAuthorize
public Set<String> contextKeysToAuthorize(Set<String> userKeys)
Filter the user-supplied context keys based on the context key security rules. If context key security is disabled, then allow all keys. Else, apply the three key lists defined here.- Allow Druid-defined keys.
- Allow anything not in the secured context key list.
- Allow anything in the config-defined unsecured key list.
- Returns:
- the list of secured keys to check via authentication
-
newBuilder
public static AuthConfig.Builder newBuilder()
-
-