fix: reject --domain-id when --permission is not sending_access#215
Merged
felipefreitag merged 4 commits intomainfrom Apr 10, 2026
Merged
fix: reject --domain-id when --permission is not sending_access#215felipefreitag merged 4 commits intomainfrom
felipefreitag merged 4 commits intomainfrom
Conversation
Domain-scoped API key creation could silently mint full-access keys when --domain-id was provided without --permission sending_access. The Resend API only applies domain_id to sending_access keys, so passing it with full_access (the default) would create a key broader than the operator intended. Add a validation guard that exits with error code invalid_flags when --domain-id is used without --permission sending_access, preventing accidental creation of overly-permissive API keys. Resolves BU-655 Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
Member
Author
|
@cubic-dev-ai can you review? |
Contributor
@bukinoshita I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/api-keys/create.ts">
<violation number="1" location="src/commands/api-keys/create.ts:98">
P2: Use an explicit presence check for `--domain-id` instead of a truthy check. The current condition misses provided empty-string values and can bypass the new `invalid_flags` rejection.
(Based on your team's feedback about checking Commander option presence with `!== undefined`.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
felipefreitag
approved these changes
Apr 10, 2026
…ion tests outputError writes to console.error, not console.log, so the test assertions were checking an empty string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Reject using --domain-id unless --permission is sending_access in the
resend api-keys createcommand. Prevents unintended full-access keys and fulfills Linear BU-655.invalid_flagswhen--domain-idis provided without--permission sending_access; skip SDK call.Written for commit 10d76f1. Summary will update on new commits.