Repository navigation
Log in again when the device rejects the session - #63
Open
antoniovazquezblanco wants to merge 1 commit into
Open
antoniovazquezblanco wants to merge 1 commit into
antoniovazquezblanco wants to merge 1 commit into
Conversation
With keep_credentials=True, a request that gets a 401 now logs in again with the kept credentials and is sent once more. The device rejects it in its auth middleware before running it, so nothing runs twice. This covers API calls, the start of a stream and WebSocket handshakes, but not uploads, whose body cannot be sent twice. The renewal keeps the session generation, since the account is the same, so operations in progress carry on. Calls that lose the session together share one login, and a login or logout by the caller still wins. Rejected credentials are dropped and raise NanoKVMAuthenticationFailure; an unreachable device raises its error and the next call tries again.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With keep_credentials=True, a request that gets a 401 now logs in again with the kept credentials and is sent once more. The device rejects it in its auth middleware before running it, so nothing runs twice. This covers API calls, the start of a stream and WebSocket handshakes, but not uploads, whose body cannot be sent twice.
The renewal keeps the session generation, since the account is the same, so operations in progress carry on. Calls that lose the session together share one login, and a login or logout by the caller still wins. Rejected credentials are dropped and raise
NanoKVMAuthenticationFailure; an unreachable device raises its error and the next call tries again.