feat: Add support for enterprise audit log streaming API#4035
feat: Add support for enterprise audit log streaming API#4035amreshh wants to merge 3 commits intogoogle:masterfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
4881578 to
c903947
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4035 +/- ##
==========================================
- Coverage 94.08% 93.53% -0.56%
==========================================
Files 207 209 +2
Lines 19217 19403 +186
==========================================
+ Hits 18081 18149 +68
- Misses 938 1056 +118
Partials 198 198 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
584acab to
b4904a1
Compare
Signed-off-by: amreshh <[email protected]>
…i operations updated
alexandear
left a comment
There was a problem hiding this comment.
Is it possible to tidy up the PR's description? See https://github.com/google/go-github/blob/master/CONTRIBUTING.md#tips for tips.
The verification plan is not complete. You need to run ./script/lint.sh and ./script/test.sh according to https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch
Pull Request Description: Add Support for Enterprise Audit Log Streaming API
Closes #3663
Summary
This PR adds support for the GitHub Enterprise audit log streaming REST API,
allowing users to programmatically manage audit log stream configurations for
enterprises. This includes retrieving the public encryption key, listing,
retrieving, creating, updating, and deleting stream configurations across all
supported vendors.
Changes
Data Structures
AuditLogStreamstruct to represent a stream configuration returned by the API.AuditLogStreamConfigstruct for creating and updating streams.AuditLogStreamKeystruct for the public encryption key.AuditLogStreamVendorConfigmarker interface for compile-time typesafety on vendor-specific configurations.
AzureBlobConfig,AzureHubConfig,AmazonS3OIDCConfig,AmazonS3AccessKeysConfig,SplunkConfig,HecConfig,GoogleCloudConfig, andDatadogConfig.New*StreamConfigconstructor helpers for all 8 vendors.Audit Log Streaming ([EnterpriseService])
Added the following methods to [EnterpriseService]:
GET /enterprises/{enterprise}/audit-log/stream-keyGET /enterprises/{enterprise}/audit-log/streamsGET /enterprises/{enterprise}/audit-log/streams/{stream_id}POST /enterprises/{enterprise}/audit-log/streamsPATCH /enterprises/{enterprise}/audit-log/streams/{stream_id}DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}Verification Plan
Automated Tests
github/enterprise_audit_log_streaming_test.gowith unit tests for allmethods and constructor helpers.
All tests passed:
Examples
example/auditlogstream/— creates and deletes an Azure Blob Storage stream.Example reads
GITHUB_API_URLandGITHUB_AUTH_TOKENfrom the environmentand handles sealed-box encryption of credentials using the key returned by
GetAuditLogStreamKey.