feature (events/audit): Add auth info to audit events (#1644)

This commit is contained in:
Jim authored and GitHub committed 2021-10-28 21:14:39 -04:00
1 parent c9a189a18e
commit 8ae6e9892f
10 files changed
+205 -30

No files matched your search

+1 -1
View File
@@ -662,7 +662,7 @@ func Test_WriteAudit(t *testing.T) {
AuthAccountId: "test_auth_account_id",
},
GrantsInfo: &event.GrantsInfo{
Grants: []event.GrantsPair{
Grants: []event.Grant{
{
Grant: "test_grant",
ScopeId: "test_grant_scope_id",
+9 -7
View File
@@ -25,20 +25,22 @@ type UserInfo struct {
}
type GrantsInfo struct {
Grants []GrantsPair `json:"grants_pair,omitempty"`
Grants []Grant `json:"grants,omitempty"`
}
type GrantsPair struct {
type Grant struct {
Grant string `json:"grant,omitempty" class:"public"`
ScopeId string `json:"scope_id,omitempty" class:"public"`
RoleId string `json:"role_id,omitempty" class:"public"`
}
type Auth struct {
AuthTokenId string `json:"auth_token_id" class:"public"`
UserInfo *UserInfo `json:"user_info,omitempty"` // boundary field
GrantsInfo *GrantsInfo `json:"grants_info,omitempty"`
UserEmail string `json:"email,omitempty" class:"sensitive"`
UserName string `json:"name,omitempty" class:"sensitive"`
DisabledAuthEntirely *bool `json:"disabled_auth_entirely,omitempty" class:"public"`
AuthTokenId string `json:"auth_token_id" class:"public"`
UserInfo *UserInfo `json:"user_info,omitempty"` // boundary field
GrantsInfo *GrantsInfo `json:"grants_info,omitempty"`
UserEmail string `json:"email,omitempty" class:"sensitive"`
UserName string `json:"name,omitempty" class:"sensitive"`
}
type Request struct {