-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing fields to AuditEntry #2786
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @patriknordlen!
Just a few tweaks, please, then we will be ready to merge.
@@ -29,69 +29,96 @@ type HookConfig struct { | |||
Secret *string `json:"secret,omitempty"` | |||
} | |||
|
|||
type ActorLocation struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add godoc-style comments to each new exported struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
Co-authored-by: Glenn Lewis <[email protected]>
Please make sure to run |
Resolving type-related issues in tests now. |
Almost there... please update your unit tests so that "go test ./..." passes on your local system, then push the changes. |
Codecov Report
@@ Coverage Diff @@
## master #2786 +/- ##
=======================================
Coverage 98.06% 98.06%
=======================================
Files 132 132
Lines 11650 11650
=======================================
Hits 11424 11424
Misses 154 154
Partials 72 72
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @patriknordlen !
LGTM.
Merging after tests pass.
Fixes: #2785.
Adds the following fields to the
AuditEntry
struct and populates them when they exist in a response from the API:ActorIP
- IP of actor (if enabled in GitHub audit logs)ActorLocation
- location of actor (country code etc)HashedToken
- hashed token identifier when an action is performed using an access tokenJobWorkflowRef
- reference to workflow job when a workflow runsOAuthApplicationID
- OAuth application identifier when an OAuth application performs an actionOrgID
- organization numeric IDProgrammaticAccessType
- type of programmatic access (i.e. via token, cli, oauth app...)PullRequestID
- self-explanatoryPullRequestTitle
- self-explanatoryPullRequestURL
- self-explanatoryReasons
- Used when a user overrides branch protection, includes info on user's stated reason whyRunNumber
- the numerical ID of the workflow runTokenID
- token ID when an action is performed using an access tokenTokenScopes
- string containing scopes assigned to a tokenTopic
- topic used in workflow runsUserAgent
- user-agent used in performing an action