Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/cadf: add attributes for name enrichment to type Resource
We want to have project/domain names on Initiator resources in a standard way. Since all other Go-based services rely on `package cadf` when generating structured events, `type Resource` needs to support the respective fields. While making this change, I realized that `AuditParameters.NewEvent()` in this package deviates from github.com/sapcc/go-bits/audittools in the meaning of Initiator.Domain: In this package, Initiator.Domain is set to the domain from the token scope (or empty for project-scoped tokens), whereas audittools sets Initiator.Domain to the name of the user's domain. The CADF standard describes the "domain" attribute for resources as "the optional name of the domain that qualifies the name of the resource". Since "the resource" is the initiating user in this case, this supports audittools' interpretation. I therefore changed NewEvent() in this package to use the same interpretation. Since there are no users of NewEvent() across sapcc projects right now (at least as far as GitHub Code Search can tell), this should be a low-impact change.
- Loading branch information