totp template#7
Open
godronus wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new edge-totp template that provides an edge-deployed TOTP (RFC 6238) MFA “bolt-on” for FastEdge, consisting of a TypeScript HTTP app (challenge/enroll/verify/JWKS) plus a Rust proxy-wasm filter that enforces an mfa_session cookie on protected CDN paths.
Changes:
- Add the new
edge-totp/template (TSotp-app+ Rustotp-filter) with docs and build/test wiring. - Add unit/acceptance tests for both components (TS unit tests + wasm black-box tests for the filter).
- Add a GitHub Actions workflow to build/test and publish the template.
Reviewed changes
Copilot reviewed 47 out of 49 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds edge-totp entry to the repo-level README. |
| CLAUDE.md | Adds edge-totp to the repo structure documentation. |
| .github/workflows/publish-edge-totp.yml | CI workflow to build/test and deploy edge-totp templates. |
| edge-totp/README.md | Template-level documentation (components, build/test, deploy, security notes). |
| edge-totp/LICENSE | Adds Apache-2.0 license for the template. |
| edge-totp/.gitignore | Ignores template build artifacts, env files, and tool outputs. |
| edge-totp/AGENTS.md | Template-specific agent policy doc. |
| edge-totp/CLAUDE.md | Template-specific overview, constraints, and navigation pointers. |
| edge-totp/pnpm-workspace.yaml | Defines pnpm workspace + shared dependency catalog. |
| edge-totp/package.json | Workspace scripts to build/test/copy wasm artifacts. |
| edge-totp/otp-app/package.json | otp-app build/test scripts and dependencies. |
| edge-totp/otp-app/tsconfig.json | TS configuration for otp-app build/tests. |
| edge-totp/otp-app/.env.example | Documented env/secrets for otp-app configuration. |
| edge-totp/otp-app/registry.json | FastEdge template registry metadata and parameters for otp-app. |
| edge-totp/otp-app/scripts/gen-ec-keypair.mjs | Generates ES256 keypair for Profile B proof/JWKS. |
| edge-totp/otp-app/src/index.ts | Main Hono app implementing challenge/verify/enroll/activate/logout/JWKS/health. |
| edge-totp/otp-app/src/config.ts | Config + secret loading and validation helpers. |
| edge-totp/otp-app/src/challenge.ts | Renders hosted OTP challenge HTML. |
| edge-totp/otp-app/src/enroll.ts | Renders hosted self-service enrollment HTML. |
| edge-totp/otp-app/src/lib/base32.ts | Base32 encode/decode implementation (RFC 4648). |
| edge-totp/otp-app/src/lib/cookies.ts | Cookie helper for app responses. |
| edge-totp/otp-app/src/lib/html.ts | Shared HTML escaping + branding chrome helpers. |
| edge-totp/otp-app/src/lib/jwt.ts | Handoff ticket verification, session/proof signing, enroll-cookie helpers, JWKS builder. |
| edge-totp/otp-app/src/lib/qr.ts | QR rendering (otpauth URI → inline SVG). |
| edge-totp/otp-app/src/lib/safeEqual.ts | Constant-time string compare helper. |
| edge-totp/otp-app/src/lib/totp.ts | TOTP generation + drift-window verification helpers. |
| edge-totp/otp-app/src/lib/validate.ts | Validation utilities for redirects, ints, booleans. |
| edge-totp/otp-app/src/seed/kv.ts | KV seed read + KV REST write integration. |
| edge-totp/otp-app/tests/unit/base32.test.ts | Unit tests for base32 helpers. |
| edge-totp/otp-app/tests/unit/jwt.test.ts | Unit tests for JWT helpers (handoff/session/proof/enroll/JWKS). |
| edge-totp/otp-app/tests/unit/totp.test.ts | Unit tests for TOTP generation (RFC 6238 vectors) + otpauth URI. |
| edge-totp/otp-app/tests/unit/validate.test.ts | Unit tests for config/redirect validation helpers. |
| edge-totp/otp-filter/Cargo.toml | Rust crate config for proxy-wasm filter. |
| edge-totp/otp-filter/Cargo.lock | Rust dependency lockfile. |
| edge-totp/otp-filter/package.json | Filter test harness (fastedge-test runner). |
| edge-totp/otp-filter/.cargo/config.toml | Builds target set to wasm32-wasip1. |
| edge-totp/otp-filter/.env.example | Documented env/secrets for otp-filter configuration. |
| edge-totp/otp-filter/registry.json | FastEdge template registry metadata and parameters for otp-filter. |
| edge-totp/otp-filter/src/lib.rs | Proxy-wasm filter enforcing mfa_session with fail-closed behavior and safe bypass. |
| edge-totp/otp-filter/tests/filter.test.ts | Black-box acceptance tests driving the compiled wasm filter. |
| edge-totp/context/INDEX.md | Documentation index for the template context folder. |
| edge-totp/context/integration.md | Customer origin-side integration guide. |
| edge-totp/context/security/threat-model.md | Threat model + residual risks documentation. |
| edge-totp/context/design/decisions.md | Design rationale documentation. |
| edge-totp/context/design/runtime-constraints.md | FastEdge JS runtime constraints documentation. |
| edge-totp/context/architecture/overview.md | High-level architecture overview documentation. |
| edge-totp/context/architecture/flow.md | End-to-end flow documentation (enroll/challenge/verify) including PoP reasoning. |
| edge-totp/context/architecture/storage-and-secrets.md | KV/storage model and full env/secrets reference documentation. |
Files not reviewed (1)
- edge-totp/pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.