AbstractRequestingAuthenticationDetailsProvider
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | AbstractFederationClientAuthenticationDetailsProviderBuilder.
This is a helper class to generate in-memory temporary session keys. |
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | |
| public static final String | AUTHORIZATION_HEADER_VALUE
The Authorization header value to be sent for requests to the metadata service. |
| protected CircuitBreakerConfiguration | circuitBreakerConfiguration
The configuration for the circuit breaker. |
| protected int | detectEndpointRetries
The number of retries for auto-detecting endpoint. |
| protected String | federationEndpoint
The federation endpoint url. |
| protected X509CertificateSupplier | leafCertificateSupplier
The leaf certificate, or null if detecting from instance metadata. |
| private static final Logger | |
| public static final String | METADATA_BASE_URL_ENV_VAR
Environment variable used to overwrite the default metadata base url. |
| public static final String | METADATA_SERVICE_BASE_URL
Default base url of metadata service. |
| public static final String | METADATA_URL_OVERRIDE
Metadata URL from environment variable, to use if present. |
| protected volatile String | metadataBaseUrl
Base url of metadata service. |
| private String | |
| protected Region | region
Detected region. |
| private static final String | |
| protected static final Service | SERVICE
Service instance for auth. |
| protected String | tenancyId
Tenancy OCI, or null if detecting from instance metadata. |
| protected int | timeoutForEachRetry
The custom timeout for each retry for auto-detecting endpoint. |
| private volatile boolean | wasImdsV2CheckExecuted
Flag to ensure V2 endpoint is only checked once, if successful. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | autoDetectCertificatesUsingMetadataUrl()
Auto detects and configures the certificates needed using Instance metadata. |
| protected String | Returns: The auto-detected, or currently set, auth endpoint.Auto detects the endpoint that should be used when talking to OCI Auth, if no endpoint has been configured already. |
| protected void | autoDetectUsingMetadataUrl()
Auto-detect endpoint and certificate information using Instance metadata. |
| public P | Returns: A new provider instance.Build a new AuthenticationDetailsProvider that uses the FederationClient. |
| protected abstract P | Returns: authentication details providerthe session key supplier to use sessionKeySupplierToUse)Build the actual provider. |
| public B | Returns: this builderthe circuit breaker to use circuitBreakerConfiguration)Configures the Circuit Breaker to use, if any. |
| protected FederationClient | Returns: the federation clientthe session key supplier sessionKeySupplier)Create the federation client. |
| public B | Returns: this builderthe number of retries detectEndpointRetries)Configures the custom retries to use for detecting endpoint. |
| private void | executeImdsV2EndpointCheck()
Checks the V2 endpoint for both federation endpoint detection & certificates if necessary. |
| public B | Returns: this builderthe federation endpoint federationEndpoint)Configures the custom federationEndpoint to use. |
| private <R> R | |
| public String | |
| public X509CertificateSupplier | |
| public String | |
| private URLBasedX509CertificateSupplier. | |
| public Region | |
| public String | |
| public B | Returns: this builderConfigures the custom leafCertificateSupplier to use. |
| public B | Returns: this builderthe metadata base url metadataBaseUrl)Configure the metadata endpoint to use when retrieving the instance data and principal for federation. |
| protected B | |
| public B | |
| public B | Returns: this builderthe custom timeout timeoutForEachRetry)Configures the custom timeout for each retry to use for detecting endpoint. |
| AUTHORIZATION_HEADER | back to summary |
|---|---|
| private static final Map<String, String> AUTHORIZATION_HEADER | |
| AUTHORIZATION_HEADER_VALUE | back to summary |
|---|---|
| public static final String AUTHORIZATION_HEADER_VALUE The Authorization header value to be sent for requests to the metadata service. | |
| circuitBreakerConfiguration | back to summary |
|---|---|
| protected CircuitBreakerConfiguration circuitBreakerConfiguration The configuration for the circuit breaker. | |
| detectEndpointRetries | back to summary |
|---|---|
| protected int detectEndpointRetries The number of retries for auto-detecting endpoint. | |
| federationEndpoint | back to summary |
|---|---|
| protected String federationEndpoint The federation endpoint url. | |
| leafCertificateSupplier | back to summary |
|---|---|
| protected X509CertificateSupplier leafCertificateSupplier The leaf certificate, or null if detecting from instance metadata. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| METADATA_BASE_URL_ENV_VAR | back to summary |
|---|---|
| public static final String METADATA_BASE_URL_ENV_VAR Environment variable used to overwrite the default metadata base url. | |
| METADATA_SERVICE_BASE_URL | back to summary |
|---|---|
| public static final String METADATA_SERVICE_BASE_URL Default base url of metadata service. | |
| METADATA_URL_OVERRIDE | back to summary |
|---|---|
| public static final String METADATA_URL_OVERRIDE Metadata URL from environment variable, to use if present. | |
| metadataBaseUrl | back to summary |
|---|---|
| protected volatile String metadataBaseUrl Base url of metadata service. | |
| purpose | back to summary |
|---|---|
| private String purpose | |
| region | back to summary |
|---|---|
| protected Region region Detected region. | |
| REGION_PATH_LITERAL | back to summary |
|---|---|
| private static final String REGION_PATH_LITERAL | |
| SERVICE | back to summary |
|---|---|
| protected static final Service SERVICE Service instance for auth. | |
| tenancyId | back to summary |
|---|---|
| protected String tenancyId Tenancy OCI, or null if detecting from instance metadata. | |
| timeoutForEachRetry | back to summary |
|---|---|
| protected int timeoutForEachRetry The custom timeout for each retry for auto-detecting endpoint. | |
| wasImdsV2CheckExecuted | back to summary |
|---|---|
| private volatile boolean wasImdsV2CheckExecuted Flag to ensure V2 endpoint is only checked once, if successful. | |
| AbstractFederationClientAuthenticationDetailsProviderBuilder | back to summary |
|---|---|
| public AbstractFederationClientAuthenticationDetailsProviderBuilder() | |
| autoDetectCertificatesUsingMetadataUrl | back to summary |
|---|---|
| protected void autoDetectCertificatesUsingMetadataUrl() Auto detects and configures the certificates needed using Instance metadata. | |
| autoDetectEndpointUsingMetadataUrl | back to summary |
|---|---|
| protected String autoDetectEndpointUsingMetadataUrl() Auto detects the endpoint that should be used when talking to OCI Auth, if no endpoint has been configured already.
| |
| autoDetectUsingMetadataUrl | back to summary |
|---|---|
| protected void autoDetectUsingMetadataUrl() Auto-detect endpoint and certificate information using Instance metadata. | |
| build | back to summary |
|---|---|
| public P build() Build a new AuthenticationDetailsProvider that uses the FederationClient.
| |
| buildProvider | back to summary |
|---|---|
| protected abstract P buildProvider(SessionKeySupplier sessionKeySupplierToUse) Build the actual provider.
| |
| circuitBreakerConfigurator | back to summary |
|---|---|
| public B circuitBreakerConfigurator(CircuitBreakerConfiguration circuitBreakerConfiguration) Configures the Circuit Breaker to use, if any.
| |
| createFederationClient | back to summary |
|---|---|
| protected FederationClient createFederationClient(SessionKeySupplier sessionKeySupplier) Create the federation client.
| |
| detectEndpointRetries | back to summary |
|---|---|
| public B detectEndpointRetries(int detectEndpointRetries) Configures the custom retries to use for detecting endpoint.
| |
| executeImdsV2EndpointCheck | back to summary |
|---|---|
| private void executeImdsV2EndpointCheck() Checks the V2 endpoint for both federation endpoint detection & certificates if necessary. | |
| federationEndpoint | back to summary |
|---|---|
| public B federationEndpoint(String federationEndpoint) Configures the custom federationEndpoint to use.
| |
| fetchRegion | back to summary |
|---|---|
| private <R> R fetchRegion(Function<HttpResponse, CompletionStage<R>> responseHandler) | |
| getFederationEndpoint | back to summary |
|---|---|
| public String getFederationEndpoint() | |
| getLeafCertificateSupplier | back to summary |
|---|---|
| public X509CertificateSupplier getLeafCertificateSupplier() | |
| getMetadataBaseUrl | back to summary |
|---|---|
| public String getMetadataBaseUrl() | |
| getMetadataResourceDetails | back to summary |
|---|---|
| private URLBasedX509CertificateSupplier. | |
| getRegion | back to summary |
|---|---|
| public Region getRegion() | |
| getTenancyId | back to summary |
|---|---|
| public String getTenancyId() | |
| leafCertificateSupplier | back to summary |
|---|---|
| public B leafCertificateSupplier(X509CertificateSupplier leafCertificateSupplier) Configures the custom leafCertificateSupplier to use.
| |
| metadataBaseUrl | back to summary |
|---|---|
| public B metadataBaseUrl(String metadataBaseUrl) Configure the metadata endpoint to use when retrieving the instance data and principal for federation.
| |
| purpose | back to summary |
|---|---|
| protected B purpose(String purpose) Configure the purpose to be used.
| |
| tenancyId | back to summary |
|---|---|
| public B tenancyId(String tenancyId) Configures the tenancy id to use.
| |
| timeoutForEachRetry | back to summary |
|---|---|
| public B timeoutForEachRetry(int timeoutForEachRetry) Configures the custom timeout for each retry to use for detecting endpoint.
| |
The thread safety of this class is ensured through the Caching class above which synchronizes on all methods.
The class is implemented in a lazy way to avoid generating the key if it is not needed or if refresh is immediately called.
| Modifier and Type | Field and Description |
|---|---|
| private static final KeyPairGenerator | |
| private KeyPair |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public KeyPair | getKeyPair()
Implements com. Returns the current RSA key pair. |
| public void | refreshKeys()
Implements com. If the auth service-issued security token expires, the federation client will try to re-generate a new set of keys by calling this method. |
| GENERATOR | back to summary |
|---|---|
| private static final KeyPairGenerator GENERATOR | |
| keyPair | back to summary |
|---|---|
| private KeyPair keyPair | |
| SessionKeySupplierImpl | back to summary |
|---|---|
| pack-priv SessionKeySupplierImpl() | |
| getKeyPair | back to summary |
|---|---|
| public KeyPair getKeyPair() Implements com. Doc from com. Returns the current RSA key pair. | |
| refreshKeys | back to summary |
|---|---|
| public void refreshKeys() Implements com. Doc from com. If the auth service-issued security token expires, the federation client will try to re-generate a new set of keys by calling this method. The implementer should create a new pair of keys for security reasons. Refreshing keys should not be a long-running blocking call. You can refresh keys in an async thread and return from this method immediately. When the async process is done refreshing the keys, the client code will automatically pick up the latest set of keys and update the security token accordingly
| |