Repository navigation
feat(cli): log in to AniList and out of it - #85
Merged
Merged
Conversation
A token AniList takes is kept, and the pasted token is not shown.
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.
benshi loginprints the address where AniList gives a token for benshi, reads the pasted token without showing it, and has the daemon check it and keep it in the secret store.benshi logouthas the daemon remove it.Viewerwhose the token is before it writes the token, so a token AniList refuses is not kept. It answers with the name of the account and theexpof the token's claims.Request::LoginandRequest::Logoutare answered twice:Okonce the request is read, within the client's 5 s deadline, and then what the request came to. The store may ask the person to unlock it, and the client waits for that answer as long as the daemon takes.Tokeninbenshi-coreshows none of its text with{:?}. The protocol, the prompt andHttphold the token in it.base64, already in the lock throughreqwest, reads the claims, andrustixsets the terminal.benshi-syncreads its token fromBENSHI_TOKEN_ANILIST, astests/login_live.rsdoes.The ignored
tests/login_live.rswas run once with the test account against AniList andksecretdof kwallet 6.31.0, with the wallet unlocked: the login and the logout passed. A locked wallet was not tested.cargo test --workspacepasses, 1029 tests.