Skip to content

feat(cli): log in to AniList and out of it - #85

Merged
noctuum merged 1 commit into
mainfrom
feat/anilist-login
Oct 15, 2026
Merged

noctuum merged 1 commit into
mainfrom
feat/anilist-login

Conversation

@noctuum

@noctuum noctuum commented Oct 15, 2026

Copy link
Copy Markdown
Member

benshi login prints 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 logout has the daemon remove it.

  • The daemon asks AniList Viewer whose 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 the exp of the token's claims.
  • Request::Login and Request::Logout are answered twice: Ok once 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.
  • At a terminal the token is read a byte at a time with echo, line editing and signals off. Ctrl-C and Ctrl-D cancel, and the terminal is set back.
  • Token in benshi-core shows none of its text with {:?}. The protocol, the prompt and Http hold the token in it.
  • base64, already in the lock through reqwest, reads the claims, and rustix sets the terminal.
  • The recorder in benshi-sync reads its token from BENSHI_TOKEN_ANILIST, as tests/login_live.rs does.

The ignored tests/login_live.rs was run once with the test account against AniList and ksecretd of kwallet 6.31.0, with the wallet unlocked: the login and the logout passed. A locked wallet was not tested.

cargo test --workspace passes, 1029 tests.

A token AniList takes is kept, and the pasted token is not shown.
@noctuum
noctuum merged commit 19e8e38 into main Oct 15, 2026
1 check passed
@noctuum
noctuum deleted the feat/anilist-login branch October 15, 2026 20:48
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.

1 participant