feat(objectstore): Add proto-driven `New` constructor and `configFromProto` binding.

Adds New(ctx, ...Option) as the standard entry point for creating an objectstore.Client from the runtime infrastructure config, mirroring the pattern used in the postgres package. It loads infrastructure.DefaultConfig() when no WithInfraConfig option is provided, then delegates to configFromProto before calling the existing NewWithConfig.

configFromProto reads the ObjectStore oneof from the proto config and dispatches to gcsConfigFromProto or s3ConfigFromProto. It wraps the infrastructure secret provider in a PrefixProvider("objectstore/") so that all downstream secret lookups are automatically namespaced. Metadata fields (name, namespace, subsystem) fall back to package-level defaults via cmp.Or.

s3ConfigFromProto resolves accessKeyId, secretAccessKey, and sessionToken through a ProjectionProvider built from the S3SecretProjection in the proto. The helper unsetToEmpty absorbs ErrNotFound and ErrProjectionMissing (treating absent credentials as empty strings to support IRSA/WIF fallback), while propagating any other error. gcsConfigFromProto is a stub pending GCS credentials support.

Adds Option / clientOptions / WithInfraConfig to client.go to allow tests and callers to inject an infrastructure.Config directly.

Covers the new code with TestConfigFromProto (nil/missing config, unknown backend, GCS defaults, S3 full and partial credential resolution) and TestS3ConfigFromProto (all fields, optional fields, ErrNotFound, ErrProjectionMissing, per-field unexpected errors, and multi-error joining).

Issues:

Merge request reports

Loading
Loading