Skip to content

feat: add connection diagram action and permissions to Cedar authorization#1754

Merged
Artuomka merged 2 commits intomainfrom
backend_ceadr_diagram_permission
May 5, 2026
Merged

feat: add connection diagram action and permissions to Cedar authorization#1754
Artuomka merged 2 commits intomainfrom
backend_ceadr_diagram_permission

Conversation

@Artuomka
Copy link
Copy Markdown
Collaborator

@Artuomka Artuomka commented May 5, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 5, 2026 10:37
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@Artuomka has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 9 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef7c10c1-3530-467d-b06d-012ff57bd300

📥 Commits

Reviewing files that changed from the base of the PR and between f850e56 and 0336542.

📒 Files selected for processing (9)
  • backend/src/entities/cedar-authorization/cedar-action-map.ts
  • backend/src/entities/cedar-authorization/cedar-policy-generator.ts
  • backend/src/entities/cedar-authorization/cedar-policy-parser.ts
  • backend/src/entities/cedar-authorization/cedar-schema.json
  • backend/src/entities/cedar-authorization/cedar-schema.ts
  • backend/src/entities/connection/connection.controller.ts
  • backend/src/guards/connection-diagram.guard.ts
  • backend/test/ava-tests/non-saas-tests/non-saas-cedar-policy-generator.test.ts
  • backend/test/ava-tests/saas-tests/saas-cedar-connection-diagram-permission-e2e.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend_ceadr_diagram_permission

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated Cedar authorization action for fetching a connection ER diagram, and wires the /connection/diagram/:connectionId endpoint to use that action instead of reusing connection:edit.

Changes:

  • Added new Cedar action connection:diagram to the Cedar action map and schema (TS + JSON).
  • Added ConnectionDiagramGuard and updated the connection diagram endpoint to authorize via connection:diagram.
  • Updated Cedar policy generation and tests so connection:edit policies also include connection:diagram, and added SaaS E2E coverage for the new permission behavior.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
backend/test/ava-tests/saas-tests/saas-cedar-connection-diagram-permission-e2e.test.ts New SaaS E2E tests validating allow/deny behavior for connection:diagram including raw Cedar policy scenarios.
backend/test/ava-tests/non-saas-tests/non-saas-cedar-policy-generator.test.ts Updates generator expectations to include connection:diagram when connection access is edit.
backend/src/guards/connection-diagram.guard.ts New NestJS guard that authorizes diagram access via CedarAction.ConnectionDiagram.
backend/src/entities/connection/connection.controller.ts Switches the diagram endpoint guard from ConnectionEditGuard to ConnectionDiagramGuard.
backend/src/entities/cedar-authorization/cedar-schema.ts Adds connection:diagram to the Cedar schema (TS).
backend/src/entities/cedar-authorization/cedar-schema.json Adds connection:diagram to the Cedar schema (JSON).
backend/src/entities/cedar-authorization/cedar-policy-parser.ts Updates classical-permission parsing to recognize connection:diagram.
backend/src/entities/cedar-authorization/cedar-policy-generator.ts Ensures generated policies for connection:edit also permit connection:diagram.
backend/src/entities/cedar-authorization/cedar-action-map.ts Adds ConnectionDiagram to the CedarAction enum.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 736 to 740
status: 200,
type: ConnectionDiagramResponseDTO,
})
@UseGuards(ConnectionEditGuard)
@UseGuards(ConnectionDiagramGuard)
@Get('/connection/diagram/:connectionId')
Comment on lines +54 to +56
if (result.connection.accessLevel === AccessLevelEnum.none) {
result.connection.accessLevel = AccessLevelEnum.readonly;
}
@Artuomka Artuomka merged commit 59902aa into main May 5, 2026
18 of 19 checks passed
@Artuomka Artuomka deleted the backend_ceadr_diagram_permission branch May 5, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants