Repository navigation
Check API token owners and scope login tokens - #135
Merged
Merged
Conversation
The password login and registration issued a full-access token to every user. They now issue * to Escalated admins, agent to other staff and customer to everyone else; a customer token reaches only the auth routes about its own account. Every agent and admin route now checks that the token's owner is still staff, whatever the visibility setting. auth/refresh keeps the token's name, abilities and expiry, and a request counts once against the rate limit.
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.
Tightens who an API token lets in.
auth/loginandauth/registerissue a token that matches the user's Escalated role:*for Escalated admins,agentfor other staff,customerfor everyone else. Acustomertoken reaches onlyauth/me,auth/profile,auth/refreshandauth/logout.User no longer has agent access., as escalated-laravel).auth/refreshkeeps the token's name, abilities and expiry.Tests:
tests/Test_Api_Token_Owner.php(fails on main, passes here);Test_Ticket_Visibilitynow expects 403 instead of 401 for a token whose owner is not staff. CHANGELOG and docs/access-control.md updated.