Commits on Source 3

  • Florian Forster's avatar
    feat(redis): Resolve client addresses from the secret projection. · 98fe82d6
    Florian Forster authored
    Adds an `Addrs` method to the Redis `authnFormat` interface so client addresses
    can be delivered through the mounted secret rather than only the infrastructure
    proto. `configFromProto` now calls `pf.Addrs` instead of reading
    `cfg.GetAddrs()` directly. When the proto carries addresses they are used
    as-is; otherwise `authenticatedFormat` reads the secret key named by the
    projection's `addrs` field and parses a comma-separated `<host>:<port>` list,
    trimming whitespace around each entry. `noSecretFormat` continues to return
    only the proto addresses.  This supports provisioned endpoints whose address is
    not known at config time and arrives via the secret alongside the credentials.
    
    Extracts a `config()` helper for the shared nil-infra / nil-Redis checks used
    by both `AuthConfig` and `Addrs`, plus a `resolveSecret` helper that resolves
    an arbitrary projection field through the secret provider.
    
    Bumps `fairway` to v1.30.0 for the `addrs` projection field.
    
    Adds table tests for both formats covering proto passthrough, single and
    comma-separated secret values, whitespace trimming, and the missing provider,
    missing projection field, and key-not-found error paths.
    
    Issue: gitlab-com/gl-infra/platform/runway/team#931
    98fe82d6
  • Florian Forster's avatar
    fix(redis): Skip empty entries when parsing secret addresses. · 36d79388
    Florian Forster authored
    Previously, splitting the secret value on commas kept empty entries, so a value
    with stray, doubled, or trailing commas yielded empty address strings that were
    passed to the Redis client as invalid addresses.  Empty entries are now dropped
    after trimming, and a value that resolves to no addresses returns the new
    `ErrEmptyAddresses` sentinel with the raw value included for debugging.
    
    Adds tests for stripping interleaved empty entries and for the
    all-empty value returning an error.
    
    Issue: gitlab-com/gl-infra/platform/runway/team#931
    36d79388
  • Luke Hollinda's avatar
    Merge branch 'fforster/redis' into 'master' · 6010087c
    Luke Hollinda authored
    feat(redis): Resolve client addresses from the secret projection.
    
    See merge request !551
    
    Merged-by: default avatarLuke Hollinda <lhollinda@gitlab.com>
    Approved-by: default avatarMatthew J. Hoad <mhoad@gitlab.com>
    Approved-by: default avatarLuke Hollinda <lhollinda@gitlab.com>
    Reviewed-by: default avatarGitLab Duo <gitlab-duo@gitlab.com>
    Co-authored-by: Florian Forster's avatarFlorian Forster <fforster@gitlab.com>
    6010087c
Loading
Loading