Skip to content

Commit e7e7149

Browse files
Add Permission, OldPermission to AuditEntry type (#2670)
Fixes: #2669.
1 parent b9cb801 commit e7e7149

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

github/github-accessors.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/orgs_audit_log.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ type AuditEntry struct {
6363
Message *string `json:"message,omitempty"`
6464
Name *string `json:"name,omitempty"`
6565
OldUser *string `json:"old_user,omitempty"`
66+
OldPermission *string `json:"old_permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`.
6667
OpenSSHPublicKey *string `json:"openssh_public_key,omitempty"`
6768
Org *string `json:"org,omitempty"`
69+
Permission *string `json:"permission,omitempty"` // The permission level for membership changes, for example `admin` or `read`.
6870
PreviousVisibility *string `json:"previous_visibility,omitempty"`
6971
ReadOnly *string `json:"read_only,omitempty"`
7072
Repo *string `json:"repo,omitempty"`

github/orgs_audit_log_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ func TestOrganizationService_GetAuditLog(t *testing.T) {
3434
"created_at": 1615077308538,
3535
"head_sha": "5acdeadbeef64d1a62388e901e5cdc9358644b37",
3636
"conclusion": "success",
37+
"old_permission": "read",
38+
"permission": "admin",
3739
"actor": "testactor",
3840
"completed_at": "2021-03-07T00:35:08.000Z",
3941
"@timestamp": 1615077308538,
@@ -80,7 +82,9 @@ func TestOrganizationService_GetAuditLog(t *testing.T) {
8082
HeadBranch: String("master"),
8183
HeadSHA: String("5acdeadbeef64d1a62388e901e5cdc9358644b37"),
8284
Name: String("Code scanning - action"),
85+
OldPermission: String("read"),
8386
Org: String("o"),
87+
Permission: String("admin"),
8488
Repo: String("o/blue-crayon-1"),
8589
StartedAt: &Timestamp{startedAt},
8690
WorkflowID: Int64(123456),
@@ -199,9 +203,11 @@ func TestAuditEntry_Marshal(t *testing.T) {
199203
LimitedAvailability: Bool(false),
200204
Message: String("m"),
201205
Name: String("n"),
206+
OldPermission: String("op"),
202207
OldUser: String("ou"),
203208
OpenSSHPublicKey: String("osshpk"),
204209
Org: String("o"),
210+
Permission: String("p"),
205211
PreviousVisibility: String("pv"),
206212
ReadOnly: String("ro"),
207213
Repo: String("r"),
@@ -268,9 +274,11 @@ func TestAuditEntry_Marshal(t *testing.T) {
268274
"limited_availability": false,
269275
"message": "m",
270276
"name": "n",
277+
"old_permission": "op",
271278
"old_user": "ou",
272279
"openssh_public_key": "osshpk",
273280
"org": "o",
281+
"permission": "p",
274282
"previous_visibility": "pv",
275283
"read_only": "ro",
276284
"repo": "r",

0 commit comments

Comments
 (0)