Merge pull request #26108 from backstage/rugvip/format

beps/event-auditor: format + switch to 0011
This commit is contained in:
Patrik Oldsberg
2024-08-21 09:20:56 +02:00
committed by GitHub
@@ -115,12 +115,16 @@ export type AuditEventFailureStatus<E = ErrorLike> = {
errors: E[];
};
export type AuditEventStatus = AuditEventSuccessStatus | AuditEventFailureStatus | undefined;
export type AuditEventStatus =
| AuditEventSuccessStatus
| AuditEventFailureStatus
| undefined;
```
#### EventAuditor Interface
This interface defines the functionalities of an `EventAuditor` class. This class provides methods for:
- Extracting the actor ID from an Express request (if available).
- Creating detailed audit event information based on provided options.
- Logging an audit event with a specific level (info, debug, warn, or error).
@@ -139,7 +143,7 @@ export type AuditEventOptions = AuditEventStatus & {
metadata?: JsonValue;
response?: AuditResponse;
request?: Request;
} & ({ actorId: string; } | { credentials: BackstageCredentials } | undefined);
} & ({ actorId: string } | { credentials: BackstageCredentials } | undefined);
export type AuditEvent = {
actor: ActorDetails;