- Notifications
You must be signed in to change notification settings - Fork928
chore: enforce orgid in audit logs where required#12283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
// In unit tests we panic to fail the tests | ||
panic(fmt.Sprintf("missing required organization ID for resource %q", resourceName)) | ||
} | ||
log.Error(ctx, "missing required organization ID for resource in audit log", | ||
slog.F("resource", resourceName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
maybe no harm to also include resource type?
Edit: %T does that, the varnameresourceName
threw me off
maybe we can do%+v
in unit tests? or would that be too much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think %+v is too much and we'd have to be careful with any secrets.
Uh oh!
There was an error while loading.Please reload this page.
What this does
Populates and requires the
organizationID
field to audit logs where it can be set.Some resources are not scoped to an org. This is ok imo, but from a UI perspective, we might have org vs site audit log views in the future.
Closes#11930