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

[TC-0059] Auth Guard #16

Merged
merged 4 commits into from
Dec 20, 2023
Merged

[TC-0059] Auth Guard #16

merged 4 commits into from
Dec 20, 2023

Conversation

chelsea-EYDS
Copy link
Collaborator

  • Checking auth token on all routes that are not annotated with the public decorator
  • Validating auth token
  • Checking Reflector to see if route is annotated with a Roles decorator
  • Validating user assigned role if the current route requires a role

@chelsea-EYDS chelsea-EYDS changed the title [TC-0059] backend auth token [TC-0059] Auth Guard Dec 19, 2023
@chelsea-EYDS chelsea-EYDS force-pushed the TC-66 branch 2 times, most recently from 90b8e82 to d363026 Compare December 19, 2023 16:49
Base automatically changed from TC-66 to main December 19, 2023 17:03
throw new UnauthorizedException();
}

//YODO check expiry
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be pretty trivial, no?

throw new UnauthorizedException();
}

if (payload.aud !== 'account') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like the wrong thing to check? I think authorized party is the thing to check azp

import { SetMetadata } from '@nestjs/common';
import { Metadata } from './metadata';

export const Public = () => SetMetadata(Metadata.IS_PUBLIC, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we change to PUBLIC_ENDPOINT just for clarity

@chelsea-EYDS chelsea-EYDS merged commit 1b65c4d into main Dec 20, 2023
3 checks passed
@chelsea-EYDS chelsea-EYDS deleted the TC-59 branch January 5, 2024 17:12
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