Skip to content

feat(csa-362): optimize admin export for high user volumes with bulk IAM API#2429

Merged
cmgrote merged 2 commits into
mainfrom
fix/csa-362-admin-export-scale
Apr 22, 2026
Merged

feat(csa-362): optimize admin export for high user volumes with bulk IAM API#2429
cmgrote merged 2 commits into
mainfrom
fix/csa-362-admin-export-scale

Conversation

@bladata1990

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces per-user Keycloak group lookups with a single bulk call to the Redis-backed /identity/users endpoint, fixing timeouts at 60K+ users (reported at GM)
  • Adds IdentityEndpoint to the SDK with getUsers() (user details + groups in one shot) and getGroupAliases() — both batched at 500 IDs/request
  • Wires client.identity into AtlanClient; Users.kt now uses getUsers() and falls back to Heracles only for fields Redis doesn't provide (lastLoginTime, personas, licenseType, designation)
  • Adds 10 unit tests (IamClientTest) covering empty inputs, field mapping, missing attributes, and batch splitting via a local HTTP stub server

Test plan

  • Unit tests pass: ./gradlew :samples:packages:admin-export:test -PpackageTests
  • Deployed and tested on fs3.atlan.com — admin export runs successfully against high user volume
  • Verify log line Resolving user details and group memberships via IdentityEndpoint (bulk IAM API)... appears in run output

@bladata1990
bladata1990 requested a review from cmgrote as a code owner April 21, 2026 09:48
Comment thread sdk/src/main/java/com/atlan/model/admin/IamUser.java Outdated
Comment thread sdk/src/main/java/com/atlan/api/IdentityEndpoint.java Outdated
Comment thread sdk/src/main/java/com/atlan/api/IdentityEndpoint.java Outdated
Comment thread sdk/src/main/java/com/atlan/api/IdentityEndpoint.java Outdated
Comment thread samples/packages/admin-export/src/test/kotlin/IamClientTest.kt Outdated
@bladata1990
bladata1990 force-pushed the fix/csa-362-admin-export-scale branch from e0e5488 to c1581d8 Compare April 22, 2026 10:07
@bladata1990
bladata1990 requested a review from cmgrote April 22, 2026 10:10
…IAM API

Replaces per-user Keycloak calls (which fail at scale) with a single bulk
lookup against the Redis-backed identity API (/identity/users, /identity/groups).

Key changes:
- IdentityEndpoint: bulk-fetches user details (id, username, email, enabled,
  firstName, lastName, createdTimestamp, groups) and group aliases in batches
  of 500, using an escalated sudo client with x-endpoint-type: utility header
- Users.kt: collects all users upfront, resolves group memberships and aliases
  in bulk, then writes a single row per user — eliminating O(n) Keycloak calls
- AtlanUser.UserAttributes: annotates all List<String> fields with
  StringOrListDeserializer so both Redis (flat string) and Keycloak (array)
  attribute formats deserialize correctly
- StringOrListDeserializer: wraps a bare JSON string into a single-element
  list, handling the Redis vs Keycloak attribute format difference
- gradle.properties: bump version to 7.0.3-SNAPSHOT

Signed-off-by: bladata1990 <balakrishnan.r@atlan.com>
@bladata1990
bladata1990 force-pushed the fix/csa-362-admin-export-scale branch from c1581d8 to 9940721 Compare April 22, 2026 10:14
@cmgrote
cmgrote enabled auto-merge April 22, 2026 10:30
@cmgrote
cmgrote merged commit 5a8289e into main Apr 22, 2026
7 checks passed
@cmgrote cmgrote added the enhancement New feature or request label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants