Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 18e5a85

Browse files
authored
feat: public s3 config option (#277)
1 parent 8b77af9 commit 18e5a85

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ To quickly set up monitoring dashboard, add eigenda-proxy metrics endpoint to a
285285
| `--metrics.enabled` | `false` | `$EIGENDA_PROXY_METRICS_ENABLED` | Enable the metrics server. |
286286
| `--metrics.port` | `7300` | `$EIGENDA_PROXY_METRICS_PORT` | Metrics listening port. |
287287
| `--port` | `3100` | `$EIGENDA_PROXY_PORT` | Server listening port. |
288-
| `--s3.credential-type` | | `$EIGENDA_PROXY_S3_CREDENTIAL_TYPE` | Static or iam. |
288+
| `--s3.credential-type` | | `$EIGENDA_PROXY_S3_CREDENTIAL_TYPE` | Static, iam or public. |
289289
| `--s3.access-key-id` | | `$EIGENDA_PROXY_S3_ACCESS_KEY_ID` | Access key id for S3 storage. |
290290
| `--s3.access-key-id` | | `$EIGENDA_PROXY_S3_ACCESS_KEY_ID` | Access key id for S3 storage. |
291291
| `--s3.access-key-secret` | | `$EIGENDA_PROXY_S3_ACCESS_KEY_SECRET` | Access key secret for S3 storage. |

store/precomputed_key/s3/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
4242
},
4343
&cli.StringFlag{
4444
Name: CredentialTypeFlagName,
45-
Usage: "the way to authenticate to S3, options are [iam, static]",
45+
Usage: "the way to authenticate to S3, options are [iam, static, public]",
4646
EnvVars: withEnvPrefix(envPrefix, "CREDENTIAL_TYPE"),
4747
Category: category,
4848
},

store/precomputed_key/s3/s3.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
const (
2222
CredentialTypeStatic CredentialType = "static"
2323
CredentialTypeIAM CredentialType = "iam"
24+
CredentialTypePublic CredentialType = "public"
2425
CredentialTypeUnknown CredentialType = "unknown"
2526
)
2627

@@ -30,6 +31,8 @@ func StringToCredentialType(s string) CredentialType {
3031
return CredentialTypeStatic
3132
case "iam":
3233
return CredentialTypeIAM
34+
case "public":
35+
return CredentialTypePublic
3336
default:
3437
return CredentialTypeUnknown
3538
}
@@ -138,5 +141,8 @@ func creds(cfg Config) *credentials.Credentials {
138141
if cfg.CredentialType == CredentialTypeIAM {
139142
return credentials.NewIAM("")
140143
}
144+
if cfg.CredentialType == CredentialTypePublic {
145+
return nil
146+
}
141147
return credentials.NewStaticV4(cfg.AccessKeyID, cfg.AccessKeySecret, "")
142148
}

0 commit comments

Comments
 (0)