Class KonfigyrExtension

java.lang.Object
com.konfigyr.gradle.KonfigyrExtension

@NullMarked public class KonfigyrExtension extends Object
Configuration extension for the Konfigyr Gradle plugin.

Exposes the konfigyr { } DSL block in the consuming project's build script. Exactly one OAuth2 grant type must be selected, either client credentials:


 konfigyr {
     host = "https://api.konfigyr.io"            // defaults to https://api.konfigyr.com
     tokenUri = "https://id.konfigyr.io/oauth/token" // defaults to https://id.konfigyr.com/oauth/token

     clientCredentials {
         clientId     = "acme-corp-client" or `KONFIGYR_CLIENT_ID` environment property
         clientSecret = "acme-corp-secret" or `KONFIGYR_CLIENT_SECRET` environment property
     }

     // Optional: this project's service identity, needed only for the service-release scenario
     service {
         namespace = "acme-corp" or `KONFIGYR_NAMESPACE` environment property
         name      = "order-service" // defaults to project.name
     }

     // Optional: direct-publish polling behavior
     publish {
         pollTimeout  = 10000L // defaults to 10 minutes
         pollInterval = 1000L  // defaults to 1 second
     }
 }

or token exchange:


 konfigyr {
     tokenExchange {
         clientId         = "acme-corp-client" or `KONFIGYR_CLIENT_ID` environment property
         subjectToken     = "..." or `KONFIGYR_SUBJECT_TOKEN` environment property
         subjectTokenType = "urn:ietf:params:oauth:token-type:jwt" // no default, must be set explicitly
     }
 }
Since:
1.0.0
See Also:
  • Constructor Details

    • KonfigyrExtension

      public KonfigyrExtension(org.gradle.api.Project project, org.gradle.api.model.ObjectFactory factory)
      Creates a new KonfigyrExtension instance.
      Parameters:
      project - the Gradle project
      factory - the Gradle object factory
  • Method Details

    • clientCredentials

      public void clientCredentials(org.gradle.api.Action<KonfigyrExtension.ClientCredentialsSpec> action)
      Configures ClientCredentials, for the OAuth2 client_credentials grant.
      Parameters:
      action - configures the client credentials, cannot be null.
    • tokenExchange

      public void tokenExchange(org.gradle.api.Action<KonfigyrExtension.TokenExchangeSpec> action)
      Configures a TokenExchange, for the OAuth2 Token Exchange grant.
      Parameters:
      action - configures the token exchange, cannot be null.
    • service

      public void service(org.gradle.api.Action<KonfigyrExtension.ServiceSpec> action)
      Configures this project's service identity, used by the service-release scenario.
      Parameters:
      action - configures the service identity, cannot be null.
    • publish

      public void publish(org.gradle.api.Action<KonfigyrExtension.PublishSpec> action)
      Parameters:
      action - configures the publish behavior, cannot be null.
    • getHost

      public org.gradle.api.provider.Property<String> getHost()
      Host where the Konfigyr server is reachable, defaults to https://api.konfigyr.com.
    • getTokenUri

      public org.gradle.api.provider.Property<String> getTokenUri()
      The location where this plugin would perform the OAuth Token exchange, defaults to https://id.konfigyr.com/oauth/token.
    • getService

      public KonfigyrExtension.ServiceSpec getService()
      This project's service identity, used by the service-release scenario. Always present, populated with its conventions regardless of whether service(Action) is ever called - configuring it is only needed to override those conventions.
    • getPublish

      public KonfigyrExtension.PublishSpec getPublish()
      Direct-publish polling behavior. Always present, populated with its conventions regardless of whether publish(Action) is ever called - configuring it is only needed to override those conventions.