feature (events): Classify auth method request/resp messages for audit events. (#1640)

* refactor (oidc): Stop emitting error for not found token id

Stop emitting errors when authtoken repo.IssueAuthToken is called and
there's if no pending token.  It's not an "normal" state and not
an error condition.

* feature (audit tagging): Add tags for auth method requests/responses

Including testing functions for asserting audit events created
when a service is called
This commit is contained in:
Jim authored and GitHub committed 2021-10-27 09:37:14 -04:00
1 parent 3de16b6e21
commit a679300b50
20 files changed
+452 -74

No files matched your search

+1 -1
View File
@@ -383,7 +383,7 @@ func (r *Repository) IssueAuthToken(ctx context.Context, tokenRequestId string)
// trigger to set ApproximateLastAccessTime to the commit timestamp.
rowsUpdated, err := w.Update(ctx, at, []string{"Status"}, []string{"ApproximateLastAccessTime"}, db.WithWhere("status = ?", PendingStatus))
if err != nil {
return errors.Wrap(ctx, err, op)
return errors.Wrap(ctx, err, op, errors.WithoutEvent())
}
if rowsUpdated == 0 {
return errors.New(ctx, errors.RecordNotFound, op, "pending auth token not found")