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

Delete teslaAuth tokens from cache after persisting to kafka and db #272

Merged
merged 17 commits into from
Mar 1, 2024

Conversation

0xdev22
Copy link
Contributor

@0xdev22 0xdev22 commented Feb 29, 2024

Proposed Changes

Impacted Routes

Caveats

Copy link

linear bot commented Feb 29, 2024

@0xdev22 0xdev22 requested a review from a team February 29, 2024 17:47
if apiVersion == constants.TeslaAPIV2 { // If version is 2, we are using fleet api which has token stored in cache
deviceIntReq, err := udc.getTeslaAuthFromCache(c.Context(), ud.UserID)
user, err := udc.usersClient.GetUser(c.Context(), &pb.GetUserRequest{Id: ud.UserID})
Copy link
Member

Choose a reason for hiding this comment

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

Okay, we're moving this up in order to provide nicer messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, Its because I need the cache key for deletion and its formed using the user eth address. But that is also a good point, I will use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

2 🐦 1 🪨

@elffjs elffjs requested a review from KevinJoiner February 29, 2024 19:15
Base automatically changed from feature/si-2449-promote-stored-access-token-credentials to main February 29, 2024 20:47
if apiVersion == constants.TeslaAPIV2 { // If version is 2, we are using fleet api which has token stored in cache
deviceIntReq, err := udc.getTeslaAuthFromCache(c.Context(), ud.UserID)
user, err := udc.usersClient.GetUser(c.Context(), &pb.GetUserRequest{Id: ud.UserID})
Copy link
Contributor

Choose a reason for hiding this comment

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

2 🐦 1 🪨

@0xdev22 0xdev22 merged commit 2a4d219 into main Mar 1, 2024
1 of 2 checks passed
@0xdev22 0xdev22 deleted the feature/si-2450-clear-access-tokens-from-redis branch March 1, 2024 19:03
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.

3 participants