Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public s3 config option #277

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,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, "")
}
Loading