chore: Add protect-endpoints skill (no-changelog)#29385
Open
burivuhster wants to merge 2 commits intomasterfrom
Open
chore: Add protect-endpoints skill (no-changelog)#29385burivuhster wants to merge 2 commits intomasterfrom
burivuhster wants to merge 2 commits intomasterfrom
Conversation
Documents how to apply @ProjectScope/@globalscope decorators to REST endpoints, including scope creation, frontend wiring, and route-metadata regression tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
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=".claude/plugins/n8n/skills/protect-endpoints/SKILL.md">
<violation number="1" location=".claude/plugins/n8n/skills/protect-endpoints/SKILL.md:2">
P1: Remove the `name` field from this SKILL frontmatter; plugin skills must rely on the directory name for identification.
(Based on your team's feedback about omitting `name` in plugin SKILL frontmatter to avoid Claude Code namespacing bugs.) [FEEDBACK_USED]</violation>
</file>
Architecture diagram
sequenceDiagram
participant Client
participant Controller as @RestController
participant Middleware as ScopedMiddleware (controller.registry.ts)
participant AuthEngine as checkAccess (check-access.ts)
participant DB as User/Role Store
Note over Client,DB: Request flow for RBAC-protected endpoints
Client->>Controller: Request (e.g., POST /projects/:projectId/widgets)
Note over Controller,Middleware: Metadata check for @ProjectScope or @GlobalScope
Controller->>Middleware: Intercept Request
alt NEW: Handler has @ProjectScope(':resource::op')
Middleware->>Middleware: Extract :projectId from URL params
Middleware->>AuthEngine: userHasScopes(user, scope, projectId)
else NEW: Handler has @GlobalScope(':resource::op')
Middleware->>AuthEngine: userHasScopes(user, scope)
end
AuthEngine->>DB: Fetch user roles (Global + Project-specific)
DB-->>AuthEngine: Roles & Permissions list
AuthEngine->>AuthEngine: Validate scope intersection
alt Authorized
AuthEngine-->>Middleware: Access Granted
Middleware->>Controller: Execute Handler Method
Controller->>DB: CHANGED: Data access filtered by projectId
DB-->>Controller: Resource Data
Controller-->>Client: 200 OK / 201 Created
else Unauthorized
AuthEngine-->>Middleware: Access Denied
Middleware-->>Client: 403 Forbidden / 401 Unauthorized
end
Note over Client,DB: Background: System Initialization (AuthRolesService.init)
DB->>DB: Sync hardcoded scopes from constants.ee.ts to DB records
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Plugin skills must rely on the directory name for identification to avoid Claude Code namespacing bugs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline Memory consumption baseline with starter plan resources
Idle baseline with Instance AI module loaded
docker-stats
How to read this table
|
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
Adds a new Claude Code skill that guides agents on applying n8n's RBAC scope decorators (`@ProjectScope` / `@GlobalScope`) to REST endpoints.
Related Linear tickets, Github issues, and Community forum posts
N/A — internal tooling.
Review / Merge checklist