Skip to content

feat(cloud): P0A hosted ownership policy and isolated D1 schema - #2

Draft
Nardo021 wants to merge 7 commits into
mote-v2from
feature/mote-cloud-p0a-20261116
Draft

Nardo021 wants to merge 7 commits into
mote-v2from
feature/mote-cloud-p0a-20261116

Conversation

@Nardo021

Copy link
Copy Markdown
Owner

Scope

Start Mote Cloud P0A as an isolated, fail-closed security foundation; preserve the current single-user Cloudflare Worker and self-hosting configuration exactly as-is.

  • Add a TypeScript Cloud authorization policy for only lock on active devices owned by a trusted active session. Cross-account, absent and revoked devices produce the same 404 and no tenant routing key.
  • Add unit threat tests for expired/revoked sessions, account isolation, guessed IDs and unauthorized actions.
  • Add a hosted-only (not applied) D1 SQL schema for accounts, sessions, device ownership and one-time pairing tickets, with SQLite foreign-key/uniqueness tests.
  • Document the future Apple sign-in, pairing protocol, atomic claim semantics, trust boundaries, and P0B handoff in docs/cloud-p0a-security.md.

What is NOT implemented

No live Apple identity verifier, account endpoint, pairing endpoint, public multi-tenant Worker, D1 migration execution, iOS app, DO routing change, production deployment, or real-world cross-account verification. This is P0A PARTIAL, not a Cloud service.

Verification

CI should automatically exercise both new relay/test/*.test.ts files and typecheck the new module. No test results are claimed at PR creation. Check GitHub Actions before converting this PR to ready/merging.

Next PR

P0B: separately configured staging-only Cloud worker, verified identity/session records and D1 ownership repository; then pairing claim atomicity and per-account DO isolation before any public exposure.

Related planning: #1. No runtime/self-host behaviour changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant