@@ -45,13 +45,15 @@ type Options struct {
4545 AccessKey string `yaml:"access_key"`
4646 SecretKey string `yaml:"secret_key"`
4747
48- // Path to the field containing the access key,
48+ // Path to the file containing the access key
49+ // as an alternative to AccessKey and SecretKey,
4950 // e.g. /etc/s3-secrets/access-key.
50- AccessKeyFilename string `json:"access_key_filename "`
51+ AccessKeyFile string `yaml:"access_key_file "`
5152
52- // Path to the field containing the secret key,
53+ // Path to the field containing the secret key
54+ // as an alternative to AccessKey and SecretKey,
5355 // e.g. /etc/s3-secrets/secret-key.
54- SecretKeyFilename string `json:"secret_key_filename "`
56+ SecretKeyFile string `yaml:"secret_key_file "`
5557
5658 // Region defaults to "us-east-1", which also works for Minio
5759 Region string `yaml:"region"`
@@ -101,7 +103,7 @@ type Options struct {
101103}
102104
103105func (o Options ) Check () error {
104- hasSecretsCreds := o .AccessKeyFilename != "" && o .SecretKeyFilename != ""
106+ hasSecretsCreds := o .AccessKeyFile != "" && o .SecretKeyFile != ""
105107 hasStaticCreds := o .AccessKey != "" && o .SecretKey != ""
106108 if ! hasSecretsCreds && ! hasStaticCreds {
107109 return fmt .Errorf ("s3 storage.options: credentials are required, fill either (access_key and secret_key) or (access_key_filename and secret_key_filename)" )
@@ -350,10 +352,10 @@ func New(ctx context.Context, opt Options) (*Backend, error) {
350352 }
351353
352354 creds := credentials .NewStaticV4 (opt .AccessKey , opt .SecretKey , "" )
353- if opt .AccessKeyFilename != "" {
355+ if opt .AccessKeyFile != "" {
354356 creds = credentials .New (& FileSecretsCredentials {
355- AccessKeyFilename : opt .AccessKeyFilename ,
356- SecretKeyFilename : opt .SecretKeyFilename ,
357+ AccessKeyFile : opt .AccessKeyFile ,
358+ SecretKeyFile : opt .SecretKeyFile ,
357359 })
358360 }
359361
0 commit comments