Added validation for gcp destinations
What does this MR do and why?
Added validation of google cloud logging audit event streaming destinations in newly created consolidated external audit event destinations.
The changes are similar to !150669 (merged) for http destinations.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- You need to have a group, let's say
twitter
and Gitlab instance with Ultimate license. - Go to http://gitlab.localdev:3000/-/graphql-explorer and run following mutations and queries.
- First let's try to create a group level destination with category gcp by running following mutation, it will create the destination successfully:
mutation groupAuditEventStreamingDestinationsCreate {
groupAuditEventStreamingDestinationsCreate(input: {
name: "gcp_dest",
category: "gcp",
groupPath: "twitter",
secretToken: "random_secret_token123"
config: {
googleProjectIdName: "project-id",
clientEmail: "abcd@example.com",
logIdName: "audit-events"
}
}) {
errors
externalAuditEventDestination {
id
name
config
category
}
}
}
- The output will be something like following and there should not be any errors:
{
"data": {
"groupAuditEventStreamingDestinationsCreate": {
"errors": [],
"externalAuditEventDestination": {
"id": "gid://gitlab/AuditEvents::Group::ExternalStreamingDestination/10",
"name": "gcp_dest",
"config": {
"googleProjectIdName": "project-id",
"clientEmail": "abcd@example.com",
"logIdName": "audit-events"
},
"category": "gcp"
}
}
}
}
-
If you try to create a destination with same mutation params in step 3, then you will get following errors:
{ "data": { "groupAuditEventStreamingDestinationsCreate": { "errors": [ "Config logIdName is already taken.", "Name has already been taken" ], "externalAuditEventDestination": null } } }
Related to #436608 (closed)
Edited by Hitesh Raghuvanshi