fix(permissions): 🧭 detect missing storage buckets in queryPermissions#484
fix(permissions): 🧭 detect missing storage buckets in queryPermissions#484
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fe5ae0e2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| const envInfo = await envService.getEnvInfo(); | ||
| const knownBuckets = extractStorageBuckets(envInfo); | ||
| if (knownBuckets.length > 0 && !knownBuckets.includes(params.resourceId)) { |
There was a problem hiding this comment.
Treat empty bucket lists as missing resources
This condition bypasses validation whenever getEnvInfo() returns no Storages/StaticStorages, so in fresh or storage-disabled environments queryPermissions(action="getResourcePermission", resourceType="storage") still falls through to describeResourcePermission and can report a fake bucket as readable. That leaves the original false-success behavior in place for a real runtime scenario; after a successful getEnvInfo() call, an empty inventory should be handled as “bucket not found” (or at least as an explicit validation failure) rather than skipped.
Useful? React with 👍 / 👎.
Summary
Attribution
Verification