Problem
Two endpoints under accessmanagement/api/v1/enduser/clientdelegations return wrong values:
GET my/clientproviders builds each access entry with DtoMapper.ConvertCompactRole(a.Role), but the query only includes a.From, so the role navigation is never loaded and every provider serializes "role": null.
GET clients/accesspackages sets agentAddedAt from the agent entity row (To.Audit_ValidFrom), so the field carries the time the agent entity was created instead of the time the agent assignment was made.
Both were found while mirroring the API for v2 in PR #3788. The v2 methods return the corrected values, and the v1 methods were left alone there since that PR keeps /v1/ byte identical.
Goal
v1 returns the same corrected values as v2: the role populated from RoleConstants.Agent.Entity (the query already filters on that role), and agentAddedAt taken from the agent assignment's Audit_ValidFrom.
Approach
Mirror the v2 fixes in the v1 methods in ClientDelegationService, and pin the corrected values with integration tests.
Work
Out of scope
The other v1 gaps noted in the PR #3788 review (missing 204 in the v1 swagger doc, tracked reads in GetAgents) stay as they are.
Constraints / principles
Both fixes change observable v1 response values: role goes from null to the agent role, and agentAddedAt moves from entity creation time to assignment time. Consumers reading these fields today will see different values, so no PR until this is confirmed wanted.
@jonkjetiloye ok to correct these two in v1?
Related to #3770 and PR #3788.
Problem
Two endpoints under
accessmanagement/api/v1/enduser/clientdelegationsreturn wrong values:GET my/clientprovidersbuilds each access entry withDtoMapper.ConvertCompactRole(a.Role), but the query only includesa.From, so the role navigation is never loaded and every provider serializes"role": null.GET clients/accesspackagessetsagentAddedAtfrom the agent entity row (To.Audit_ValidFrom), so the field carries the time the agent entity was created instead of the time the agent assignment was made.Both were found while mirroring the API for v2 in PR #3788. The v2 methods return the corrected values, and the v1 methods were left alone there since that PR keeps /v1/ byte identical.
Goal
v1 returns the same corrected values as v2: the role populated from
RoleConstants.Agent.Entity(the query already filters on that role), andagentAddedAttaken from the agent assignment'sAudit_ValidFrom.Approach
Mirror the v2 fixes in the v1 methods in
ClientDelegationService, and pin the corrected values with integration tests.Work
GetMyProviders: map the role fromRoleConstants.Agent.EntityGetDelegatedAccessPackagesFromClientsViaParty: projectAgentAddedAtfrom the delegation's agent assignmentOut of scope
The other v1 gaps noted in the PR #3788 review (missing 204 in the v1 swagger doc, tracked reads in
GetAgents) stay as they are.Constraints / principles
Both fixes change observable v1 response values:
rolegoes from null to the agent role, andagentAddedAtmoves from entity creation time to assignment time. Consumers reading these fields today will see different values, so no PR until this is confirmed wanted.@jonkjetiloye ok to correct these two in v1?
Related to #3770 and PR #3788.