Commit Graph

16 Commits

Author SHA1 Message Date
herel 2502f005e3 fix(docker): Build Tailwind CSS in Docker image
The /style.css route 500'd in production because style.css is
gitignored and the Dockerfile never produced it: only main.py and
templates/ were copied into the image.

Mirror the myice Dockerfile by building the CSS in the builder stage:
copy the tailwind input files, download the standalone Tailwind CLI
(arch-aware for x64/arm64), and compile style.css. The artifact is
then copied into the runtime stage.

build-css.sh is kept for local dev but not used in Docker because its
#!/bin/bash shebang and pipefail are incompatible with alpine's sh.
2026-07-08 14:14:01 +02:00
herel 5aca0038b6 chore: missing doc 2026-07-08 14:11:26 +02:00
herel 24417bc7cf doc: add AGENTS.md 2026-07-08 14:11:18 +02:00
herel 9c7f2bde11 ref(frontend): Replace Bootstrap with Tailwind CSS
Swap the Bootstrap CDN for a self-hosted Tailwind CSS build, mirroring
the myice setup: standalone Tailwind CLI v3.4.17, a one-off build-css.sh
script, and a gitignored generated style.css.

- Add tailwind.config.js, style-input.css, build-css.sh at repo root
- Rewrite templates/index.html: drop Bootstrap link/script, link
  /style.css, convert all classes to Tailwind utilities; showAlert now
  uses a class lookup so the JIT scanner detects dynamic classes
- Add /style.css FileResponse route in main.py; drop cdn.jsdelivr.net
  from script-src/style-src in the CSP
- Flip test assertion to assert cdn.jsdelivr.net is absent from CSP

The generated style.css and tailwindcss binary are gitignored; run
./build-css.sh to regenerate (or --watch for dev).
2026-07-08 14:10:37 +02:00
herel 1a807cfeb4 fix(security): add nonce-uniqueness test and fix caller indentation 2026-07-08 13:57:28 +02:00
herel 284e685ed3 fix(security): remove innerHTML XSS sink in showAlert 2026-07-08 13:51:45 +02:00
herel d8c947f88f fix(security): add nonce-based CSP header to frontend route 2026-07-08 13:50:23 +02:00
herel 83eb6fff89 docs(spec): add design for XSS sink remediation and CSP 2026-07-08 13:48:10 +02:00
herel ea6955f7fb build: bump to Python 3.14 and update dependencies 2026-07-08 13:42:50 +02:00
herel b7a887b68b docs(spec): add design for Python 3.14 + dependency update 2026-07-08 13:40:59 +02:00
herel baef35115a fix(oidc): Add state parameter and validate nonce against login CSRF
The OIDC implicit-flow authorize request carried no state parameter and
the nonce was generated with weak Math.random() and never validated
client- or server-side, enabling login CSRF / forced authentication /
replay (AUTHZ-VULN-05).

Generate state and nonce with the Web Crypto CSPRNG, send state in the
authorize request, and validate both state and the id_token nonce claim
in the callback before storing tokens. Forward the nonce to /validate-
token so the backend also binds the id_token to the login flow.

Fixes the forged-callback fragment attack where a planted id_token with
a mismatched nonce was accepted, stored, and used by the SPA.
2026-07-08 13:34:31 +02:00
herel c960cee268 docs: add instructions for creating OAuth app with Infomaniak
This commit adds detailed instructions on how to create an OAuth application with Infomaniak to obtain the required Client ID and Client Secret.

Fixes #1
2025-08-08 11:57:40 +02:00
herel 0e3311df8e docs: update README and add test infrastructure
- Enhance .gitignore with comprehensive Python patterns
- Improve README with better setup and testing instructions
- Add test infrastructure:
  * Test requirements file
  * Environment setup script
  * Test runner script
  * Comprehensive test suite
  * Coverage configuration
2025-08-08 10:54:56 +02:00
herel 9e1f2128a2 docs: add demo URL to README
- Include link to live demo at https://demo-oidc.cl1.parano.ch/
- Make it easier for users to try the application without local setup
2025-08-08 09:43:06 +02:00
herel 7a87af42ab docs: add comprehensive documentation and MIT license
- Add detailed README.md with project overview, setup instructions, and usage guide
- Add MIT LICENSE file for open-source distribution
- Include .gitignore file for Python and Docker artifacts
2025-08-08 09:29:08 +02:00
herel a4908ac492 Initial commit
Adds OIDC token validator application with FastAPI backend and HTML/JavaScript frontend.
Includes Docker configuration and Kubernetes readiness.
2025-08-08 09:16:40 +02:00