Fix linter errors caused by deprecated attributes. - #130
Conversation
| client *client.Client | ||
| } | ||
|
|
||
| var _ connectorbuilder.StaticEntitlementSyncerV2 = &roleBuilder{} |
There was a problem hiding this comment.
🟠 Bug: roleBuilder does not implement StaticEntitlementSyncerV2 — that interface requires StaticEntitlements(ctx context.Context, opts resource.SyncOpAttrs) ([]*v2.Entitlement, *resource.SyncOpResults, error) (vendored SDK pkg/connectorbuilder/resource_syncer.go:72), and no such method exists anywhere in pkg/. The only entitlement method here is the per-resource Entitlements at line 90, which satisfies ResourceSyncerV2, not this interface. As written the package fails to compile.
| var _ connectorbuilder.StaticEntitlementSyncerV2 = &roleBuilder{} | |
| var _ connectorbuilder.ResourceSyncerV2 = &roleBuilder{} |
| require.NoError(t, err) | ||
| assert.NotEqual(t, v2.AgentTrait_AGENT_STATUS_UNSPECIFIED, at.GetStatus()) | ||
| require.NotNil(t, r.GetStatus()) | ||
| assert.NotEqual(t, v2.Status_RESOURCE_STATUS_UNSPECIFIED, r.GetStatus().GetStatus()) |
There was a problem hiding this comment.
🟡 Suggestion: The bulk of this PR moves profile off the user/group/role/app traits onto Resource.profile, but the only new assertions cover agent status and secret created_at. Nothing asserts r.GetProfile() is populated for users, groups, roles, or NHIs, so a dropped profile in that migration would pass CI silently. Consider adding a require.NotNil(t, r.GetProfile()) (plus a key spot-check) in the user/group/role/NHI tests.
a7086d0 to
51091e4
Compare
Connector PR Review: Fix linter errors caused by deprecated attributes.Blocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review SummaryScanned the full PR diff for security and correctness. This migrates Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agents |
| userResourceType, | ||
| u.Id, | ||
| traits, | ||
| resource.WithUserTrait(userOpts...), |
There was a problem hiding this comment.
🟡 Suggestion: Dropping WithDetailedStatus means NewUserTrait applies its own default — UserTrait.status = STATUS_ENABLED — for every user, and the SDK only syncs trait→resource (syncUserTraitToResource), never resource→trait. So a disabled user now emits resource status DISABLED (correct) alongside a deprecated trait status of ENABLED (actively wrong, not merely absent). Contrast agents.go, where WithAgentTrait() leaves the trait status UNSPECIFIED and is therefore safe. If any consumer still reads the deprecated UserTrait.status during the deprecation window, disabled accounts will look active; consider keeping resource.WithDetailedStatus(...) with a //nolint:staticcheck until readers have migrated.
No description provided.