feat(php): signed-in users through the dewee identity session exchange (parity with the TypeScript handler)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- github, php, typescript
- Ambito
- api, authentication, backend
Direzione di ricerca
Read php/dewee-webchat.php, the TypeScript handler, docs/http-contract.md, and test/php-parity.test.ts; then compare the signed-in user sections in packages/dewee-webchat/README.md and the isolation tests in packages/dewee-webchat/test/. Implementing this scope spans signing, session exchange, chat/history binding, links, and error handling. Done means PHP lint passes and parity and isolation checks match the stated acceptance criteria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
The Node/Workers handler can sign users in through a Dewee identity session exchange (identity option, see the "Signed-in users" sections of packages/dewee-webchat/README.md and docs/http-contract.md). The single-file PHP backend (php/dewee-webchat.php) does not support it yet: the exchange needs a signed partner assertion (a compact JWS, HS256 for hmac applications and RS256/ES256/EdDSA for jwks ones), and the PHP adapter has no JWS signing.
Surface parity: php/dewee-webchat.php N/A in the first PR because identity exchange needs JWS signing not yet in the PHP adapter.
Parent: nextlevelbuilder/dewee#1450 (Trusted User Context + Dewee Connect).
Scope
Bring the PHP backend to parity with the TypeScript handler for signed-in users, without new Composer dependencies:
- An
identityoption:authenticatecallable,appId,issuer,audience(optional check,dewee:<appId>), and exactly one ofassertionSecretorprivateKeyJwk(+algorithm),agent,required,sessionTtlSeconds. - Assertion signing: HS256 with
hash_hmacover the UTF-8 secret exactly as issued; ES256/RS256 withopenssl_sign(ES256 converted from DER to the 64-byte JOSE form). Headertyp: dewee-session+jwt, claimsiss,aud,sub,iat,exp(at most 300 s), freshjti. Refuse asubcontaining@. POST /session:POST {gateway}/v1/identity/sessions/exchange, visitor token claimsidsandida,exp= min(session expiry, visitor expiry),verified: true, visitor id derived from the principal (HMAC of the visitor secret overdewee-webchat:visitor:principal:<id>, first 16 bytes, base64url)./chatand/history: connect withidentity_sessionand nouser_id; bind the request toida; forward the seven identity codes as{error:{message, code, remediation}}with the statuses indocs/http-contract.md.POST /link:POST {gateway}/v1/identity/linkswithX-Dewee-Identity-Session, answer{proofCode, expiresAt, deepLinks}.- Fail closed exactly like the TypeScript handler: no anonymous fallback for a signed-in user whose exchange fails; anonymous only when not
required; refuse identity combined with client credentials; never echo the gateway token, assertion secret or private key.
Acceptance
php -l php/dewee-webchat.phppasses.- A parity test (like
test/php-parity.test.ts) shows the PHP and TypeScript backends produce the same visitor-id derivation, claim shape and error envelopes, and that a PHP-signed assertion verifies with the same checks the gateway applies. - The isolation cases of
packages/dewee-webchat/test/identity.test.tshold for the PHP backend (different users get different sessions, a replayed token keeps its user, a tampered token is 401, secrets never appear in a response).
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 1
- Merge medio
- 1g 3h
- PR unite (30g)
- 8
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextlevelbuilder/dewee-webchat
-
ai-handle
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
-
ai-handle enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
ai-handle bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 53/100
-
ai-handle enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
nextlevelbuilder/dewee-webchat#2 · 1 commento ·
Tutte le issue di nextlevelbuilder/dewee-webchat
Issue simili
-
backend bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
geolens-io/geolens#3568 ·
I maintainer di solito rispondono entro 1 giorno
-
area:docs documentation good first issue priority:low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
rtk-ai/rtk#4900 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
API: `tsc.exe` opens a visible console window on Windows when the parent process has no consoleAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/TypeScript#65083 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
bug p2 platform:web triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno