Added active param to create streaming headers API
What does this MR do and why?
- Added
active
param to audit event streaming headers create API. - The param is by default
true
so that the change will be consistent with the existing functionality. - This param is true will activate the header to be streamed else it will be deactivated and will not be used while streaming audit event to the custom http streaming destination.
How to set up and validate locally
For Instance level streaming headers:
- Create a new instance level http audit event streaming destination by following steps in https://docs.gitlab.com/ee/administration/audit_event_streaming/#add-a-new-http-destination-1.
- Create a new header for this destination by running the following mutation in https://gitlab.localdev:3000/-/graphql-explorer.
mutation auditEventsStreamingInstanceHeadersCreate {
auditEventsStreamingInstanceHeadersCreate(input:
{
destinationId: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/<id>",
key: "foo",
value: "bar",
active: false
}) {
errors
header {
id
key
value
active
}
}
}
- Also try to create a header without passing
active
, by default its value istrue
. - List all the headers for the destinations by running following query, the value of
active
param should be as provided at time of creation.
query instanceExternalAuditEventDestinations {
instanceExternalAuditEventDestinations {
nodes {
id
name
destinationUrl
verificationToken
headers {
nodes {
id
key
value
active
}
}
eventTypeFilters
}
}
}
Group level streaming headers
- Create a new http streaming destination for a group by following steps in https://docs.gitlab.com/ee/administration/audit_event_streaming/graphql_api.html#add-a-new-streaming-destination.
- List all streaming destinations for the group by running https://docs.gitlab.com/ee/administration/audit_event_streaming/graphql_api.html#list-streaming-destinations in graphql explorer.
- Then create a new header for the destination by running following mutation
mutation auditEventsStreamingHeadersCreate {
auditEventsStreamingHeadersCreate(input: { destinationId: "gid://gitlab/AuditEvents::ExternalAuditEventDestination/33",
key: "foo",
value: "bar",
active: false
}) {
errors
header {
id
key
value
active
}
}
}
- Also create a header without passing
active
param, default value for it istrue
. - List down all the headers for the destinations for group by following step 2 and the
active
param should match with the provided ones.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #367509 (closed)
Edited by Hitesh Raghuvanshi