Package io.root.patcher
Class PkgRepoCredentialResolver
java.lang.Object
io.root.patcher.PkgRepoCredentialResolver
Resolves credentials for the pkg Maven repository.
Priority:
- Explicit
pkgUsername+pkgPassword— use as-is (e.g. JFrog credentials). - Root.io
apiKey— used as the password with the fixed username"token"(the defaultpkg.root.ioconvention). - Neither set — no credentials injected (anonymous or externally managed).
Note: apiKey is separate from pkg repo credentials. It is used exclusively for
authenticating against the Root.io /v3/analyze API. When the API becomes open,
apiKey will no longer be required and pkg repo credentials will be the only thing needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gradle.api.Action<? super org.gradle.api.artifacts.repositories.PasswordCredentials>resolve(RootIoExtension extension, ApiKeyResolver apiKeyResolver, File rootDir) Returns anActionthat applies credentials to a GradlePasswordCredentials, ornullif no credentials should be used (anonymous or file:// repo).
-
Constructor Details
-
PkgRepoCredentialResolver
public PkgRepoCredentialResolver()
-
-
Method Details
-
resolve
@Nullable public static org.gradle.api.Action<? super org.gradle.api.artifacts.repositories.PasswordCredentials> resolve(RootIoExtension extension, ApiKeyResolver apiKeyResolver, File rootDir) Returns anActionthat applies credentials to a GradlePasswordCredentials, ornullif no credentials should be used (anonymous or file:// repo).- Parameters:
extension- the rootio extension;pkgUrlis read to determine if the repo is HTTP(S) — file:// repos never get credentialsapiKeyResolver- used to resolve the apiKey from env/system-property/.env as a fallbackrootDir- root directory passed toapiKeyResolver- Returns:
- an
Actionthat configures credentials, ornullfor anonymous/file repos
-