Skip to content

Restrict API ?scope= parameter to operator-configured allowed scopes - #1362

Merged
google-oss-prow[bot] merged 1 commit into
GoogleCloudPlatform:mainfrom
soumyadeeppaulsp:restrict-api-scope-allowlist
Nov 30, 2026
Merged

google-oss-prow[bot] merged 1 commit into
GoogleCloudPlatform:mainfrom
soumyadeeppaulsp:restrict-api-scope-allowlist

Conversation

@soumyadeeppaulsp

Copy link
Copy Markdown
Contributor

Adds AllowedScopes to v1.Server and api.RouterOptions (populated via a repeatable --allowed-scope flag in cmd/api) and enforces an exact-match allowlist in Server.configPath.

Caller-supplied ?scope= values must now match either the operator-configured DefaultBucket (--scope) or an explicit entry in AllowedScopes, preventing requests from reading arbitrary GCS buckets or local filesystem paths.

Testing

  • go test ./cmd/api/... ./pkg/api/...

Add AllowedScopes to v1.Server and api.RouterOptions (populated via the
repeatable --allowed-scope flag in cmd/api) and enforce an exact-match
allowlist in Server.configPath so caller-supplied scope values must match
DefaultBucket or an entry in AllowedScopes.
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saurik-saha, soumyadeeppaulsp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit 38f2d94 into GoogleCloudPlatform:main Nov 30, 2026
9 checks passed
@soumyadeeppaulsp
soumyadeeppaulsp deleted the restrict-api-scope-allowlist branch November 30, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants