diff --git a/packages/board/src/server/backend-vercel.ts b/packages/board/src/server/backend-vercel.ts index 34bd5c40..3f21d492 100644 --- a/packages/board/src/server/backend-vercel.ts +++ b/packages/board/src/server/backend-vercel.ts @@ -29,9 +29,9 @@ type ApiPrincipal = | { type: 'app'; clientId: string } | { type: 'project'; projectId: string; environment: string } /** A GitHub Actions run, by its repository: `github:repo:`. */ - | { type: 'github'; repositoryId: string; repository: string; workflowRef?: string; ref?: string; event?: string } + | { type: 'github'; repositoryId: string; repository: string } /** A caller another OIDC issuer vouches for: `oidc::`. */ - | { type: 'oidc'; issuer: string; subject: string; claims: Record } + | { type: 'oidc'; issuer: string; subject: string } /** An imported message's author as the API named it before platform profiles: the platform user alone. */ | { type: 'external'; id: string; syncKey: string } /** diff --git a/packages/board/test/messageboard.ts b/packages/board/test/messageboard.ts index 12faebcd..b4d4b187 100644 --- a/packages/board/test/messageboard.ts +++ b/packages/board/test/messageboard.ts @@ -15,7 +15,7 @@ type Principal = | { type: 'app'; clientId: string } | { type: 'project'; projectId: string; environment: string } | { type: 'github'; repositoryId: string; repository: string } - | { type: 'oidc'; issuer: string; subject: string; claims: Record } + | { type: 'oidc'; issuer: string; subject: string } | { type: 'external'; id: string; syncKey: string } type Actor = { id: string @@ -199,7 +199,7 @@ function actorOf(request: Request, tokens: Record = {}, protocol : repository ? { type: 'github', repositoryId: environment!, repository } : type === 'oidc' && subject - ? { type: 'oidc', issuer: `https://${decodeURIComponent(id!)}`, subject, claims: { sub: subject } } + ? { type: 'oidc', issuer: `https://${decodeURIComponent(id!)}`, subject } : null if (!principal) throw new Refused(401, 'invalid_token', 'This token is invalid, expired, or revoked.') let { name, avatar, session } = { @@ -293,7 +293,7 @@ const whoOf = (actor: Actor): Who => { : p.type === 'github' ? { kind: 'github', repositoryId: p.repositoryId, repository: p.repository, ...limit } : p.type === 'oidc' - ? { kind: 'oidc', issuer: p.issuer, claims: p.claims, ...limit } + ? { kind: 'oidc', issuer: p.issuer, claims: { sub: p.subject }, ...limit } : { kind: 'app', clientId: p.clientId, ...limit } }