Skip to content

feat: delete sharedkey if invalid and attempt other auth method#253

Merged
atadj merged 5 commits intomainfrom
feat/attempt-other-auth-flow-if-sharedkey-is-invalid
Mar 4, 2026
Merged

feat: delete sharedkey if invalid and attempt other auth method#253
atadj merged 5 commits intomainfrom
feat/attempt-other-auth-flow-if-sharedkey-is-invalid

Conversation

@atadj
Copy link
Contributor

@atadj atadj commented Feb 11, 2026

This is related to the issue #251
This is a suggested solution for deleting the shared key if not valid, and then try to authenticate again.

@atadj atadj requested a review from a team February 11, 2026 14:04
@equinor-ruaj equinor-ruaj marked this pull request as draft February 12, 2026 07:40
@equinor-ruaj
Copy link
Contributor

Could it be an idea that:
If the SumoClient gets an exception that sharedkey is invalid -> Catch the exception -> Delete the sharedkey -> Raise the exception

I.e. we don´t do any validation up front and we don´t do any special retries and what not. But if we detect that a sharedkey is invalid we delete it before exiting.

In theory it will then "just work" if the user tries again.
Which might also be a bad thing since we can´t track what the issue was then...
@rwiker

@rwiker
Copy link
Contributor

rwiker commented Feb 20, 2026

That's a good idea, I think... the code becomes a bit simpler, and we still manage to get rid of the invalid token. We should probably print out something to let the user know that a retry might help.

@equinor-ruaj
Copy link
Contributor

Do you want to give that a go @atadj ?

  • If a request gets 401 AND a sharedkeys is being used -> Delete the sharedkey + log something like "Stale Sumo session detected, run again to reset automatically." -> Raise the 401 exception

@atadj
Copy link
Contributor Author

atadj commented Feb 23, 2026

Do you want to give that a go @atadj ?

  • If a request gets 401 AND a sharedkeys is being used -> Delete the sharedkey + log something like "Stale Sumo session detected, run again to reset automatically." -> Raise the 401 exception

I think yes, I can work on it!

@atadj atadj marked this pull request as ready for review February 24, 2026 07:19
@atadj atadj requested review from a team and removed request for a team February 24, 2026 07:20
@atadj
Copy link
Contributor Author

atadj commented Feb 24, 2026

I just realised that my commit messages don't respect the semantic commit messages structure 😐, will be better for next commits hopefully

@rwiker
Copy link
Contributor

rwiker commented Feb 24, 2026

Not a problem with the commit messages... you'll get a chance to edit the messages if you do a "squash and merge".

@atadj atadj requested review from equinor-ruaj and rwiker February 26, 2026 14:26
Copy link
Contributor

@equinor-ruaj equinor-ruaj left a comment

Choose a reason for hiding this comment

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

👍

@equinor-ruaj
Copy link
Contributor

I think this looks good now @rwiker ?

Copy link
Contributor

@rwiker rwiker left a comment

Choose a reason for hiding this comment

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

@atadj atadj merged commit 2790997 into main Mar 4, 2026
11 checks passed
@atadj atadj deleted the feat/attempt-other-auth-flow-if-sharedkey-is-invalid branch March 4, 2026 08:35
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