Class RegistrySpec.TokenExchangeSpec

java.lang.Object
com.konfigyr.gradle.RegistrySpec.TokenExchangeSpec
Enclosing class:
RegistrySpec

@NullMarked public static class RegistrySpec.TokenExchangeSpec extends Object
Configures a TokenExchange, used for the OAuth2 Token Exchange grant, as defined by RFC 8693.
Since:
1.2.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TokenExchangeSpec(org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, boolean useEnvironmentConventions)
    Creates a new RegistrySpec.TokenExchangeSpec, instantiated by Gradle when RegistrySpec.tokenExchange(Action) is first called for a given registry.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.gradle.api.provider.Property<String>
    Specify the OAuth client_id that 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 the subjectToken (for example urn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:id_token).
    boolean
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TokenExchangeSpec

      @Inject public TokenExchangeSpec(org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, boolean useEnvironmentConventions)
      Creates a new RegistrySpec.TokenExchangeSpec, instantiated by Gradle when RegistrySpec.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

      public org.gradle.api.provider.Property<String> getClientId()
      Specify the OAuth client_id that is used to get the OAuth access token. For the reserved konfigyrCentral registry, this value can be specified by the KONFIGYR_CLIENT_ID environment variable - every other registry requires it to be set explicitly.
    • getSubjectToken

      public org.gradle.api.provider.Property<String> getSubjectToken()
      The token being exchanged for an access token. For the reserved konfigyrCentral registry, this value can be specified by the KONFIGYR_SUBJECT_TOKEN environment variable - every other registry requires it to be set explicitly.
    • getSubjectTokenType

      public org.gradle.api.provider.Property<String> getSubjectTokenType()
      An identifier, as defined by RFC 8693, for the type of the subjectToken (for example urn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:id_token). There is no default value and no environment variable fallback, even for the reserved konfigyrCentral registry - 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 that subjectTokenType never falls back to an environment variable, even here.