@openhi/constructs 0.0.145 → 0.0.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.mjs CHANGED
@@ -3631,16 +3631,25 @@ var _OpenHiAuthService = class _OpenHiAuthService extends OpenHiService {
3631
3631
  }
3632
3632
  /**
3633
3633
  * Grants the Pre Token Generation Lambda read-only access on the data
3634
- * store table and its GSIs. The Lambda only needs:
3634
+ * store table and its GSIs. The Lambda needs:
3635
3635
  * - `Query` on GSI2 to resolve a User by Cognito `sub`
3636
- * - `GetItem` on the base table for direct User reads
3636
+ * - `GetItem` on the base table for direct User reads (canonical row hydration
3637
+ * after the GSI2 hit, per #1175)
3638
+ * - `BatchGetItem` on the base table for ElectroDB `batchGetWithRetry`
3639
+ * hydration used by `listMembershipsOperation` and
3640
+ * `listRoleAssignmentsOperation` when resolving the
3641
+ * `ohi_organization_roles` / `ohi_platform_roles` claims
3637
3642
  *
3638
3643
  * No write or scan access: a User missing `currentTenant`/`currentWorkspace`
3639
3644
  * falls into the absent-claims path; repair belongs in a separate backfill.
3640
3645
  */
3641
3646
  grantPreTokenGenerationPermissions() {
3642
3647
  const dataStoreTable = this.dataStoreTable();
3643
- const dynamoActions = ["dynamodb:GetItem", "dynamodb:Query"];
3648
+ const dynamoActions = [
3649
+ "dynamodb:GetItem",
3650
+ "dynamodb:Query",
3651
+ "dynamodb:BatchGetItem"
3652
+ ];
3644
3653
  dataStoreTable.grant(this.preTokenGenerationLambda, ...dynamoActions);
3645
3654
  this.preTokenGenerationLambda.addToRolePolicy(
3646
3655
  new PolicyStatement7({