Package com.konfigyr.gradle
Class KonfigyrExtension
java.lang.Object
com.konfigyr.gradle.KonfigyrExtension
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfiguresClientCredentials, used for the OAuth2client_credentialsgrant, as defined by RFC 6749, Section 4.4.static final classPolling behavior for the direct-publish scenario, used while waiting for acom.konfigyr.artifactory.Publicationto be confirmed afterPublishArtifactMetadataTaskuploads this project's own artifact metadata.static final classThis project's service identity, used to resolve its dependencies and open a service release against the Konfigyr Artifactory.static final classConfigures aTokenExchange, used for the OAuth2 Token Exchange grant, as defined by RFC 8693. -
Constructor Summary
ConstructorsConstructorDescriptionKonfigyrExtension(org.gradle.api.Project project, org.gradle.api.model.ObjectFactory factory) Creates a newKonfigyrExtensioninstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclientCredentials(org.gradle.api.Action<KonfigyrExtension.ClientCredentialsSpec> action) ConfiguresClientCredentials, for the OAuth2client_credentialsgrant.org.gradle.api.provider.Property<String> getHost()Host where the Konfigyr server is reachable, defaults tohttps://api.konfigyr.com.Direct-publish polling behavior.This project's service identity, used by the service-release scenario.org.gradle.api.provider.Property<String> The location where this plugin would perform the OAuth Token exchange, defaults tohttps://id.konfigyr.com/oauth/token.voidpublish(org.gradle.api.Action<KonfigyrExtension.PublishSpec> action) Configures thedirect-publish polling behavior.voidservice(org.gradle.api.Action<KonfigyrExtension.ServiceSpec> action) Configures this project'sservice identity, used by the service-release scenario.voidtokenExchange(org.gradle.api.Action<KonfigyrExtension.TokenExchangeSpec> action) Configures aTokenExchange, for the OAuth2 Token Exchange grant.
-
Constructor Details
-
KonfigyrExtension
public KonfigyrExtension(org.gradle.api.Project project, org.gradle.api.model.ObjectFactory factory) Creates a newKonfigyrExtensioninstance.- Parameters:
project- the Gradle projectfactory- the Gradle object factory
-
-
Method Details
-
clientCredentials
public void clientCredentials(org.gradle.api.Action<KonfigyrExtension.ClientCredentialsSpec> action) ConfiguresClientCredentials, for the OAuth2client_credentialsgrant.- Parameters:
action- configures the client credentials, cannot be null.
-
tokenExchange
Configures aTokenExchange, for the OAuth2 Token Exchange grant.- Parameters:
action- configures the token exchange, cannot be null.
-
service
Configures this project'sservice identity, used by the service-release scenario.- Parameters:
action- configures the service identity, cannot be null.
-
publish
Configures thedirect-publish polling behavior.- Parameters:
action- configures the publish behavior, cannot be null.
-
getHost
Host where the Konfigyr server is reachable, defaults tohttps://api.konfigyr.com. -
getTokenUri
The location where this plugin would perform the OAuth Token exchange, defaults tohttps://id.konfigyr.com/oauth/token. -
getService
This project's service identity, used by the service-release scenario. Always present, populated with its conventions regardless of whetherservice(Action)is ever called - configuring it is only needed to override those conventions. -
getPublish
Direct-publish polling behavior. Always present, populated with its conventions regardless of whetherpublish(Action)is ever called - configuring it is only needed to override those conventions.
-