ozimakov opened a new pull request, #1438: URL: https://github.com/apache/syncope/pull/1438
[SYNCOPE-1978](https://issues.apache.org/jira/browse/SYNCOPE-1978) ### What Restores the ability to search audit events by the username that performed them. A new `who` query parameter on `AuditQuery` matches the `AuditEvent.who` column and supports: - exact match — `?who=jsmith` - multiple values, OR-ed — `?who=jsmith&who=admin` - `*` wildcards — `?who=svc-*` It composes (AND) with the existing audit search filters (`entityKey`, `type`, `category`, `op`, `outcome`, `before`/`after`). ### Why Syncope 3.0 allowed searching audit entries by username; 4.0 removed it. The capability is useful to retrieve all actions performed by a given user — in particular when that user has been deleted and the entity key is no longer available. ### Implementation The filter is threaded through `AuditServiceImpl` → `AuditLogic` → the `AuditEventDAO` interface and all of its implementations: JPA, Neo4j, Elasticsearch and OpenSearch. All values are bound as query parameters; wildcard handling escapes store metacharacters so that only `*` acts as a wildcard: - JPA: exact uses `=`, wildcard uses `LIKE ? ESCAPE '#'` (a backslash escape char is mishandled by MySQL/MariaDB and Oracle has no default escape, so `#` is used for portability); - Neo4j: exact uses `=`, wildcard uses `=~` with regex metacharacters escaped; - Elasticsearch / OpenSearch: a `wildcard` query per value, OR-ed via `bool`/`should`, escaping `\` and `?`. ### Tests New integration tests in `AuditITCase` cover exact match, multiple values (OR) and wildcard, composed with the other filters. Manually verified against the standalone (H2) distribution. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
