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

Jormun: Feat avoid pg authentication for bad token #3893

Merged
merged 8 commits into from
Jan 17, 2023

Conversation

kadhikari
Copy link
Contributor

@kadhikari kadhikari commented Jan 5, 2023

Some details of modifications:

  • When no token provided (even with some empty spaces), no need to verify can_connect_to_database()
  • Since we cache token - Object User, for a bad token (token not in database) we get a default user with type=no_access and cache it. There will be no access to the database during cache for this token.
  • When database in not accessible, all the requests with a token (bad or good) will have access to all the apis when cache for each token is renewed.

For more details: https://navitia.atlassian.net/browse/NAV-1642

Copy link
Contributor

@pbougue pbougue left a comment

Choose a reason for hiding this comment

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

I don't know how authent works (what's carried by coverage, what's carried by user), so I'm not sharp on that.
I'd say that can_connect_to_database is probably used too much indeed, but I don't know for sure where it's important and performant to keep it.

@kadhikari kadhikari force-pushed the feat_avoid_pg_authentification_for_bad_token branch from 5889c0b to 6f15113 Compare January 16, 2023 15:17
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

6.2% 6.2% Coverage
0.0% 0.0% Duplication

@kadhikari kadhikari merged commit 5abdae1 into dev Jan 17, 2023
@kadhikari kadhikari deleted the feat_avoid_pg_authentification_for_bad_token branch January 17, 2023 11:16
@pbougue pbougue changed the title Feat avoid pg authentification for bad token Jormun: Feat avoid pg authentication for bad token Jan 17, 2023
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.

4 participants