Add IsScopeToResource#130
Conversation
| if cfg.IsScopeToResource != "" { | ||
| isScopeToResource, err = s.env.EvaluateBool(ctx, cfg.IsScopeToResource, inputs) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("exclusion_group.is_scoped_to_resource evaluation failed: %w", err) |
There was a problem hiding this comment.
🟡 Suggestion: The error message says is_scoped_to_resource (with a "d") but the config YAML field is is_scope_to_resource. This mismatch could confuse users debugging config issues.
| return nil, fmt.Errorf("exclusion_group.is_scoped_to_resource evaluation failed: %w", err) | |
| return nil, fmt.Errorf("exclusion_group.is_scope_to_resource evaluation failed: %w", err) |
| if err := s.recordEntitlementExclusionGroup(exclusionGroup, entID, resource.GetId().GetResourceType()); err != nil { | ||
| return err | ||
| } | ||
| } |
There was a problem hiding this comment.
🟡 Suggestion: The annos slice is declared outside the inner for _, resource loop and shared across all entitlements created from the same static entitlement template. Each iteration calls annos.Update(exclusionGroup) which mutates the shared underlying array. Since all entitlements reference the same slice, they would all end up with the last resource's scoped exclusion group ID after PutEntitlements marshals them. This is an upstream SDK issue — if scope_to_resource is used with multiple resources, the per-resource scoping may not work correctly.
Connector PR Review: Add IsScopeToResourceBlocking Issues: 0 | Suggestions: 2 | Threads Resolved: 0 Review SummaryThis PR adds a new Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agents |
Description
Useful links: