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

#3260 - CAS Integration 3A - Create new Supplier and Site - Refactor CAS authentication #3822

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Oct 23, 2024

As agreed in the previous PR, the CAS authentication is now encapsulated inside the CAS API service and the auth token no longer needs to be passed to every method.
The current CAS token expiration is set to 1 hour and the token will be considered "about to expire" one minute before it.

@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review October 23, 2024 20:47
@dheepak-aot dheepak-aot self-requested a review October 23, 2024 21:17
/**
* Cache the CAS token to be reused.
*/
export class CachedCASAuthDetails {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this class should be in a model file. I'd rather have it in cas.service.ts or have a new file for CachedCASAuthDetails.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Move to a different file.

* Default amount of time to a token be expired and be
* considered candidate to be renewed.
*/
const CAS_TOKEN_RENEWAL_SECONDS = 60;
Copy link
Collaborator

Choose a reason for hiding this comment

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

in system configuration constants ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not see a value in moving this. It is a private const only used to create some difference for the actual expiration time.

@dheepak-aot
Copy link
Collaborator

Thanks for making this refactor to simplify the CAS logon call. Please have a look at the comments.

Copy link

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.54% ( 3657 / 16223 )
Methods: 10.11% ( 204 / 2017 )
Lines: 25.95% ( 3179 / 12252 )
Branches: 14.02% ( 274 / 1954 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 58.64% ( 509 / 868 )
Methods: 52.88% ( 55 / 104 )
Lines: 62.27% ( 411 / 660 )
Branches: 41.35% ( 43 / 104 )

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes. Looks Good. 👍

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

Looks good! Great job!

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 83.18% ( 1157 / 1391 )
Methods: 83.94% ( 115 / 137 )
Lines: 84.22% ( 987 / 1172 )
Branches: 67.07% ( 55 / 82 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.01% ( 5571 / 8439 )
Methods: 63.3% ( 683 / 1079 )
Lines: 70.12% ( 4401 / 6276 )
Branches: 44.93% ( 487 / 1084 )

@andrewsignori-aot andrewsignori-aot added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit e828982 Oct 23, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants