Skip to content

feat: add rules.read and rules.write to API key scopes#2972

Open
singhvishalkr wants to merge 2 commits into
appwrite:mainfrom
singhvishalkr:fix/add-rules-scopes
Open

feat: add rules.read and rules.write to API key scopes#2972
singhvishalkr wants to merge 2 commits into
appwrite:mainfrom
singhvishalkr:fix/add-rules-scopes

Conversation

@singhvishalkr
Copy link
Copy Markdown

What does this PR do?

Adds the missing rules.read and rules.write scope definitions to the API key scopes list in src/lib/constants.ts.

These scopes are already included in defaultScopes but were missing from the selectable scope definitions, making them invisible in the API key creation/editing UI.

Closes #2156

Changes

  • Added rules.read and rules.write entries to the scopes array with appropriate descriptions, matching the style of existing scope definitions.

How to test

  1. Navigate to API Keys section in the Console
  2. Create or edit an API key
  3. Verify that rules.read and rules.write now appear in the scopes list

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 11, 2026

Greptile Summary

This PR adds rules.read and rules.write entries to the scopes array in src/lib/constants.ts, making them selectable in the API key creation/editing UI. They were already included in defaultScopes but lacked display definitions, so they were invisible to users.

  • Both entries follow the established pattern for scope definitions: accurate descriptions, category: 'Other', and icon: 'globe' — consistent with other non-domain-specific scopes like locale.read, migrations.read, etc.
  • The new entries are inserted between the functions.write and executions.read definitions; while both of those belong to the Functions category, the placement does not affect functionality — only the category field drives UI grouping.

Confidence Score: 5/5

Safe to merge — the change is purely additive, exposes previously hidden but already-supported scopes, and does not alter any existing logic.

Only two constant entries are added, both matching existing patterns exactly. The scopes were already accepted by the backend (present in defaultScopes); this change simply makes them visible in the UI.

No files require special attention.

Important Files Changed

Filename Overview
src/lib/constants.ts Adds rules.read and rules.write scope definitions to the scopes array; the entries correctly mirror the existing pattern (category: 'Other', icon: 'globe') and match the scopes already present in defaultScopes

Reviews (2): Last reviewed commit: "Merge appwrite/console main into fix/add..." | Re-trigger Greptile

@singhvishalkr
Copy link
Copy Markdown
Author

Gentle nudge — this one's been sitting green for ~11 days with only bot review. It's a small, targeted addition of the two missing rules.read / rules.write scopes on the API-key creation form so users can grant access to the Rules API without having to hand-edit tokens. Happy to rebase or split if the change should be scoped differently.

Resolve scopes table conflict: keep rules.read/rules.write alongside upstream executions.read rename.
@singhvishalkr
Copy link
Copy Markdown
Author

Merged current \�ppwrite/console\ \main\ (**\

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.

🐛 Bug Report: Missing Scopes in API keys

1 participant