Skip to content

feat: Add support for enterprise audit log streaming API#4035

Open
amreshh wants to merge 11 commits intogoogle:masterfrom
amreshh:master
Open

feat: Add support for enterprise audit log streaming API#4035
amreshh wants to merge 11 commits intogoogle:masterfrom
amreshh:master

Conversation

@amreshh
Copy link

@amreshh amreshh commented Feb 25, 2026

This PR implements the enterprise audit logs api (https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/audit-log?apiVersion=2022-11-28)

This includes:

  • enterprise_audit_log_stream.go: Implements crud operations for the audit log streaming endpoint
  • enterprise_audit_log_stream_test.go: Unit tests for audit_log_stream.go

Besides the api implementation, I also added examples/auditlogstream/main.go run a simple real world test for creating a audit log stream towards Azure Blob Storage.

Closes #3663

@google-cla
Copy link

google-cla bot commented Feb 25, 2026

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.

@amreshh amreshh force-pushed the master branch 2 times, most recently from 4881578 to c903947 Compare February 25, 2026 10:43
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. waiting for signed CLA labels Feb 25, 2026
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 36.55914% with 118 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.53%. Comparing base (a70ac77) to head (72a5150).

Files with missing lines Patch % Lines
example/auditlogstream/main.go 0.00% 90 Missing ⚠️
github/enterprise_audit_log_stream.go 70.83% 28 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amreshh amreshh force-pushed the master branch 2 times, most recently from 584acab to b4904a1 Compare February 26, 2026 10:08
Signed-off-by: amreshh <20923769+amreshh@users.noreply.github.com>
Copy link
Contributor

@alexandear alexandear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

amreshh and others added 2 commits February 26, 2026 16:29
- fixed linter issues where api docs were not correct in the comments
for audit log streams
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @amreshh!
One minor nit and a question, otherwise LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @alexandear

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 26, 2026

Also, @amreshh - if you could add unit tests to cover all the new New* methods, that would be great:

codecov-4035

amreshh and others added 5 commits February 26, 2026 22:06
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
- Added testcases for each vendor config
TestNewAzureHubStreamConfig
TestNewAmazonS3OIDCStreamConfig
TestNewAmazonAccessKeysStreamConfig
TestNewSplunkStreamConfig
TestNewHecStreamConfig
TestNewGoogleCloudStreamConfig
@amreshh
Copy link
Author

amreshh commented Feb 27, 2026

@gmlewis : Good catch about the test cases, added those as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for audit log stream APIs

3 participants