diff --git a/plugins/audit-log-common/src/DefaultAuditLogger.ts b/plugins/audit-log-common/src/DefaultAuditLogger.ts index d497537a65..7af403ffb7 100644 --- a/plugins/audit-log-common/src/DefaultAuditLogger.ts +++ b/plugins/audit-log-common/src/DefaultAuditLogger.ts @@ -11,22 +11,16 @@ import { AuditErrorLogOptions, AuditLogDetailsOptions, AuditLogger, + AuditLoggerOptions, AuditLogOptions, - ScaffolderAuditLoggerOptions, } from './types'; -/** - * Generates the audit log details to place in the metadata argument of the logger - * - * Secrets in the body field should be redacted by the user before passing in the request object - * @public - */ export class DefaultAuditLogger implements AuditLogger { private readonly logger: LoggerService; private readonly authService: AuthService; private readonly httpAuthService: HttpAuthService; - constructor(options: ScaffolderAuditLoggerOptions) { + constructor(options: AuditLoggerOptions) { this.logger = options.logger; this.authService = options.authService; this.httpAuthService = options.httpAuthService; diff --git a/plugins/audit-log-common/src/types.ts b/plugins/audit-log-common/src/types.ts index 02da0b20fb..ec8c35d101 100644 --- a/plugins/audit-log-common/src/types.ts +++ b/plugins/audit-log-common/src/types.ts @@ -81,7 +81,7 @@ export type AuditLogOptions = { export type AuditErrorLogOptions = AuditLogOptions & { errors: ErrorLike[] }; -export type ScaffolderAuditLoggerOptions = { +export type AuditLoggerOptions = { logger: LoggerService; authService: AuthService; httpAuthService: HttpAuthService; @@ -95,9 +95,10 @@ export interface AuditLogger { getActorId(request?: Request): Promise; /** + * Generates the audit log details to place in the metadata argument of the logger * - * Generates an AuditLogDetails object containing non-message details of the audit log * Secrets in the request body field should be redacted by the user before passing in the request object + * @public */ createAuditLogDetails( options: AuditLogDetailsOptions,