vikunja/veans/internal/commands
Tink bot 35aa486eb5 feat(veans): use OAuth 2.0 Authorization Code + PKCE as default auth
Vikunja's built-in OAuth server (Vikunja 2.3+) does not require client
registration and accepts arbitrary client_ids — it just enforces PKCE
(S256) and constrains redirect URIs to the vikunja- scheme. Earlier I
deferred OAuth on the assumption it needed a registered client; that
was wrong, and the docs make the path much smoother than POST /login.

The custom-scheme constraint (no http:// loopback) is side-stepped by
manual paste-back: veans prints the authorize URL, the user signs in,
their browser fails to open vikunja-veans-cli://callback?code=... and
shows an error, the user copies the URL from the address bar and
pastes it back. CLI extracts code + state, verifies state for CSRF,
exchanges via POST /api/v1/oauth/token (JSON body — Vikunja rejects
form-encoded), and returns the access token.

Resolution order in AcquireHumanToken:
  1. --token (paste-in JWT or personal API token; SSO/OIDC users)
  2. --use-password / --username + --password (POST /login)
  3. OAuth flow (interactive default)

login command supports the same --use-password / --token escape hatches
for token rotation on instances with OAuth disabled.

Includes unit tests for the PKCE generator (verifier shape per RFC 7636,
challenge = SHA256(verifier) base64url-no-pad), authorize-URL
construction, and the lenient callback parser (full URL / query-only /
bare code).
2026-05-27 08:21:57 +00:00
..
api.go feat(veans): add api passthrough command 2026-05-27 08:21:57 +00:00
claim.go feat(veans): add claim command for assigning and bucket transition 2026-05-27 08:21:57 +00:00
create.go feat(veans): add create command with labels and relations 2026-05-27 08:21:57 +00:00
git.go feat(veans): add shared command runtime and git branch helper 2026-05-27 08:21:57 +00:00
init.go feat(veans): use OAuth 2.0 Authorization Code + PKCE as default auth 2026-05-27 08:21:57 +00:00
labels.go feat(veans): add label get-or-create helper 2026-05-27 08:21:57 +00:00
list.go feat(veans): add list command with filters and JSON output 2026-05-27 08:21:57 +00:00
login.go feat(veans): use OAuth 2.0 Authorization Code + PKCE as default auth 2026-05-27 08:21:57 +00:00
prime.go feat(veans): add prime command for agent prompt injection 2026-05-27 08:21:57 +00:00
prime_test.go feat(veans): add prime command for agent prompt injection 2026-05-27 08:21:57 +00:00
prompt.tmpl feat(veans): add prime command for agent prompt injection 2026-05-27 08:21:57 +00:00
root.go feat(veans): add login command for token rotation 2026-05-27 08:21:57 +00:00
runtime.go feat(veans): add shared command runtime and git branch helper 2026-05-27 08:21:57 +00:00
show.go feat(veans): add show command with PROJ-NN/#NN ID resolver 2026-05-27 08:21:57 +00:00
update.go feat(veans): add update command with description and status transitions 2026-05-27 08:21:57 +00:00
update_test.go feat(veans): add update command with description and status transitions 2026-05-27 08:21:57 +00:00