public async getClient()

in services/application/libs/client-factory/src/client-factory.service.ts [16:39]


  public async getClient(
    tenantId: string,
    credentialConfig?: CredentialConfig,
  ) {
    const credentialVendor = new CredentialVendor(tenantId);
    const creds = await credentialVendor.getCredentials(
      credentialConfig || {
        policyType: PolicyType.DynamoDBLeadingKey,
        attributes: {
          tenant: tenantId,
        },
      },
    );
    return DynamoDBDocumentClient.from(
      new DynamoDBClient({
        credentials: {
          accessKeyId: creds.AccessKeyId,
          secretAccessKey: creds.SecretAccessKey,
          sessionToken: creds.SessionToken,
          expiration: creds.Expiration,
        },
      }),
    );
  }