Skip to content

Commit

Permalink
Fixing tests and adding username to message
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-buttner committed Apr 5, 2021
1 parent 32242b2 commit 4b4691b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/cases/server/authorization/audit_logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class AuthorizationAuditLogger {
* `Unauthorized to create case with "securitySolution" as the owner`
* `Unauthorized to find cases of any owner`.
*/
return `${result} to ${operation.verbs.present} ${owner} ${operation.docType} ${ownerMsg}`;
return `${result} to ${operation.verbs.present} ${operation.docType} ${ownerMsg}`;
}

private logSuccessEvent({
Expand All @@ -48,7 +48,7 @@ export class AuthorizationAuditLogger {
username?: string;
}) {
this.auditLogger?.log({
message,
message: `${username ?? 'unknown user'} ${message}`,
event: {
action: operation.action,
category: EventCategory.DATABASE,
Expand Down Expand Up @@ -78,7 +78,7 @@ export class AuthorizationAuditLogger {
operation,
});
this.auditLogger?.log({
message,
message: `${username ?? 'unknown user'} ${message}`,
event: {
action: operation.action,
category: EventCategory.DATABASE,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe(`cases`, () => {

expect(casesFeaturePrivilege.getActions(privilege, feature)).toMatchInlineSnapshot(`
Array [
"cases:1.0.0-zeta1:observability/get",
"cases:1.0.0-zeta1:observability/find",
"cases:1.0.0-zeta1:observability/getCase",
"cases:1.0.0-zeta1:observability/findCases",
]
`);
});
Expand Down Expand Up @@ -105,11 +105,11 @@ describe(`cases`, () => {

expect(casesFeaturePrivilege.getActions(privilege, feature)).toMatchInlineSnapshot(`
Array [
"cases:1.0.0-zeta1:security/get",
"cases:1.0.0-zeta1:security/find",
"cases:1.0.0-zeta1:security/create",
"cases:1.0.0-zeta1:security/delete",
"cases:1.0.0-zeta1:security/update",
"cases:1.0.0-zeta1:security/getCase",
"cases:1.0.0-zeta1:security/findCases",
"cases:1.0.0-zeta1:security/createCase",
"cases:1.0.0-zeta1:security/deleteCase",
"cases:1.0.0-zeta1:security/updateCase",
]
`);
});
Expand Down Expand Up @@ -144,13 +144,13 @@ describe(`cases`, () => {

expect(casesFeaturePrivilege.getActions(privilege, feature)).toMatchInlineSnapshot(`
Array [
"cases:1.0.0-zeta1:security/get",
"cases:1.0.0-zeta1:security/find",
"cases:1.0.0-zeta1:security/create",
"cases:1.0.0-zeta1:security/delete",
"cases:1.0.0-zeta1:security/update",
"cases:1.0.0-zeta1:obs/get",
"cases:1.0.0-zeta1:obs/find",
"cases:1.0.0-zeta1:security/getCase",
"cases:1.0.0-zeta1:security/findCases",
"cases:1.0.0-zeta1:security/createCase",
"cases:1.0.0-zeta1:security/deleteCase",
"cases:1.0.0-zeta1:security/updateCase",
"cases:1.0.0-zeta1:obs/getCase",
"cases:1.0.0-zeta1:obs/findCases",
]
`);
});
Expand Down Expand Up @@ -185,20 +185,20 @@ describe(`cases`, () => {

expect(casesFeaturePrivilege.getActions(privilege, feature)).toMatchInlineSnapshot(`
Array [
"cases:1.0.0-zeta1:security/get",
"cases:1.0.0-zeta1:security/find",
"cases:1.0.0-zeta1:security/create",
"cases:1.0.0-zeta1:security/delete",
"cases:1.0.0-zeta1:security/update",
"cases:1.0.0-zeta1:other-security/get",
"cases:1.0.0-zeta1:other-security/find",
"cases:1.0.0-zeta1:other-security/create",
"cases:1.0.0-zeta1:other-security/delete",
"cases:1.0.0-zeta1:other-security/update",
"cases:1.0.0-zeta1:obs/get",
"cases:1.0.0-zeta1:obs/find",
"cases:1.0.0-zeta1:other-obs/get",
"cases:1.0.0-zeta1:other-obs/find",
"cases:1.0.0-zeta1:security/getCase",
"cases:1.0.0-zeta1:security/findCases",
"cases:1.0.0-zeta1:security/createCase",
"cases:1.0.0-zeta1:security/deleteCase",
"cases:1.0.0-zeta1:security/updateCase",
"cases:1.0.0-zeta1:other-security/getCase",
"cases:1.0.0-zeta1:other-security/findCases",
"cases:1.0.0-zeta1:other-security/createCase",
"cases:1.0.0-zeta1:other-security/deleteCase",
"cases:1.0.0-zeta1:other-security/updateCase",
"cases:1.0.0-zeta1:obs/getCase",
"cases:1.0.0-zeta1:obs/findCases",
"cases:1.0.0-zeta1:other-obs/getCase",
"cases:1.0.0-zeta1:other-obs/findCases",
]
`);
});
Expand Down

0 comments on commit 4b4691b

Please sign in to comment.