fix: pass only required fields in workflow billingCustomer params (#123)

The callers of startAudit and beginRankCheckRun were forwarding the
incoming billingCustomer object directly into workflow.create params.
At runtime the object can be an EnsuredUserContext with extra fields
beyond BillingCustomerContext, which pollutes the workflow instance's
persisted params payload. Explicitly pick the four required fields so
only the intended data is serialized into the workflow.
This commit is contained in:
Ben Senescu 2026-04-16 16:24:27 -04:00 committed by GitHub
parent 59d1dd24cb
commit ed27b64eb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -58,7 +58,12 @@ async function startAudit(input: {
id: auditId,
params: {
auditId,
billingCustomer: input.billingCustomer,
billingCustomer: {
userId: input.billingCustomer.userId,
userEmail: input.billingCustomer.userEmail,
organizationId: input.billingCustomer.organizationId,
projectId: input.billingCustomer.projectId,
},
projectId: input.projectId,
startUrl,
config,

View File

@ -116,7 +116,12 @@ export async function beginRankCheckRun(input: {
params: {
runId,
configId: input.config.id,
billingCustomer: input.billingCustomer,
billingCustomer: {
userId: input.billingCustomer.userId,
userEmail: input.billingCustomer.userEmail,
organizationId: input.billingCustomer.organizationId,
projectId: input.billingCustomer.projectId,
},
projectId: input.projectId,
domain: input.config.domain,
locationCode: input.config.locationCode,