Skip to content

Commit

Permalink
feat: public s3 config option (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonponti authored Feb 5, 2025
1 parent 8b77af9 commit 18e5a85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ To quickly set up monitoring dashboard, add eigenda-proxy metrics endpoint to a
| `--metrics.enabled` | `false` | `$EIGENDA_PROXY_METRICS_ENABLED` | Enable the metrics server. |
| `--metrics.port` | `7300` | `$EIGENDA_PROXY_METRICS_PORT` | Metrics listening port. |
| `--port` | `3100` | `$EIGENDA_PROXY_PORT` | Server listening port. |
| `--s3.credential-type` | | `$EIGENDA_PROXY_S3_CREDENTIAL_TYPE` | Static or iam. |
| `--s3.credential-type` | | `$EIGENDA_PROXY_S3_CREDENTIAL_TYPE` | Static, iam or public. |
| `--s3.access-key-id` | | `$EIGENDA_PROXY_S3_ACCESS_KEY_ID` | Access key id for S3 storage. |
| `--s3.access-key-id` | | `$EIGENDA_PROXY_S3_ACCESS_KEY_ID` | Access key id for S3 storage. |
| `--s3.access-key-secret` | | `$EIGENDA_PROXY_S3_ACCESS_KEY_SECRET` | Access key secret for S3 storage. |
Expand Down
2 changes: 1 addition & 1 deletion store/precomputed_key/s3/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
},
&cli.StringFlag{
Name: CredentialTypeFlagName,
Usage: "the way to authenticate to S3, options are [iam, static]",
Usage: "the way to authenticate to S3, options are [iam, static, public]",
EnvVars: withEnvPrefix(envPrefix, "CREDENTIAL_TYPE"),
Category: category,
},
Expand Down
6 changes: 6 additions & 0 deletions store/precomputed_key/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
const (
CredentialTypeStatic CredentialType = "static"
CredentialTypeIAM CredentialType = "iam"
CredentialTypePublic CredentialType = "public"
CredentialTypeUnknown CredentialType = "unknown"
)

Expand All @@ -30,6 +31,8 @@ func StringToCredentialType(s string) CredentialType {
return CredentialTypeStatic
case "iam":
return CredentialTypeIAM
case "public":
return CredentialTypePublic
default:
return CredentialTypeUnknown
}
Expand Down Expand Up @@ -138,5 +141,8 @@ func creds(cfg Config) *credentials.Credentials {
if cfg.CredentialType == CredentialTypeIAM {
return credentials.NewIAM("")
}
if cfg.CredentialType == CredentialTypePublic {
return nil
}
return credentials.NewStaticV4(cfg.AccessKeyID, cfg.AccessKeySecret, "")
}

0 comments on commit 18e5a85

Please sign in to comment.