specs/auditor-v1.yaml
openapi: 3.0.3
info:
description: >-
Auditor-v1 api. Refer [here](//todo) for more information
version: 1.0.0
title: Auditor-v1
contact:
email: lowesopensource@lowes.com
name: Lowe's Companies, Inc.
tags: []
paths:
/logs:
post:
tags:
- Logs
summary: Filter logs by request body parameters
description: 'Fetch audit logs by request body parameters'
operationId: Fetch audit logs
parameters:
- name: X-Application-Name
in: header
description: application name that is calling the auditor api
required: true
explode: true
schema:
type: string
deprecated: false
- name: X-Request-Id
in: header
description: Unique request id tied to request
schema:
type: string
format: uuid
required: true
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuditEventLogRequest'
responses:
'200':
description: Fetches and displays the audit event log
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AuditEventLogResponse'
'400':
description: Bad request error like REQUEST_VALIDATION_ERROR
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'424':
description: Dependent service error like INFRASTRUCTURE_ERROR
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Internal server error like UNHANDLED_ERROR
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
externalDocs:
url: '//todo'
components:
schemas:
AuditEventLogRequest:
type: object
properties:
id:
$ref: '#/components/schemas/EventIdRequest'
applicationName:
$ref: '#/components/schemas/SourceApplicationNameRequest'
timestamp:
$ref: '#/components/schemas/EventTimeStampRequest'
type:
$ref: '#/components/schemas/EventTypeRequest'
subType:
$ref: '#/components/schemas/EventSubTypeRequest'
source:
$ref: '#/components/schemas/EventSourceRequest'
metadata:
$ref: '#/components/schemas/EventMetadataRequest'
required:
- id
- applicationName
- timestamp
- type
- source
AuditEventLogResponse:
type: object
properties:
id:
$ref: '#/components/schemas/EventIdResponse'
applicationName:
$ref: '#/components/schemas/SourceApplicationNameResponse'
timestamp:
$ref: '#/components/schemas/EventTimeStampResponse'
type:
$ref: '#/components/schemas/EventTypeResponse'
subType:
$ref: '#/components/schemas/EventSubTypeResponse'
source:
$ref: '#/components/schemas/EventSourceResponse'
metadata:
$ref: '#/components/schemas/EventMetadataResponse'
elements:
$ref: '#/components/schemas/ElementsResponse'
log:
$ref: '#/components/schemas/EvenLogResponse'
required:
- id
- applicationName
- timestamp
- type
- source
EventIdRequest:
$ref: '#/components/schemas/EventId'
SourceApplicationNameRequest:
$ref: '#/components/schemas/SourceApplicationName'
EventTimeStampRequest:
$ref: '#/components/schemas/EventTimeStamp'
EventTypeRequest:
$ref: '#/components/schemas/EventType'
EventSubTypeRequest:
$ref: '#/components/schemas/EventSubType'
EventSourceRequest:
$ref: '#/components/schemas/EventSource'
EventSourceMetadataRequest:
$ref: '#/components/schemas/EventSourceMetadata'
EventMetadataRequest:
$ref: '#/components/schemas/EventMetadata'
EventIdResponse:
$ref: '#/components/schemas/EventId'
SourceApplicationNameResponse:
$ref: '#/components/schemas/SourceApplicationName'
EventTimeStampResponse:
$ref: '#/components/schemas/EventTimeStamp'
EventTypeResponse:
$ref: '#/components/schemas/EventType'
EventSubTypeResponse:
$ref: '#/components/schemas/EventSubType'
EventSourceResponse:
$ref: '#/components/schemas/EventSource'
EventMetadataResponse:
$ref: '#/components/schemas/EventMetadata'
ElementsResponse:
$ref: '#/components/schemas/Elements'
EvenLogResponse:
$ref: '#/components/schemas/EventLog'
EventId:
type: string
format: uuid
description: Transaction ID of the audit event
SourceApplicationName:
type: string
description: Name of the Application generating the audit event
EventTimeStamp:
type: string
format: date-time
description: UTC timestamp of the audit event
EventType:
type: string
description: Type of the audit event
enum:
- CREATED
- UPDATED
- DELETED
default: UPDATED
EventSubType:
type: string
description: subtype of the audit event, a free form field. Additional type metadata that can be used to query the specific the event.
EventSource:
type: object
description: Details of the source who created the event.
properties:
type:
$ref: '#/components/schemas/EventSourceType'
metadata:
$ref: '#/components/schemas/EventSourceMetadata'
required:
- type
EventSourceType:
type: string
description: Source type of the audit event
enum:
- SYSTEM
- USER
EventSourceMetadata:
type: object
description: a map of the metadata describing source of the event
properties:
id:
type: string
description: id of the system/user causing the event (if available)
email:
type: string
description: email of the sysem/user causing the event (if available)
name:
type: string
description: name of the system/user causing the event (if available)
EventMetadata:
type: object
description: a free form map of the event metadata
additionalProperties:
type: string
Elements:
type: array
description: an array containing all elements constituting the audit event
items:
$ref: '#/components/schemas/Element'
Element:
type: object
description: Each individual element constituting the audit event
properties:
name:
type: string
description: Name of the element (attribute/items) that is created/updated/deleted
updatedValue:
type: string
description: new value of the element (if available)
previousValue:
type: string
description: old value of the element (if available)
metadata:
$ref: '#/components/schemas/ElementMetadata'
ElementMetadata:
type: object
description: a map of the metadata describing element.
properties:
fqdn:
type: string
description: fully qualified domain name of the attribute/item containing domain and subdomain, separated by a dot.
identifiers:
$ref: '#/components/schemas/ElementIdentifiers'
ElementIdentifiers:
type: object
description: free form map to uniquely identify each domain under which the attribute/item belongs.
additionalProperties:
type: string
EventLog:
type: string
description: Captures the textual representation of the entity being logged
Error:
type: object
properties:
code:
type: string
description: 'All possible Error codes'
enum:
- REQUEST_VALIDATION_ERROR
- UNAUTHORIZED_ERROR
- INFRASTRUCTURE_ERROR
- UNHANDLED_ERROR
default:
UNHANDLED_ERROR
message:
type: string
description: 'Human readable error message'
errors:
type: array
description: 'All possible Errors/Exception that led to the given error'
items:
type: object
properties:
reason:
type: string
description: 'All possible reason for each error'
enum:
- REQUIRED_FIELD
- INVALID_FORMAT
element:
type: string
description: 'An option element for each error, like field name for REQUEST_VALIDATION_ERROR'
message:
type: string
description: 'Human readable error message'
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-Application-Key
security:
- ApiKeyAuth: []