diff --git a/nerm/openapi.yaml b/nerm/openapi.yaml index d461ac3d..e1058e5d 100644 --- a/nerm/openapi.yaml +++ b/nerm/openapi.yaml @@ -14,6 +14,9 @@ servers: description: Tenant name assigned to customer paths: +# Audit Events + /audit_events/query: + $ref: "./paths/audit_events.yaml" # Users /user: $ref: "./paths/user.yaml" diff --git a/nerm/paths/audit_events.yaml b/nerm/paths/audit_events.yaml new file mode 100644 index 00000000..9afff808 --- /dev/null +++ b/nerm/paths/audit_events.yaml @@ -0,0 +1,15 @@ +post: + summary: Query for Audit events + description: This endpoint provides a search engine for Audit Events by optionally combining entity_type, type, and subject_id to narrow down the audit events. An Entity Type of Profile links up to the AuditableProfile types. An Entity Type of WorkflowSession links up to the AuditableWorkflow types. An Entity Type of Get/Post/Patch/Delete links up to the AuditableApi types. The remaining Entity Types link up to the ActiveRecord types (configuration changes). + operationId: search + tags: + - audits + requestBody: + $ref: "../requestBodies/POST/AuditEvents.yaml" + responses: + "200": + $ref: "../responses/AuditEvents.yaml" + "400": + $ref: "../responses/400.yaml" + "500": + $ref: "../responses/500.yaml" diff --git a/nerm/requestBodies/POST/AuditEvents.yaml b/nerm/requestBodies/POST/AuditEvents.yaml new file mode 100644 index 00000000..df511b2d --- /dev/null +++ b/nerm/requestBodies/POST/AuditEvents.yaml @@ -0,0 +1,29 @@ +required: true +content: + application/json: + schema: + type: object + properties: + offset: + description: The page of pagination for these events. + type: integer + format: int32 + example: 1 + sort_by: + description: A column that we are sorting these records from. + type: string + example: created_at + limit: + description: The limiting count for the amount of records returned. + type: integer + example: 1 + format: int32 + order: + description: Which direction the list should be sorted by + type: string + enum: [asc, desc] + example: "asc" + filters: + type: array + items: + $ref: "../../schemas/POST/AuditEvent.yaml" diff --git a/nerm/responses/AuditEvent.yaml b/nerm/responses/AuditEvent.yaml new file mode 100644 index 00000000..bfb6acda --- /dev/null +++ b/nerm/responses/AuditEvent.yaml @@ -0,0 +1,22 @@ +type: Object +properties: + id: + type: string + type: + type: string + tenant_id: + type: string + created_at: + type: string + authority: + type: string + subject_id: + type: string + subject_type: + type: string + performer_id: + type: string + performer_type: + type: string + data: + type: Object diff --git a/nerm/responses/AuditEvents.yaml b/nerm/responses/AuditEvents.yaml new file mode 100644 index 00000000..d26f9267 --- /dev/null +++ b/nerm/responses/AuditEvents.yaml @@ -0,0 +1,10 @@ +description: AuditEvents +content: + application/json: + schema: + type: object + properties: + audit_events: + type: Array + items: + $ref: '../schemas/POST/AuditEvent.yaml' diff --git a/nerm/schemas/POST/AuditEvent.yaml b/nerm/schemas/POST/AuditEvent.yaml new file mode 100644 index 00000000..2d0f7782 --- /dev/null +++ b/nerm/schemas/POST/AuditEvent.yaml @@ -0,0 +1,20 @@ +type: object +properties: + entity_type: + description: Categorization of audit event. + type: string + enum: [Profile, WorkflowSession, Email, FormAttributeForm, FormAttribute, Form, IdproxyPermission, NeAttributeOption, NeAttribute, Notification, Page, Permission, PortalRegistrationWorkflow, Portal, ProfileTypeRole, ProfileType, RoleProfile, NeprofileRole, NeaccessRole, IdproxyRole, SecurityQuestion, UserManager, UserProfile, UserRole, User, Validation, VerificationEmail, WorkflowAction, CreateWorkflow, UpdateWorkflow, AutomatedWorkflow, BatchWorkflow, ExpirationWorkflow, InvitationWorkflow, LoginWorkflow, PasswordResetWorkflow, RegistrationWorkflow, Get, Post, Patch, Delete] + example: Profile + type: + description: The type of audit event + type: string + enum: [AuditableProfileCreate, AuditableProfileUpdate, AuditableProfileDestroy, AuditableBulkProfileUpdate, AuditableProfileContributorAdd, AuditableProfileContributorRemove, AuditableProfileContributorRoleAdd, AuditableProfileContributorRoleRemove, AuditableProfileOwnerUpdate, AuditableProfileWorkflowEvent, AuditableWorkflowActionSkippedEvent, AuditableWorkflowApprovedEvent, AuditableWorkflowApprovedEvent, AuditableWorkflowAssignedEvent, AuditableWorkflowAutoAssignedEvent, AuditableWorkflowBatchCompleteEvent, AuditableWorkflowClosedEvent, AuditableWorkflowDuplicateCheckStartEvent, AuditableWorkflowDuplicateResolutionEvent, AuditableWorkflowFailedEvent, AuditableWorkflowIdentityProofedEvent, AuditableWorkflowInvitationSentEvent, AuditableWorkflowLdapProvidedEvent, AuditableWorkflowNotificationSentEvent, AuditableWorkflowPendingApprovalEvent, AuditableWorkflowPendingAssignmentEvent, AuditableWorkflowPendingFulfillmentEvent, AuditableWorkflowFulfilledEvent, AuditableWorkflowPendingIdentityProofEvent, AuditableWorkflowPendingLdapEvent, AuditableWorkflowPendingRequestEvent, AuditableWorkflowPendingReviewEvent, AuditableWorkflowProfileCreatedEvent, AuditableWorkflowProfileSelectEvent, AuditableWorkflowProfileUpdatedEvent, AuditableWorkflowRejectedEvent, AuditableWorkflowRequestMadeEvent, AuditableWorkflowRestApiEvent, AuditableWorkflowReviewedEvent, AuditableWorkflowRunningWorkflowEvent, AuditableWorkflowSoapApiEvent, AuditableWorkflowStatusChangedEvent, AuditableWorkflowStoredProcedureEvent, AuditableWorkflowUnassignEvent, AuditableWorkflowWaitingForWorkflowEvent, AuditableWorkflowWorkflowChangedEvent, ActiveRecordCreate, ActiveRecordUpdate, ActiveRecordDestroy, AuditableApiEvent] + example: AuditableProfileCreate + subject_id: + description: Identifier of the subject + type: string + format: uuid + example: 7d8c53ca-e99d-485c-9524-ea3849e82c79 + + +