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

feat(gateway): compare permission checks to permit #1706

Merged
merged 11 commits into from
Apr 3, 2024

Conversation

jonaro00
Copy link
Member

@jonaro00 jonaro00 commented Mar 27, 2024

Description of change

Compare project access to Permit project access.
Use Permit for project list.
Remove project list pagination.

How has this been tested? (if applicable)

Staging

@jonaro00 jonaro00 force-pushed the permit-gateway-sync branch from bbd06de to 5cf5c53 Compare March 28, 2024 09:42
@jonaro00 jonaro00 force-pushed the permit-permission-checks branch from f1fa172 to e3c9bcb Compare March 28, 2024 09:44
Base automatically changed from permit-gateway-sync to main April 2, 2024 12:04
@jonaro00 jonaro00 marked this pull request as ready for review April 2, 2024 12:04
@jonaro00 jonaro00 force-pushed the permit-permission-checks branch from 03ecb3a to 6c66c7b Compare April 2, 2024 12:05
@jonaro00 jonaro00 force-pushed the permit-permission-checks branch from 6c66c7b to ef3f90b Compare April 2, 2024 13:09
Copy link
Contributor

@chesedo chesedo left a comment

Choose a reason for hiding this comment

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

Small nit. If all tests are still passing then I don't see the need for updating any more tests.

@@ -32,18 +32,15 @@ where
{
type Rejection = Error;

async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
let claim = parts.extensions.get::<Claim>().ok_or(ErrorKind::Internal)?;
let user_id = claim.sub.clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to still have a User struct? We can just implement FromRequestParts for the claim right?

Copy link
Member Author

Choose a reason for hiding this comment

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

only traits defined in the current crate can be implemented for a type parameter
Claim can technically be moved to backends (it seems), but I'd skip it for now.

Copy link
Contributor

@chesedo chesedo left a comment

Choose a reason for hiding this comment

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

LGTM

@jonaro00 jonaro00 changed the title feat(gateway): use permit for permission checks feat(gateway): compare permission checks to permit Apr 3, 2024
@jonaro00 jonaro00 merged commit 9130d5b into main Apr 3, 2024
33 of 34 checks passed
@chesedo chesedo deleted the permit-permission-checks branch April 3, 2024 14:38
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