Phase 14: Full WebAuthn support for passwordless passkey login and hardware security key 2FA. - go-webauthn/webauthn v0.16.1 dependency - WebAuthnConfig with RPID/RPOrigin/DisplayName validation - Migration 000009: webauthn_credentials table - DB CRUD with ownership checks and admin operations - internal/webauthn adapter: encrypt/decrypt at rest with AES-256-GCM - REST: register begin/finish, login begin/finish, list, delete - Web UI: profile enrollment, login passkey button, admin management - gRPC: ListWebAuthnCredentials, RemoveWebAuthnCredential RPCs - mciasdb: webauthn list/delete/reset subcommands - OpenAPI: 6 new endpoints, WebAuthnCredentialInfo schema - Policy: self-service enrollment rule, admin remove via wildcard - Tests: DB CRUD, adapter round-trip, interface compliance - Docs: ARCHITECTURE.md §22, PROJECT_PLAN.md Phase 14 Security: Credential IDs and public keys encrypted at rest with AES-256-GCM via vault master key. Challenge ceremonies use 128-bit nonces with 120s TTL in sync.Map. Sign counter validated on each assertion to detect cloned authenticators. Password re-auth required for registration (SEC-01 pattern). No credential material in API responses or logs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
70 lines
2.9 KiB
HTML
70 lines
2.9 KiB
HTML
{{define "account_detail"}}{{template "base" .}}{{end}}
|
|
{{define "title"}}{{.Account.Username}} — MCIAS{{end}}
|
|
{{define "content"}}
|
|
<div class="page-header d-flex align-center justify-between">
|
|
<div>
|
|
<h1>{{.Account.Username}}</h1>
|
|
<p class="text-muted text-small">{{.Account.UUID}}</p>
|
|
</div>
|
|
<a class="btn btn-secondary" href="/accounts">← Accounts</a>
|
|
</div>
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Account Info</h2>
|
|
<dl style="display:grid;grid-template-columns:140px 1fr;gap:.5rem .75rem;font-size:.9rem">
|
|
<dt class="text-muted">Type</dt><dd>{{.Account.AccountType}}</dd>
|
|
<dt class="text-muted">Status</dt>
|
|
<dd id="status-cell">{{template "account_status" .}}</dd>
|
|
<dt class="text-muted">TOTP</dt><dd>{{if .Account.TOTPRequired}}Enabled{{else}}Disabled{{end}}</dd>
|
|
{{if .WebAuthnEnabled}}<dt class="text-muted">Passkeys</dt><dd>{{len .WebAuthnCreds}} registered</dd>{{end}}
|
|
<dt class="text-muted">Created</dt><dd class="text-small">{{formatTime .Account.CreatedAt}}</dd>
|
|
<dt class="text-muted">Updated</dt><dd class="text-small">{{formatTime .Account.UpdatedAt}}</dd>
|
|
</dl>
|
|
</div>
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Roles</h2>
|
|
<div id="roles-editor">{{template "roles_editor" .}}</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="d-flex align-center justify-between" style="margin-bottom:1rem">
|
|
<h2 style="font-size:1rem;font-weight:600">Tokens</h2>
|
|
{{if and (eq (string .Account.AccountType) "system") .CanIssueToken}}
|
|
<button class="btn btn-sm btn-secondary"
|
|
hx-post="/accounts/{{.Account.UUID}}/token"
|
|
hx-target="#token-list" hx-swap="outerHTML">Issue Token</button>
|
|
{{end}}
|
|
</div>
|
|
{{template "token_list" .}}
|
|
</div>
|
|
{{if eq (string .Account.AccountType) "system"}}
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Postgres Credentials</h2>
|
|
{{template "pgcreds_form" .}}
|
|
</div>
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Token Issue Access</h2>
|
|
<div id="token-delegates-section">{{template "token_delegates" .}}</div>
|
|
</div>
|
|
{{end}}
|
|
{{if .WebAuthnEnabled}}
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Passkeys</h2>
|
|
{{template "webauthn_credentials" .}}
|
|
</div>
|
|
{{end}}
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Tags</h2>
|
|
<div id="tags-editor">{{template "tags_editor" .}}</div>
|
|
</div>
|
|
{{if eq (string .Account.AccountType) "human"}}
|
|
<div class="card">
|
|
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Reset Password</h2>
|
|
<p class="text-muted text-small" style="margin-bottom:.75rem">
|
|
Set a new password for this account. All active sessions will be revoked.
|
|
</p>
|
|
<div id="password-reset-section">
|
|
{{template "password_reset_form" .}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|