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

fix: make fe tokens respect token cache #241

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

sighphyre
Copy link
Member

Makes the check for incoming front end tokens correctly compare against present tokens so that multiple API calls are not made

@@ -311,4 +311,80 @@ mod tests {

assert_eq!(actual, expected);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

These aren't all that relevant but they were missing tests and nice to add while we're in this space

Copy link
Contributor

@chriswk chriswk left a comment

Choose a reason for hiding this comment

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

LGTM

tokens_to_refresh.iter().any(|client_token| {
client_token
.token
.same_environment_and_broader_or_equal_project_access(frontend_token)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the magic, this flips fe token and present tokens - we previously did the check the wrong way around

@sighphyre sighphyre merged commit 2025d51 into main Sep 7, 2023
7 checks passed
@sighphyre sighphyre deleted the fix/make-fe-tokens-respect-token-cache branch September 7, 2023 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants