Skip to content

Commit 8369595

Browse files
committed
chore(credentials): log a broken JWKS and keep the successor map out of credential display
The JWKS route still answers 404 when the signing key is broken, but warns with the error. The GitLab personal-token display reads its block type from the catalog entry instead of importing the generated successor map into a client-imported module.
1 parent 65dec86 commit 8369595

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎apps/sim/lib/credentials/workload-identity/responses.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import { createLogger } from '@sim/logger'
12
import { NextResponse } from 'next/server'
23
import {
34
getWorkloadIdentityDiscoveryDocument,
45
getWorkloadIdentityJwks,
56
isWorkloadIdentityConfigured,
67
} from '@/lib/credentials/workload-identity/issuer'
78

9+
const logger = createLogger('WorkloadIdentityDiscovery')
10+
811
/**
912
* Cloud providers fetch these anonymously (AWS STS, Databricks) and
1013
* cache them; five minutes keeps a key rotation visible quickly. "No issuer
@@ -28,7 +31,11 @@ export async function workloadIdentityDiscoveryResponse() {
2831

2932
/** The issuer's public signing keys (JWKS), or 404 when this deployment has no usable signing key. */
3033
export async function workloadIdentityJwksResponse() {
31-
const jwks = await getWorkloadIdentityJwks().catch(() => null)
34+
const jwks = await getWorkloadIdentityJwks().catch((error: unknown) => {
35+
// Still a 404 to the provider, but a broken signing key must not look like an unconfigured one.
36+
logger.warn('Could not build the workload identity JWKS', { error })
37+
return null
38+
})
3239
if (!jwks) return notConfigured()
3340
return NextResponse.json(jwks, { headers: DISCOVERY_HEADERS })
3441
}

‎apps/sim/lib/integrations/credential-display.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { CANONICAL_SERVICE_ACCOUNT_SLUGS } from '@/lib/integrations/oauth-servic
2222
import { OAUTH_PROVIDERS } from '@/lib/oauth/oauth'
2323
import type { OAuthProvider, OAuthServiceConfig } from '@/lib/oauth/types'
2424
import { getServiceConfigByProviderId, parseProvider } from '@/lib/oauth/utils'
25-
import { resolveAccessControlBlockType } from '@/lib/permission-groups/integration-allowlist'
2625

2726
/**
2827
* Above this many covered integrations the subtitle states a count instead of
@@ -227,7 +226,7 @@ export function resolveCredentialDisplay(credential: DisplayableCredential): Cre
227226
return {
228227
service: null,
229228
integration,
230-
blockType: resolveAccessControlBlockType('gitlab'),
229+
blockType: integration?.type ?? 'gitlab',
231230
icon: GitlabIcon,
232231
familyName: null,
233232
coveredIntegrations: integration ? [integration] : [],

0 commit comments

Comments
 (0)