diff --git a/packages/console/src/consts/logs.ts b/packages/console/src/consts/logs.ts index f1e5bf1d7..ecb7937a7 100644 --- a/packages/console/src/consts/logs.ts +++ b/packages/console/src/consts/logs.ts @@ -106,6 +106,8 @@ export const auditLogEventTitle: Record> & { 'Verify forgot-password SMS verification code', 'Interaction.SignIn.Verification.IdpInitiatedSso.Create': 'Create IdP-initiated SAML SSO authentication session', + 'JwtCustomizer.AccessToken': 'Get custom user access token claims', + 'JwtCustomizer.ClientCredential': 'Get custom M2M access token claims', }); export const logEventTitle: Record> & { diff --git a/packages/core/src/queries/log.ts b/packages/core/src/queries/log.ts index be31bf98b..7223b0aab 100644 --- a/packages/core/src/queries/log.ts +++ b/packages/core/src/queries/log.ts @@ -6,6 +6,7 @@ import { type Log, type interaction, type LogKeyUnknown, + type jwtCustomizer, } from '@logto/schemas'; import { conditional, conditionalArray } from '@silverhand/essentials'; import { sql } from '@silverhand/slonik'; @@ -18,7 +19,12 @@ import { conditionalSql, convertToIdentifiers } from '#src/utils/sql.js'; const { table, fields } = convertToIdentifiers(Logs); -export type AllowedKeyPrefix = hook.Type | token.Type | interaction.Prefix | typeof LogKeyUnknown; +export type AllowedKeyPrefix = + | hook.Type + | token.Type + | interaction.Prefix + | jwtCustomizer.Prefix + | typeof LogKeyUnknown; type LogCondition = { logKey?: string; diff --git a/packages/core/src/routes/log.test.ts b/packages/core/src/routes/log.test.ts index 41b6a081e..8dc6848b5 100644 --- a/packages/core/src/routes/log.test.ts +++ b/packages/core/src/routes/log.test.ts @@ -1,4 +1,4 @@ -import { LogResult, token, interaction, LogKeyUnknown } from '@logto/schemas'; +import { LogResult, token, interaction, LogKeyUnknown, jwtCustomizer } from '@logto/schemas'; import type { Log } from '@logto/schemas'; import { pickDefault } from '@logto/shared/esm'; @@ -49,6 +49,7 @@ describe('logRoutes', () => { token.Type.ExchangeTokenBy, token.Type.RevokeToken, interaction.prefix, + jwtCustomizer.prefix, LogKeyUnknown, ], }); @@ -59,6 +60,7 @@ describe('logRoutes', () => { token.Type.ExchangeTokenBy, token.Type.RevokeToken, interaction.prefix, + jwtCustomizer.prefix, LogKeyUnknown, ], }); diff --git a/packages/core/src/routes/log.ts b/packages/core/src/routes/log.ts index 0d53f1211..8ecc837a2 100644 --- a/packages/core/src/routes/log.ts +++ b/packages/core/src/routes/log.ts @@ -1,4 +1,4 @@ -import { Logs, interaction, token, LogKeyUnknown } from '@logto/schemas'; +import { Logs, interaction, token, LogKeyUnknown, jwtCustomizer } from '@logto/schemas'; import { object, string } from 'zod'; import koaGuard from '#src/middleware/koa-guard.js'; @@ -34,6 +34,7 @@ export default function logRoutes( token.Type.ExchangeTokenBy, token.Type.RevokeToken, interaction.prefix, + jwtCustomizer.prefix, LogKeyUnknown, ];