Package com.konfigyr.gradle
Class RegistrySpec.TokenExchangeSpec
java.lang.Object
com.konfigyr.gradle.RegistrySpec.TokenExchangeSpec
- Enclosing class:
RegistrySpec
Configures a
TokenExchange, used for the OAuth2 Token Exchange grant, as defined by
RFC 8693.- Since:
- 1.2.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTokenExchangeSpec(org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, boolean useEnvironmentConventions) Creates a newRegistrySpec.TokenExchangeSpec, instantiated by Gradle whenRegistrySpec.tokenExchange(Action)is first called for a given registry. -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.api.provider.Property<String> Specify the OAuthclient_idthat is used to get the OAuth access token.org.gradle.api.provider.Property<String> The token being exchanged for an access token.org.gradle.api.provider.Property<String> An identifier, as defined by RFC 8693, for the type of thesubjectToken(for exampleurn:ietf:params:oauth:token-type:jwtorurn:ietf:params:oauth:token-type:id_token).booleanWhether this grant falls back to Konfigyr's well-known environment variables (KONFIGYR_CLIENT_ID/KONFIGYR_SUBJECT_TOKEN) when a property is left unset - true only for the reserved "konfigyrCentral" registry, every other registry must set every property explicitly.
-
Constructor Details
-
TokenExchangeSpec
@Inject public TokenExchangeSpec(org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, boolean useEnvironmentConventions) Creates a newRegistrySpec.TokenExchangeSpec, instantiated by Gradle whenRegistrySpec.tokenExchange(Action)is first called for a given registry.- Parameters:
factory- the Gradle object factory, cannot be null.providers- the Gradle provider factory, used to resolve environment variable conventions, cannot be null.useEnvironmentConventions- true only for the reserved "konfigyrCentral" registry, enabling its environment variable fallbacks.
-
-
Method Details
-
getClientId
Specify the OAuthclient_idthat is used to get the OAuth access token. For the reservedkonfigyrCentralregistry, this value can be specified by theKONFIGYR_CLIENT_IDenvironment variable - every other registry requires it to be set explicitly. -
getSubjectToken
The token being exchanged for an access token. For the reservedkonfigyrCentralregistry, this value can be specified by theKONFIGYR_SUBJECT_TOKENenvironment variable - every other registry requires it to be set explicitly. -
getSubjectTokenType
An identifier, as defined by RFC 8693, for the type of thesubjectToken(for exampleurn:ietf:params:oauth:token-type:jwtorurn:ietf:params:oauth:token-type:id_token). There is no default value and no environment variable fallback, even for the reservedkonfigyrCentralregistry - this must always be set explicitly. -
isUseEnvironmentConventions
public boolean isUseEnvironmentConventions()Whether this grant falls back to Konfigyr's well-known environment variables (KONFIGYR_CLIENT_ID/KONFIGYR_SUBJECT_TOKEN) when a property is left unset - true only for the reserved "konfigyrCentral" registry, every other registry must set every property explicitly. Note thatsubjectTokenTypenever falls back to an environment variable, even here.
-