CXH-436: skip roles sync on 403#99
Conversation
|
Claude finished @al-conductorone's task in 1m 33s —— View job PR Review: CXH-436 - Skip roles sync on 403
Summary: This PR gracefully handles 403 (Forbidden) errors during role syncing in three methods — Overall: Looks good. The approach is consistent with existing 403 handling in this codebase (e.g., Feedback1. Inconsistent log levels — intentional but worth a comment (nit)
2. return nil, nil, nil
3. Consider logging the 403 response body details (nit) The 4. Grants() restructure is clean (role.go:117-132) The refactoring from a flat VerdictThe only potentially impactful item is #2 — confirming the SDK handles a |
There was a problem hiding this comment.
The request is really to not sync roles when roles are disabled in the c1 UI resource.
The Linear issue asks "Ask: Allow GWS Connector to sync if Roles is denied in api call" We should not do this in my opinion.
I'm not sure this is the requested change since none of the code in this diff would run if roles were disabled. There's a screenshot of the UI in the linear issue https://linear.app/ductone/issue/CXH-436/gws-skip-roles-if-permission-is-denied. There must be some roles API call we are doing even when it is disabled.
We should not skip syncing on 403 but instead return the error
| roles, err := o.client.ListRoles(ctx, o.customerId, bag.PageToken()) | ||
| if err != nil { | ||
| gerr := &googleapi.Error{} | ||
| if errors.As(err, &gerr) && gerr.Code == http.StatusForbidden { |
There was a problem hiding this comment.
Based on the Linear issue we should only skip "when roles are disabled", which is a C1 UI configuration. It is passed into baton-sdk. We should not use permission errors for this. This will delete data.

Linear: CXH-436