已关闭
[WEB-01] Define WebUI, Telegram OIDC and tenant-authorization contracts #30
urandon创建于  8月4日关闭于  8月5日
urandon
urandon成员
8月4日 创建

Parent

Outcome

Freeze frontend-neutral WebUI, authentication, authorization, session, CSRF, upload-intent and API contracts before persistence or UI implementation.

Estimate

  • 3 SP / 2 engineering days
  • Risk: medium

Scope

  • Define Telegram OIDC Authorization Code + PKCE start/callback/error contracts.
  • Define external Telegram subject → internal user → tenant membership resolution.
  • Define enrollment precedence: an existing Telegram binding, a one-time tenant invitation, or an explicitly audited development-operator bootstrap.
  • Define one-time invitation digest, expiry, optional target-subject binding, membership role and atomic consumption.
  • Allow successful OIDC to create/refresh an external identity record only; it must never create a tenant or membership without an explicit grant.
  • Define a credential-safe CLI/admin procedure for initial cloud-dev operator membership that does not depend on Telegram webhook reachability or Terraform-managed application rows.
  • Define first-party opaque session, rotation, expiry, revocation and membership-security-version behavior.
  • Define tenant switching without treating browser tenant_id as authority.
  • Define CSRF, Origin, cookie, CSP, log-redaction and audit requirements.
  • Define frontend-neutral API schemas and consistent error envelopes.
  • Define tenant-bound upload-intent and commit contracts.
  • Add a focused threat model covering callback forgery, replay, fixation, tenant/session IDOR, CSRF, malicious uploads and secret leakage.
  • Record the selected defaults in public English documentation.

Verification

  • Contract tests cover expired/replayed state, invalid issuer/audience/nonce, unknown identity and revoked membership.
  • Enrollment tests cover missing grant, expired/replayed invite, wrong bound subject, concurrent consumption and audited dev bootstrap.
  • Authorization matrix includes two users, two tenants, multi-membership selection and suspended membership.
  • API schema contains no endpoint that trusts a tenant claim without membership resolution.
  • Threat-model mitigations map to executable tests in WEB-02/03/06.

Acceptance criteria

  • Contracts are implementable without Telegram chat history or a Telegram message update.
  • The first cloud-dev operator can receive an explicit audited membership without waiting for external Telegram ingress #17.
  • The WebUI remains a projection over canonical sessions/events.
  • No provider or Sessionless bearer token is stored in browser-accessible storage.
  • The design has explicit compatibility points for future non-Telegram identity providers.

Non-goals

  • Implementing the BFF or Svelte UI.
  • Creating cloud resources.
  • General RBAC administration or password authentication.
likedislike
urandonurandon成员
8月4日 修改了issue 的描述
urandonurandon成员
8月5日 关联了pull request:WEB-01: define authenticated WebUI contracts
urandon
urandon成员
8月5日 评论:

Implementation report — authenticated WebUI contracts

Implementation is ready in MR !21, branch ai/web-01-auth-contracts, commit 1e80903df39f1b9fcc6058c5edc184f38645ad5e.

Delivered

  • Added frontend-neutral domain contracts for external identities, tenant memberships, enrollment, OIDC challenges, revocable browser sessions, and tenant/session-bound upload intents.
  • Defined Telegram OIDC verification requirements: exact issuer and audience, algorithm allowlist, nonce, time validation, Authorization Code + PKCE S256, and the minimal openid profile scope.
  • Kept provider tokens behind the OIDC adapter boundary; browser sessions use opaque, expiring, revocable server-side identifiers and never expose Telegram credentials.
  • Defined explicit enrollment paths: an existing trusted frontend binding, a one-time invitation, or an operator-controlled cloud-development bootstrap. Successful authentication alone does not grant tenant membership.
  • Added role and membership-version authorization rules, including immediate rejection of suspended memberships and stale sessions after membership changes.
  • Added a stable WebUI API contract for session listing/creation/switching, message append, run cancellation, compute status, and attachment upload intents.
  • Added strict Origin plus session-bound CSRF validation for browser mutations. Normal mutation payloads do not accept tenant_id as authority.
  • Added one-time upload-intent invariants covering tenant, user, session, object-key prefix, size, digest, expiry, and replay protection.
  • Added a WebUI threat model and an authorization matrix with stable error codes and HTTP status mappings.
  • Updated the public README and contract documentation to reflect Sessionless-owned canonical sessions, Telegram as the first frontend adapter, and harness-pluggable serverless workers.

Verification

Local verification passed:

  • make ci
  • git diff --check
  • public documentation contains no Cyrillic text

GitHub mirror CI is green for the exact commit SHA in workflow run #63:

  • Go verification
  • Terraform environments
  • Local multi-service stand
  • YDB schema and state store
  • Runtime images

Follow-up boundary

This issue freezes the contracts only. It deliberately does not add WebUI persistence tables, the Go BFF, Svelte UI, Telegram OIDC production configuration, or cloud resources. Those begin in WEB-02 and the following WebUI implementation issues.

likedislike
urandonurandon成员
8月5日 关闭了 issue
urandonurandon成员
15 天前 添加了label:designmvpwebui
urandonurandon成员
15 天前 关联了里程碑:MVP — Authenticated WebUI (#29)