Skip to content

feat(users): Add batch user retrieval with target-aware authorization - #113

Merged
mckaragoz merged 3 commits into
CodeBeamOrg:devfrom
mckaragoz:GetUsersByKeys
Oct 26, 2026
Merged

mckaragoz merged 3 commits into
CodeBeamOrg:devfrom
mckaragoz:GetUsersByKeys

Conversation

@mckaragoz

@mckaragoz mckaragoz commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #97.

Adds efficient batch user retrieval by UserKey with support for target-aware authorization policies.

Changes

  • Add GetByKeysAsync() to retrieve up to 250 user summaries in a single request.
  • Implement batch retrieval for EF Core and InMemory stores.
  • Introduce AccessContext.TargetUserKeys for multi-target authorization.
  • Extend AccessContextFactory to support batch targets.
  • Enable sandbox-scoped batch authorization in Identity Lab.
  • Optimize Identity Lab member retrieval to eliminate N+1 requests.
  • Add regression tests for target normalization, authorization context propagation, and batch request limits.

Notes

  • Uses a single .admin action without introducing a separate self endpoint.
  • Existing single-target authorization behavior remains unchanged.
  • Batch access remains subject to permissions and application-defined policies.

@codecov-commenter

codecov-commenter commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.67016% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.76%. Comparing base (13e22f3) to head (40a69d1).

Files with missing lines Patch % Lines
...am.UltimateAuth.Client/Services/UAuthUserClient.cs 0.00% 8 Missing ⚠️
...s.InMemory/Stores/InMemoryUserSummaryQueryStore.cs 96.00% 1 Missing and 1 partial ⚠️
...h.Users.Reference/Endpoints/UserEndpointHandler.cs 90.90% 1 Missing and 1 partial ⚠️
...mateAuth.Core/Contracts/Authority/AccessContext.cs 85.71% 1 Missing ⚠️
...Users.Reference/Services/UserApplicationService.cs 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #113      +/-   ##
==========================================
+ Coverage   86.71%   86.76%   +0.05%     
==========================================
  Files         678      679       +1     
  Lines       18578    18753     +175     
  Branches     2270     2283      +13     
==========================================
+ Hits        16109    16271     +162     
- Misses       1726     1737      +11     
- Partials      743      745       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mckaragoz mckaragoz changed the title Add Users GetByKeys Endpoint feat(users): Add batch user retrieval with target-aware authorization Oct 26, 2026
@mckaragoz
mckaragoz merged commit ead92c3 into CodeBeamOrg:dev Oct 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add batch user retrieval by UserKey

2 participants