Documentation
¶
Overview ¶
Package gcp resolves secret.KindGCP refs by fetching from GCP Secret Manager. Service-account auth uses only the Go standard library (no Google SDK). Fetch-only: plaintext is held in memory, never written to Postgres.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ProjectID string
ServiceAccountJSON []byte
UseMetadataServer bool
HTTPClient *http.Client
TokenEndpoint string
SecretManagerEndpoint string
MetadataEndpoint string
Now func() time.Time
}
Config holds GCP project and credentials for Secret Manager fetch-only resolution. ServiceAccountJSON and UseMetadataServer are mutually exclusive auth paths; when both are unset resolution errors at token fetch time.
func ConfigFromEnv ¶
ConfigFromEnv reads GCP_PROJECT or GOOGLE_CLOUD_PROJECT, optional GCP_USE_METADATA_SERVER=1, and credentials from GCP_SA_JSON or GOOGLE_APPLICATION_CREDENTIALS. Returns an error when required config is missing.