public final class Security extends Object
SecurityContext.
It is possible to configure it manually using builder() or use fromConfig(Config) to initialize using
configuration support.
Security is constructed from various providers SecurityProvider and
a selection policy ProviderSelectionPolicy to choose the right one(s) to
secure a request.
builder(),
fromConfig(Config)| Modifier and Type | Class | Description |
|---|---|---|
static class |
Security.Builder |
Builder pattern class for helping create
Security in a convenient way. |
| Modifier and Type | Field | Description |
|---|---|---|
static String |
HEADER_ORIG_URI |
Integration should add a special header to each request.
|
| Modifier and Type | Method | Description |
|---|---|---|
static Security.Builder |
builder() |
Creates
Security.Builder class. |
static Security.Builder |
builderFromConfig(Config config) |
Creates new instance based on configuration values.
|
SecurityContext.Builder |
contextBuilder(String id) |
Create a new security context builder to build and instance.
|
SecurityContext |
createContext(String id) |
Create a new security context with the defined id and all defaults.
|
SecurityEnvironment.Builder |
environmentBuilder() |
Security environment builder, to be used to create
environment for evaluating security in integration components.
|
static Security |
fromConfig(Config config) |
Creates new instance based on configuration values.
|
Collection<Class<? extends Annotation>> |
getCustomAnnotations() |
Get the complete set of annotations expected by (all) security providers configured.
|
static Set<String> |
getRoles(Subject subject) |
Get a set of roles the subject has, based on
Role. |
SecurityTime |
getServerTime() |
Time that is decisive for the server.
|
io.opentracing.Tracer |
getTracer() |
Returns a tracer that can be used to construct new spans.
|
public static final String HEADER_ORIG_URI
public static Security fromConfig(Config config)
config - Config instancepublic static Security.Builder builderFromConfig(Config config)
config - Config instancepublic static Security.Builder builder()
Security.Builder class.public static Set<String> getRoles(Subject subject)
Role.
This is the set of roles as assumed by authentication provider. Authorization providers may use a different set of
roles (and context used authorization provider to check SecurityContext.isUserInRole(String)).subject - Subject of a user/servicepublic SecurityTime getServerTime()
SecurityTime may be configured to a fixed point in time, intended for
testing purposes.
public SecurityContext.Builder contextBuilder(String id)
SecurityContext.logout() to
clear subject and principals.id - to use when logging, auditing etc. (e.g. some kind of tracing id). If none or empty, security instance
UUID will be used (at least to map all audit records for a single instance of security component). If
defined, security will prefix this id with security instance UUIDSecurityContextpublic SecurityContext createContext(String id)
id - id of this contextpublic io.opentracing.Tracer getTracer()
Tracer, may be a no-op tracer if tracing is disabledpublic Collection<Class<? extends Annotation>> getCustomAnnotations()
public SecurityEnvironment.Builder environmentBuilder()
SecurityEnvironmentCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.