-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add audit entries for vulnerabilities and add missing file for deploy…
… key audit entries
- Loading branch information
1 parent
79cb854
commit 9d039e0
Showing
5 changed files
with
704 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package deployment | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/nais/api/internal/audit" | ||
) | ||
|
||
const ( | ||
auditResourceTypeDeployKey audit.AuditResourceType = "DEPLOY_KEY" | ||
) | ||
|
||
func init() { | ||
audit.RegisterTransformer(auditResourceTypeDeployKey, func(entry audit.GenericAuditEntry) (audit.AuditEntry, error) { | ||
switch entry.Action { | ||
case audit.AuditActionUpdated: | ||
return TeamDeployKeyUpdatedAuditEntry{ | ||
GenericAuditEntry: entry.WithMessage("Updated deployment key"), | ||
}, nil | ||
default: | ||
return nil, fmt.Errorf("unsupported deploy key audit entry action: %q", entry.Action) | ||
} | ||
}) | ||
} | ||
|
||
type TeamDeployKeyUpdatedAuditEntry struct { | ||
audit.GenericAuditEntry | ||
} |
Oops, something went wrong.