Skip to content

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

Merged
colinsim1 merged 8 commits intocolinsim1:masterfrom
amreshh:master
Feb 23, 2026
Merged

feat: Add support for enterprise audit log streaming API#1
colinsim1 merged 8 commits intocolinsim1:masterfrom
amreshh:master

Conversation

@amreshh
Copy link

@amreshh amreshh commented Feb 23, 2026

Pull Request Description: Add Support for Enterprise Audit Log Streaming API

Closes google#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

  • Added AuditLogStream struct to represent a stream configuration returned by the API.
  • Added AuditLogStreamConfig struct for creating and updating streams.
  • Added AuditLogStreamKey struct for the public encryption key.
  • Added AuditLogStreamVendorConfig marker interface for compile-time type
    safety on vendor-specific configurations.
  • Added vendor-specific config structs: AzureBlobConfig, AzureHubConfig,
    AmazonS3OIDCConfig, AmazonS3AccessKeysConfig, SplunkConfig, HecConfig,
    GoogleCloudConfig, and DatadogConfig.
  • Added New*StreamConfig constructor helpers for all 8 vendors.

Audit Log Streaming ([EnterpriseService])

Added the following methods to [EnterpriseService]:

  • [GetAuditLogStreamKey]: GET /enterprises/{enterprise}/audit-log/stream-key
  • [ListAuditLogStreams]: GET /enterprises/{enterprise}/audit-log/streams
  • [GetAuditLogStream]: GET /enterprises/{enterprise}/audit-log/streams/{stream_id}
  • [CreateAuditLogStream]: POST /enterprises/{enterprise}/audit-log/streams
  • [UpdateAuditLogStream]: PATCH /enterprises/{enterprise}/audit-log/streams/{stream_id}
  • [DeleteAuditLogStream]: DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}

Verification Plan

Automated Tests

  • Added github/enterprise_audit_log_streaming_test.go with unit tests for all
    methods and constructor helpers.

All tests passed:

go test -v ./github -run 'TestEnterpriseService_.*AuditLogStream'

Examples

  • Added example/auditlogstream/ — creates and deletes an Azure Blob Storage stream.

Example reads GITHUB_API_URL and GITHUB_AUTH_TOKEN from the environment
and handles sealed-box encryption of credentials using the key returned by GetAuditLogStreamKey.

@colinsim1 colinsim1 merged commit c6c50e4 into colinsim1:master Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for audit log stream APIs

2 participants