feat(jetstream): enable read-only personal access tokens#793
Open
vcnainala wants to merge 2 commits into
Open
Conversation
Turn on Jetstream API features and restrict Sanctum PAT abilities to read. REST authorization remains on Spatie permissions via Lomkit policies.
Describe how verified users create PATs, read-only Sanctum abilities, and Spatie-based authorization for mutations and deletes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #793 +/- ##
================================================
- Coverage 6.14% 6.08% -0.07%
- Complexity 1736 1737 +1
================================================
Files 227 227
Lines 8945 8956 +11
================================================
- Hits 550 545 -5
- Misses 8395 8411 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Features::api()so verified users can manage personal access tokens at/user/api-tokens(account menu → Personal Access Tokens).read.delete_molecule, etc.), not Sanctum ability middleware.Test plan
phpunit --filter=ApiToken(3 tests)Authorization: Bearer <token>onGET /api/moleculesDELETE /api/moleculesreturns 403 for users without Spatie delete permissionsResolves
Closes #744