[codex] Fix server handler payload aliases#1990
Draft
bokelley wants to merge 1 commit into
Draft
Conversation
| const auth = listAccounts.accounts[0]?.notification_configs?.[0]?.authentication; | ||
| if (auth) { | ||
| // @ts-expect-error — response payload aliases must not expose write-only webhook credentials. | ||
| auth.credentials; |
| const embeddedAuth = createBuy.account?.notification_configs?.[0]?.authentication; | ||
| if (embeddedAuth) { | ||
| // @ts-expect-error — embedded account payloads get the same response-safe projection. | ||
| embeddedAuth.credentials; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
*Payloadand*HandlerResultaliases across decisioning surfaces and re-export them from@adcp/sdk/server.Result<Payload, E>,TaskHandoff, account handler aliases, broad alias exports, and write-only field stripping.Root Cause
The previous tests covered direct
SalesPlatformpayload returns, but not adopter helper layers that annotate results asResult<GeneratedWireResponse, E>. Those generated response types include protocol task-envelope fields such asstatus: TaskStatus, so adopter helpers were forced to return envelope fields that the SDK owns and stamps later.During expert review, we also found that widening public payload aliases needed to stay aligned with the write-only response contract for nested webhook credentials and bank details. This PR fixes both the type surface and the raw response-builder runtime projection.
Expert Review
authentication.credentialsandBusinessEntity.bankexposure risk in public aliases; fixed inServerPayload<T>and guarded by type tests.Validation
npm run typechecknpm run build:libnode --test test/server-responses.test.js test/lib/account-notification-config-projection.test.jsnpm run check:adopter-typesgit diff --checktypecheck+build:libFixes #1988