Loading
Commits on Source 8
-
Florian Forster authored
Adds `ProjectionProvider`, a new `Provider` implementation that resolves secret paths by reading field values from a protobuf message rather than hardcoding key names. `NewProjectionProvider` wraps an underlying `Provider` with a `proto.Message` whose string fields map logical credential names (e.g. `"username"`, `"password"`) to the actual key names stored in the Secret. `Get` looks up the requested name against the message descriptor by text name, rejects non-string fields with `ErrProjectionInvalid`, and returns `ErrProjectionMissing` when an optional field is absent — distinguishing internal logic errors from user configuration errors so callers can surface the right message. Adds `TestProjection` covering successful lookups against `PostgreSQLProjection` and the missing-field path, and `TestProjection_internalErrors` covering a non-string field (`port`) and a field name that does not exist in the descriptor.
-
Florian Forster authored
-
Florian Forster authored
-
Florian Forster authored
Merges `TestProjectionProvider` and `TestProjectionProvider_internalErrors` into a single table-driven test, covering successful lookups, unset and empty fields (`ErrProjectionMissing`), a non-existent field name, and a non-string field type (both `ErrProjectionInvalid`). Adds `t.Parallel()` at both the top-level and sub-test level.
-
Florian Forster authored
-
Florian Forster authored
-
Florian Forster authored
Renames the `secretProvider` field and constructor parameter to `base`, and the `Get` parameter from `secretName` to `fieldName`. The old name was misleading: the argument is a field in the projection proto, not a secret name. The local holding the resolved value is renamed to `secretName`, which is what it actually is. Documents that `fieldName` is matched against the projection proto's field JSON names (camelCase) since users configure these via YAML, and links the `ErrProjectionMissing` and `ErrProjectionInvalid` sentinels in the doc comment.
-
Luke Hollinda authored
feat(secret): Add proto-driven `ProjectionProvider` provider for secret key mapping. See merge request !553 Merged-by:
Luke Hollinda <lhollinda@gitlab.com> Approved-by:
Luke Hollinda <lhollinda@gitlab.com> Reviewed-by:
Florian Forster <fforster@gitlab.com>
Reviewed-by: GitLab Duo <gitlab-duo@gitlab.com> Co-authored-by:
Florian Forster <fforster@gitlab.com>