Api Dto Audit
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
Api Dto Audit defines the GraphQL input boundary for querying tenant-scoped audit logs in the OpenFrame API service. The module is supplied by the OpenFrame OSS Library artifact com.openframe.oss:openframe-api-service-core at version 7.0.11 and is assembled into this repository's openframe-api service.
It deliberately contains only request-shaping types. Query execution, tenant isolation, storage access, pagination, and audit-event projection remain outside this module.
| Component | Responsibility |
|---|---|
LogFilterInput |
Accepts optional date, timestamp, categorical, organization, and device constraints for audit-log queries. |
LogSortField |
Exposes the API-level sortable field set. Currently, timestamp is the only supported field. |
LogSortInput |
Pairs a supported log sort field with the shared ascending or descending direction. |
flowchart LR
GraphQLClient["GraphQL Client"] -->|"filter and sort arguments"| LogDataFetcher["Log Data Fetcher"]
LogDataFetcher -->|"LogFilterInput"| GraphQLLogMapper["GraphQL Log Mapper"]
LogDataFetcher -->|"LogSortInput"| GraphQLLogMapper
GraphQLLogMapper -->|"LogFilterCriteria and SortInput"| LogService["Log Service"]
LogService -->|"tenant-scoped query"| PinotStore["Pinot Log Repository"]
PinotStore -->|"audit events"| LogService
LogService -->|"connection result"| LogDataFetcher
LogDataFetcher -->|"paginated response"| GraphQLClient
The data fetcher accepts filter and sort arguments for the logs query, converts them through GraphQLLogMapper, and delegates to the audit log service. The mapper preserves every filter field and translates TIMESTAMP into the storage-facing eventTimestamp sort field. If no sort input or field is supplied, the service uses its default ordering; if a direction is omitted, the service defaults to descending order.
LogFilterInput is a Lombok data class with a builder and no-argument and all-argument constructors. Every field is optional, allowing clients to progressively narrow a query.
| Field | Type | Query scope |
|---|---|---|
startDate |
LocalDate |
Beginning of a date-based interval. |
endDate |
LocalDate |
End of a date-based interval. |
timestampFrom |
Instant |
Inclusive lower bound for event timestamps. |
timestampTo |
Instant |
Upper bound for event timestamps. |
eventTypes |
List<String> |
Event categories to include. |
toolTypes |
List<String> |
Producing tool categories to include. |
severities |
List<String> |
Severity values to include. |
organizationIds |
List<String> |
Organization identifiers to include. |
deviceId |
String |
A single device identifier to include. |
Date fields and timestamp fields are both forwarded unchanged to the service-layer criteria object. This module does not define precedence, mutual exclusivity, or range validation between those pairs; consumers should therefore provide internally consistent intervals.
The same filter shape is also accepted by the logFilters query. That operation returns available tool-type, event-type, severity, and organization options constrained by the supplied filter, enabling clients to build dependent filter controls.
LogSortInput carries two values:
field is a LogSortField. The current public choice is TIMESTAMP.direction is the shared SortDirection enum from the OpenFrame API Library, with ASC and DESC values.The API intentionally exposes a typed enum rather than a raw storage column name. GraphQLLogMapper maps TIMESTAMP to eventTimestamp, and the log service validates the resulting storage field before issuing the repository query. Adding a new public sortable field requires corresponding mapper and repository support, not only a new enum constant.
sequenceDiagram
participant Client as "GraphQL Client"
participant Fetcher as "Log Data Fetcher"
participant Mapper as "GraphQL Log Mapper"
participant Service as "Log Service"
participant Store as "Pinot Log Repository"
Client->>Fetcher: logs(filter, cursor arguments, search, sort)
Fetcher->>Mapper: Convert filter and sort
Mapper->>Fetcher: Criteria, pagination, storage sort
Fetcher->>Service: Query tenant audit logs
Service->>Store: Find or search matching log events
Store->>Service: Events and page boundary item
Service->>Fetcher: Connection result
Fetcher->>Client: Edges, cursors, page information
The logs operation also accepts cursor pagination and an optional search term, but those are separate arguments rather than fields of Api Dto Audit. The service requests one item beyond the requested limit to determine whether a next page exists. Event cursors are based on the event timestamp and tool event identifier.
LogDataFetcher conditionally activates when openframe.tool-events.store is configured. It exposes logs, logFilters, and a separate logDetails lookup.GraphQLLogMapper turns these public DTOs into the library's LogFilterCriteria and generic SortInput types.LogService obtains the current tenant identifier before querying its Pinot-backed repository. The DTO's organizationIds restrict results inside that tenant context; it does not establish tenant identity.LogFilterInput and the service-layer filter criteria when adding or removing a filter field.LogSortField as a cross-layer change: extend the GraphQL mapper and ensure the repository recognizes the mapped column as sortable.