T
- the auth scheme trait to convert.public interface SecuritySchemeConverter<T extends Trait>
Implementations of this interface are discovered using Java SPI.
Modifier and Type | Method and Description |
---|---|
default java.util.List<java.lang.String> |
createSecurityRequirements(Context<? extends Trait> context,
T authTrait,
Shape shape)
Creates a "security" requirements property to apply to an operation
or top-level service using the Smithy auth scheme name as the key.
|
SecurityScheme |
createSecurityScheme(Context<? extends Trait> context,
T authTrait)
Creates an OpenAPI security scheme.
|
default java.util.Set<java.lang.String> |
getAuthRequestHeaders(Context<? extends Trait> context,
T authTrait)
Gets the names of the headers set on HTTP requests used by this
authentication scheme.
|
default java.util.Set<java.lang.String> |
getAuthResponseHeaders(Context<? extends Trait> context,
T authTrait)
Gets the names of the headers set on HTTP responses used by this
authentication scheme.
|
default ShapeId |
getAuthSchemeId()
Gets the shape ID of the auth scheme type.
|
java.lang.Class<T> |
getAuthSchemeType()
Get the U that matches this converter.
|
default java.lang.String |
getOpenApiAuthSchemeName()
Gets the name of OpenApi auth scheme.
|
default boolean |
usesHttpCredentials()
Reports if this authentication mechanism uses HTTP credentials, such as
cookies, browser-managed usernames and passwords, or TLS client
certificates.
|
java.lang.Class<T> getAuthSchemeType()
default ShapeId getAuthSchemeId()
By default, this operation uses reflection to get the value of a static property of the auth scheme class named "ID". If that is not how a specific auth scheme class is implemented, then this method must be overridden.
SecurityScheme createSecurityScheme(Context<? extends Trait> context, T authTrait)
context
- Conversion context.authTrait
- Authentication trait to convert.default java.util.List<java.lang.String> createSecurityRequirements(Context<? extends Trait> context, T authTrait, Shape shape)
The default implementation will return an empty list.
context
- OpenAPI contextauthTrait
- Authentication trait to convert.shape
- Service or operation shape.default java.lang.String getOpenApiAuthSchemeName()
For compatibility with Amazon API Gateway, the `#` is replaced with an `.` when deriving the name from the auth scheme's shape ID.
default java.util.Set<java.lang.String> getAuthRequestHeaders(Context<? extends Trait> context, T authTrait)
This is useful when integrating with things like CORS.
context
- Context for the conversion.authTrait
- The auth trait that is being used.default java.util.Set<java.lang.String> getAuthResponseHeaders(Context<? extends Trait> context, T authTrait)
This is useful when integrating with things like CORS.
context
- Context for the conversion.authTrait
- The auth trait that is being used.default boolean usesHttpCredentials()
This is useful when integrating with things like CORS.