Skip to content

feat: add listPermissions and listRoles#3483

Merged
chronark merged 1 commit intomainfrom
07-08-feat_add_listpermissions_and_listroles
Jul 8, 2025
Merged

feat: add listPermissions and listRoles#3483
chronark merged 1 commit intomainfrom
07-08-feat_add_listpermissions_and_listroles

Conversation

@chronark
Copy link
Collaborator

@chronark chronark commented Jul 8, 2025

What does this PR do?

Fixes # (issue)

If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

Summary by CodeRabbit

  • New Features
    • Added the ability to list permissions and roles through new methods in the permissions API client.

@vercel
Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 5:31pm
engineering 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 5:31pm

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2025

🦋 Changeset detected

Latest commit: c8f1bed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@unkey/api Minor
@unkey/hono Patch
@unkey/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 8, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This change adds two new asynchronous methods, listPermissions and listRoles, to the permissions API client in the Unkey class. Both methods perform GET requests to retrieve lists of permissions and roles, respectively. A new changeset documents this minor version update for the @unkey/api package.

Changes

File(s) Change Summary
packages/api/src/client.ts Added listPermissions and listRoles methods to the permissions getter in the Unkey class.
.changeset/wide-bugs-fail.md Added a changeset documenting the minor version update and the introduction of the two new methods.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Unkey.permissions
    participant API

    Client->>Unkey.permissions: listPermissions()
    Unkey.permissions->>API: GET /v1/permissions.listPermissions
    API-->>Unkey.permissions: JSON response
    Unkey.permissions-->>Client: Result<PermissionsList>

    Client->>Unkey.permissions: listRoles()
    Unkey.permissions->>API: GET /v1/permissions.listRoles
    API-->>Unkey.permissions: JSON response
    Unkey.permissions-->>Client: Result<RolesList>
Loading

Possibly related PRs

Suggested reviewers

  • mcstepp
  • MichaelUnkey
  • perkinsjr
  • ogzhanolguncu

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0357d45 and c8f1bed.

📒 Files selected for processing (2)
  • .changeset/wide-bugs-fail.md (1 hunks)
  • packages/api/src/client.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@chronark chronark marked this pull request as ready for review July 8, 2025 17:30
Copy link
Collaborator Author

chronark commented Jul 8, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chronark chronark merged commit a4636e6 into main Jul 8, 2025
29 of 31 checks passed
@chronark chronark deleted the 07-08-feat_add_listpermissions_and_listroles branch July 8, 2025 17:30
@vercel vercel bot temporarily deployed to Preview – engineering July 8, 2025 17:31 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard July 8, 2025 17:31 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2025

Thank you for following the naming conventions for pull request titles! 🙏

chronark added a commit that referenced this pull request Jul 9, 2025
* refactor: use docker-compose with testcontainerrefactos

* feat: get rid of testcontainers and just rawdog docker-compose

