Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/board/src/server/backend-vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:<repositoryId>`. */
| { 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:<issuer's host and path>:<subject>`. */
| { type: 'oidc'; issuer: string; subject: string; claims: Record<string, string | number | boolean> }
| { 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 }
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/board/test/messageboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> }
| { type: 'oidc'; issuer: string; subject: string }
| { type: 'external'; id: string; syncKey: string }
type Actor = {
id: string
Expand Down Expand Up @@ -199,7 +199,7 @@ function actorOf(request: Request, tokens: Record<string, string> = {}, 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 } = {
Expand Down Expand Up @@ -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 }
}

Expand Down