Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The authentication path has a critical empty-credential fallback issue, and the public entry point still rejects the advertised optional-root configuration.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds optional root-user matching and IAM fallback across authentication paths.
Changes:
- Adds root configuration and matching helpers.
- Updates standard, presigned, and POST authentication.
- Adds enabled/disabled root-user tests.
File summaries
| File | Summary | Review |
|---|---|---|
s3api/middlewares/root-user_test.go |
Tests enabled and disabled root behavior. | — |
s3api/middlewares/presign-auth.go |
Applies root matching to presigned authentication. | — |
s3api/middlewares/object-post-auth.go |
Applies root matching to POST authentication. | — |
s3api/middlewares/authentication.go |
Defines root configuration and account resolution. | Moderate (2 votes): Public entry-point validation still rejects empty root credentials. Critical (3 votes): Empty credentials can fall through to IAM and resolve as an admin account. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical findings remain in ACL ownership, root credential validation, and empty-owner handling.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
s3api/server.go:78
- This constructor comment repeats the same inaccurate promise: an empty access key is rejected before IAM lookup by
accounts.getAccount, so not every access key resolves through IAM in rootless mode. Limit the statement to non-empty access keys (or explicitly mention empty keys are invalid).
// New constructs the S3 API server. The gateway runs without a root account
// unless WithRootUser is passed: every access key then resolves through iam.
- Files reviewed: 9/9 changed files
- Comments generated: 4
- Review effort level: Lite
| if cfg.RootUserAccess == "" && !cfg.iamBackendConfigured() { | ||
| return fmt.Errorf("root user access and secret key must be provided when no IAM backend is configured") |
|
|
||
| // initilaze the default value setter middleware | ||
| app.Use("*", middlewares.SetDefaultValues(root, region)) | ||
| app.Use("*", middlewares.SetDefaultValues(server.Router.root, region)) |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved empty-key, LDAP lookup, and disabled-root ACL ownership issues must be fixed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
auth/iam.go:216
- This predicate is now used by every backend's
CreateAccountas well as lookup. With the root account disabled, an empty access key therefore passes the duplicate-root check; the adminCreateUserpath validates only the role and can persist an account that all request authentication paths reject before IAM lookup. Reject emptyaccount.Accessduring account creation (or in the admin controller) instead of using the root-match predicate for this validation.
func isRootAccess(root Account, access string) bool {
return root.Access != "" && access == root.Access
auth/iam_ldap.go:137
- When root is disabled,
isRootAccess(ld.rootAcc, account.Access)is false for an empty access key. The admin CreateUser path passes the unmarshaled account here without validating Access, so rootless LDAP IAM can now create an empty-key entry even though authentication rejects empty keys before lookup. Reject emptyaccount.Accessbefore this root check (and use the same validation across the IAM backends) instead of creating an unusable entry.
if isRootAccess(ld.rootAcc, account.Access) {
auth/iam_vault.go:193
- When root is disabled,
isRootAccess(vt.rootAcc, account.Access)is false for an empty access key. The admin CreateUser path passes the unmarshaled account here without validating Access, so rootless Vault IAM can now write an empty-key secret entry even though authentication rejects empty keys before lookup. Reject emptyaccount.Accessbefore this root check (and use the same validation across the IAM backends) instead of creating an unusable entry.
if isRootAccess(vt.rootAcc, account.Access) {
- Files reviewed: 20/20 changed files
- Comments generated: 4
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical API and root-credential issues, plus a moderate Helm deployment issue, block approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
embedgw/embedgw.go:58
- Rootless startup is still blocked for Helm deployments:
chart/templates/secret.yamlrequires both credential values andchart/templates/deployment.yamlalways injects those secret keys. With IAM enabled but no root credentials, the chart fails beforevalidateRootUsercan accept the IAM-backed configuration, so the chart templates/values need to be updated with this feature.
// authentication. Leave both RootUserAccess and RootUserSecret empty to
// run without a root account, so every access key resolves through the
// configured IAM backend; that requires one of the IAM backends below,
// since single-account mode has no other account to authenticate.
- Files reviewed: 21/21 changed files
- Comments generated: 3
- Review effort level: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
A critical Helm credential-wiring issue for rootless IAM deployments remains unresolved.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Helm backend detection and rootless IAM bootstrap documentation need correction before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
chart/templates/deployment.yaml:9
- This check treats
iam.enabledas proof that an IAM backend is configured, but the gateway validates the actual trigger fields. For example,iam.enabled=truewith a non-internaltype and noextraEnvtrigger still starts with no backend and is rejected byvalidateRootUser; conversely, a valid LDAP/Vault/etc. backend supplied through the documentedextraEnvis rejected wheniam.enabled=false. Validate the rendered backend configuration (or explicitly restrict and validate supported types) rather than this boolean alone.
{{- if and (not (include "versitygw.rootCredentialsEnabled" .)) (not .Values.iam.enabled) }}
{{- fail "root credentials (auth.accessKey and auth.secretKey, or auth.existingSecret) are required unless iam.enabled=true" }}
- Files reviewed: 30/30 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Removes root account access (which was totally broken anyway). i.e. IAM auth was skipped, but every Forge-facing handler would fail on a root request. Depends on: * fil-forge/versitygw#12
Makes the root user optional - this is not supported in Ingot since it has no ability to locally authorize a user.