Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AuthorisedAction #13

Merged
merged 5 commits into from
Feb 9, 2024
Merged

Add AuthorisedAction #13

merged 5 commits into from
Feb 9, 2024

Conversation

kelvin-chappell
Copy link
Member

@kelvin-chappell kelvin-chappell commented Feb 6, 2024

This adds some middleware to validate particular endpoints, checking that the request has a valid access token with the required scopes for the endpoint.

I've created a stub for the Get /user/me endpoint to test the action. It works in Code.

@kelvin-chappell kelvin-chappell marked this pull request as ready for review February 7, 2024 08:48
@kelvin-chappell kelvin-chappell requested a review from a team as a code owner February 7, 2024 08:48
val result = action(Ok)(request)
status(result) shouldBe OK
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

are we missing the case where the token is present but invalid ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 3c943e1

pvighi
pvighi previously approved these changes Feb 8, 2024
Copy link
Contributor

@pvighi pvighi left a comment

Choose a reason for hiding this comment

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

left a comment but overall looks good to me

@kelvin-chappell kelvin-chappell merged commit 21ff679 into main Feb 9, 2024
1 check passed
@kelvin-chappell kelvin-chappell deleted the kc/auth branch February 9, 2024 11:56
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