Skip to content

Commit

Permalink
audit log delegation-admin webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
GunnlaugurG committed Oct 9, 2024
1 parent 68290a6 commit 6449052
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class DelegationAdminController {
@BypassAuth()
@UseGuards(new ZendeskAuthGuard(env.zendeskGeneralMandateWebhookSecret))
@Post('/zendesk')
@Audit<{ id: string }>({ resources: (body) => body.id })
@Documentation({
response: { status: 200 },
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class DelegationIndexController {
{
auth: auth,
action: 'createOrUpdateDelegationIndexItem',
namespace,
resources: delegationIndexId,
meta: {
...parsedDelegationInfo,
Expand Down Expand Up @@ -123,6 +124,7 @@ export class DelegationIndexController {
await this.auditService.auditPromise(
{
auth: auth,
namespace,
action: 'removeDelegationIndexItem',
resources: delegationIndexId,
meta: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ export class DelegationsIndexService {
const [updatedDelegation] = await this.auditService.auditPromise(
{
auth,
action:
'@island.is/auth/delegation-index/create-or-update-delegation-record',
action: 'create-or-update-delegation-record',
namespace: '@island.is/auth/delegation-index',
resources: delegation.toNationalId,
alsoLog: true,
meta: {
Expand All @@ -334,7 +334,8 @@ export class DelegationsIndexService {
await this.auditService.auditPromise(
{
auth,
action: '@island.is/auth/delegation-index/remove-delegation-record',
action: 'remove-delegation-record',
namespace: '@island.is/auth/delegation-index',
resources: delegation.toNationalId,
alsoLog: true,
meta: {
Expand Down Expand Up @@ -438,7 +439,8 @@ export class DelegationsIndexService {
// is the common place to audit updates in the index.
this.auditService.audit({
auth,
action: '@island.is/auth/delegation-index/save-to-index',
action: 'save-to-index',
namespace: '@island.is/auth/delegation-index',
alsoLog: true,
resources: nationalId,
meta: {
Expand Down

0 comments on commit 6449052

Please sign in to comment.