feat(php): signed-in users through the dewee identity session exchange (parity with the TypeScript handler)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, php, typescript
- Lĩnh vực
- api, authentication, backend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- TypeScript
- Star
- 7
- Fork
- 1
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextlevelbuilder/dewee-webchat
-
ai-handle
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
-
ai-handle enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
ai-handle bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 53/100
-
ai-handle enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 5/100
nextlevelbuilder/dewee-webchat#2 · 1 bình luận ·
Tất cả issue của nextlevelbuilder/dewee-webchat
Issue tương tự
-
guards: accept readonly arrays (and other array-likes) in isEmpty / hasElements / safeLengthĐang mởenhancement tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
danielmiessler/LifeOS#2533 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
auto:producer auto:uiux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
fritzprix/libr-agent#2447 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug low priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100