* feat: onboarding key creation (#3459)

* feat: add new expandable configs

* feat: add form submit with conditionals

* feat: add description for each section and disable form

---------

Co-authored-by: James P <james@unkey.dev>

* refactor: add minimized load more (#3399)

* refactor: add minimized load more

* chore: fmt

* refactor: get rid of useEffect animation

* chore: fmt

* chore: llm search moved to ui (#3409)

* llm search moved with docs and replaced in dashboard

* eng docs change

* [autofix.ci] apply automated fixes

* minor refactor from c-rabbit

* rabbit

* [autofix.ci] apply automated fixes

* rabbit

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: James P <james@unkey.dev>

* fix: calendar bug (#3478)

* fix: first time selection

* fix: resetting to initial date of the month

* fix: date validation issue

* fix: day selection by bypassing react-day-picker

* feat: return permission slugs (#3481)

* chore(release): version packages (#3482)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: add listPermissions and listRoles (#3483)

* chore(release): version packages (#3484)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Initial implementation of Unkey Deploy (#3488)

* feat: Initial implementation of Unkey Deploy

- Introduce four core services: assetmanagerd, billaged, builderd, metald
- Implement VM lifecycle management with Firecracker/Cloud Hypervisor support
- Add SPIFFE/SPIRE integration for mTLS inter-service communication
- Include systemd service files and CLI tools for each service
- Set up observability with OpenTelemetry and Grafana LGTM stack
- Implement tenant isolation, resource management, and usage billing

Signed-off-by: Ian Meyer <k@imeyer.io>

* [autofix.ci] apply automated fixes

---------

Signed-off-by: Ian Meyer <k@imeyer.io>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: cast JSON for interpolate params (#3492)

* refactor: use docker-compose with testcontainerrefactos

* feat: get rid of testcontainers and just rawdog docker-compose

---------

Signed-off-by: Ian Meyer <k@imeyer.io>
Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com>
Co-authored-by: James P <james@unkey.dev>
Co-authored-by: CodeReaper <148160799+MichaelUnkey@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ian Meyer <imeyer@users.noreply.github.com>
Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com>
chronark added a commit that referenced this pull request Jul 9, 2025
* feat: get rid of testcontainers and just rawdog docker-compose

* feat: onboarding key creation (#3459)

* feat: add new expandable configs

* feat: add form submit with conditionals

* feat: add description for each section and disable form

---------

Co-authored-by: James P <james@unkey.dev>

* refactor: add minimized load more (#3399)

* refactor: add minimized load more

* chore: fmt

* refactor: get rid of useEffect animation

* chore: fmt

* chore: llm search moved to ui (#3409)

* llm search moved with docs and replaced in dashboard

* eng docs change

* [autofix.ci] apply automated fixes

* minor refactor from c-rabbit

* rabbit

* [autofix.ci] apply automated fixes

* rabbit

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: James P <james@unkey.dev>

* fix: calendar bug (#3478)

* fix: first time selection

* fix: resetting to initial date of the month

* fix: date validation issue

* fix: day selection by bypassing react-day-picker

* feat: return permission slugs (#3481)

* chore(release): version packages (#3482)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: add listPermissions and listRoles (#3483)

* chore(release): version packages (#3484)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Initial implementation of Unkey Deploy (#3488)

* feat: Initial implementation of Unkey Deploy

- Introduce four core services: assetmanagerd, billaged, builderd, metald
- Implement VM lifecycle management with Firecracker/Cloud Hypervisor support
- Add SPIFFE/SPIRE integration for mTLS inter-service communication
- Include systemd service files and CLI tools for each service
- Set up observability with OpenTelemetry and Grafana LGTM stack
- Implement tenant isolation, resource management, and usage billing

Signed-off-by: Ian Meyer <k@imeyer.io>

* [autofix.ci] apply automated fixes

---------

Signed-off-by: Ian Meyer <k@imeyer.io>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: cast JSON for interpolate params (#3492)

* refactor: use docker-compose with testcontainers (#3476)

* refactor: use docker-compose with testcontainerrefactos

* feat: get rid of testcontainers and just rawdog docker-compose

* feat: onboarding key creation (#3459)

* feat: add new expandable configs

* feat: add form submit with conditionals

* feat: add description for each section and disable form

---------

Co-authored-by: James P <james@unkey.dev>

* refactor: add minimized load more (#3399)

* refactor: add minimized load more

* chore: fmt

* refactor: get rid of useEffect animation

* chore: fmt

* chore: llm search moved to ui (#3409)

* llm search moved with docs and replaced in dashboard

* eng docs change

* [autofix.ci] apply automated fixes

* minor refactor from c-rabbit

* rabbit

* [autofix.ci] apply automated fixes

* rabbit

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: James P <james@unkey.dev>

* fix: calendar bug (#3478)

* fix: first time selection

* fix: resetting to initial date of the month

* fix: date validation issue

* fix: day selection by bypassing react-day-picker

* feat: return permission slugs (#3481)

* chore(release): version packages (#3482)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: add listPermissions and listRoles (#3483)

* chore(release): version packages (#3484)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Initial implementation of Unkey Deploy (#3488)

* feat: Initial implementation of Unkey Deploy

- Introduce four core services: assetmanagerd, billaged, builderd, metald
- Implement VM lifecycle management with Firecracker/Cloud Hypervisor support
- Add SPIFFE/SPIRE integration for mTLS inter-service communication
- Include systemd service files and CLI tools for each service
- Set up observability with OpenTelemetry and Grafana LGTM stack
- Implement tenant isolation, resource management, and usage billing

Signed-off-by: Ian Meyer <k@imeyer.io>

* [autofix.ci] apply automated fixes

---------

Signed-off-by: Ian Meyer <k@imeyer.io>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: cast JSON for interpolate params (#3492)

* refactor: use docker-compose with testcontainerrefactos

* feat: get rid of testcontainers and just rawdog docker-compose

---------

Signed-off-by: Ian Meyer <k@imeyer.io>
Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com>
Co-authored-by: James P <james@unkey.dev>
Co-authored-by: CodeReaper <148160799+MichaelUnkey@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ian Meyer <imeyer@users.noreply.github.com>
Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com>

* fix: clean up

---------

Signed-off-by: Ian Meyer <k@imeyer.io>
Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com>
Co-authored-by: James P <james@unkey.dev>
Co-authored-by: CodeReaper <148160799+MichaelUnkey@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ian Meyer <imeyer@users.noreply.github.com>
Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com>
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.

1 participant