Package codes.grow.packages.vault
package codes.grow.packages.vault
Grow Codes SDK for HashiCorp Vault.
Start with VaultClient.fromEnv().
Shared building blocks live in core (errors, transport, redaction); category APIs in
secrets, logging and tracing; in-memory fakes and the conformance runner
in testing.
-
ClassDescriptionAppRole login:
POST auth/<mount>/login {role_id, secret_id}(default mountapprole).Options ofSys.createAppRole(String, AppRoleOptions).Builder ofAppRoleOptions.Logins, token self-service and token renewal:client.auth().Theauthblock of a login, token creation or renewal.An Vault auth method (TokenAuth,AppRoleAuth,UserpassAuth,JwtAuth,KubernetesAuth) used withAuth.login(AuthMethod).The capabilities a token has on each requested path (sys/capabilities-selforsys/capabilities), for example["create", "read", "update"],["deny"]or["root"].A stored certificate (Pki.readCertificate(String)).A transit ciphertext.Builder ofConnectionConfig.A database connection (without its password).Options ofTransit.createKey(String, CreateKeyOptions).Builder ofCreateKeyOptions.Options ofAuth.createToken(CreateTokenOptions).Builder ofCreateTokenOptions.Database secrets engine on one mount:client.database()(mountdatabase).Dynamic database credentials (GET database/creds/<role>).A data key generated by transit (transit/datakey/<plaintext|wrapped>/<name>).Result of oneTransit.decryptBatch(java.lang.String, java.util.List<codes.grow.packages.vault.DecryptBatchItem>)item (input order).Options ofSys.enableSecretsEngine(java.lang.String, java.lang.String)andSys.enableAuthMethod(java.lang.String, java.lang.String)(optionsandsealWrapapply to secrets engines only).Builder ofEnableOptions.Result of oneTransit.encryptBatch(java.lang.String, java.util.List<codes.grow.packages.vault.EncryptBatchItem>)item (input order).Node health (GET sys/health).A certificate and private key issued by the PKI engine (Pki.issueCertificate(java.lang.String, java.lang.String)).Builder ofIssueOptions.JWT/OIDC login with a JWT:POST auth/<mount>/login {role, jwt}.Settings ofTransit.updateKeyConfig(String, KeyConfig); unset fields stay unchanged.Builder ofKeyConfig.Kubernetes login:POST auth/<mount>/login {role, jwt}with the service account token read fromjwtPath(default "/var/run/secrets/kubernetes.io/serviceaccount/token") at login time.Metadata of a KV v2 secret (GET <mount>/metadata/<path>).Options ofKv.writeMetadata(String, KvMetadataOptions)(KV v2).Builder ofKvMetadataOptions.A KV mount whose version is detected on first use (GET sys/internal/ui/mounts/<mount>) or taken fromVaultConfig.kvVersion(), then delegates toKvV1orKvV2.A KV secret: its data map (any JSON values) and, on KV v2, the version metadata.KV version 1 (unversioned) mount.KV version 2 (versioned) mount.Metadata of one KV v2 version.Leader status (GET sys/leader).Lease<T>A secret with a lease (for example dynamic database credentials).Lease details (PUT sys/leases/lookup).Lease operations and automatic renewal:client.leases().Result ofLeaseManager.renew(String, Duration).What anAuthMethodcan do during a login (no client token is sent).Options ofAuth.login(AuthMethod, LoginOptions).Builder ofLoginOptions.Handle of a lease kept alive byLeaseManager.manage(Lease, RenewalOptions).A secrets engine or auth method mount.PKI engine on one mount:client.pki()(mountpki).An ACL policy.Result ofVaultClient.request(java.lang.String, java.lang.String, java.lang.Object): the decoded Vault envelope.Outcome of one successful renewal (or re-login) reported toRenewalOptions.Builder.onRenew.Options ofTokenRenewerandLeaseManager.manage(codes.grow.packages.vault.Lease<?>, codes.grow.packages.vault.RenewalOptions): renew atrenewFractionof the TTL (default 2/3) until the maximum TTL is reached, then callonExpireonce at expiry (or log in again for a token renewer with a re-login method).Builder ofRenewalOptions.Result ofPki.revokeCertificate(String).Settings ofDatabase.createRole(String, RoleConfig).Builder ofRoleConfig.A database role.Clock and timer used byTokenRenewerandLeaseManager.Wall clock + one shared daemon thread.Seal status (GET sys/seal-status, also returned byunseal).A generated AppRole secret id.Options ofSys.generateSecretId(String, SecretIdOptions).Builder ofSecretIdOptions.Options ofVaultClient.secrets(SecretsOptions).Builder ofSecretsOptions.A transit signature.A certificate signed by the PKI engine (Pki.signCsr(java.lang.String, java.lang.String)).System backend:client.sys()(health, seal status, leader, capabilities, policies, mounts, auth methods, AppRole admin).Options ofPki.tidy(TidyOptions).Builder ofTidyOptions.Progress of a PKI tidy run (GET <mount>/tidy-status).Uses an existing token (X-Vault-Token);loginchecks it with lookup-self.Properties of a token (auth/token/lookup-self).Renews the client token in the background (auth/token/renew-selfat 2/3 of the TTL).Transit engine on one mount:client.transit()(mounttransit).A transit key (GET transit/keys/<name>).Optional parameters of transit operations.Builder ofTransitOptions.The unwrapped response.Username/password login:POST auth/<mount>/login/<username> {password}.Client for Vault.Builder that configures and creates a client in one chain.Immutable configuration of aVaultClient(SPEC section 2.2).Builder of the configuration.SecretsProviderover an Vault KV mount (v1 or v2, auto-detected):client.secrets().A response-wrapping token (wrap_info).Response wrapping:client.wrapping().Properties of a wrapping token (Wrapping.lookupWrapping(codes.grow.packages.vault.core.Secret)); the token stays usable.