T27: FIT Wiki connection (session cookie or one-time login) #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "t27-fitwiki-connection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
T27: FIT Wiki connection
FIT Wiki (fit-wiki.cz, DokuWiki) is readable only by registered FIT students, with no API or SSO. FIT-OS therefore acts with the user's own DokuWiki session:
DokuWikiandDW<hash>cookies are kept (parseWikiCookies), and the session is verified by loading a page as the user.wikiLogin: login form →sectok→ POST → session check). The password is never stored. Only the resulting DokuWiki cookies are saved.connections(providerfitwiki, kindcookie) and are never returned. Disconnect deletes them.POST /api/connections/fitwikirequires a session and passesisSameOriginRequest. Password logins are limited per user byFITWIKI_LOGIN_LIMIT(5/min, a config-only rate-limit binding), so FIT-OS can't be used to guess wiki passwords. Requests go only to fit-wiki.cz, use manual redirects and a 15 s timeout, read at most 1 MB, and send an identified user agent.cvut:cpages:common:read, GitLab as fallback).Note for the next production deploy: add
FITWIKI_LOGIN_LIMITtoenv.production(PR #26).Review (Astra)
Checks
lint, typecheck and test: 318 passing. Dev smoke test: the card renders in both modes, and a fake cookie is checked against fit-wiki.cz, rejected with the friendly error and not stored.
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.