chore: add audit logs for access grant mutations#1972
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 6c5044f The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| func (s *Service) ListGrants(ctx context.Context, payload *gen.ListGrantsPayload) (*gen.ListGrantsResult, error) { | ||
| authCtx, ok := contextvalues.GetAuthContext(ctx) | ||
| if !ok || authCtx == nil { | ||
| if !ok || authCtx == nil || authCtx.ActiveOrganizationID == "" { |
There was a problem hiding this comment.
Org id being empty should never be true at this point of the call stack
| return oops.E(oops.CodeUnexpected, err, "failed to remove principal grants").Log(ctx, s.logger) | ||
| } | ||
|
|
||
| for _, row := range existingRows { |
There was a problem hiding this comment.
This is going to be spammy. Instead produce a slice of removed grants and pass that as metadata to a single audit event. The UI will then unpack that event.
|
We are getting rid of these endpoints so closing this PR for now. |
Summary