Skip to content

Commit 445af46

Browse files
committed
impr(ARSN-555): Return limits configuration in signature verification callback
1 parent f241d4e commit 445af46

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

lib/auth/AuthInfo.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ export type AccountQuota = {
2222
quota: bigint,
2323
};
2424

25+
export type AccountLimits = {
26+
RequestsPerSecond?: {
27+
Limit: number,
28+
},
29+
}
30+
2531
export type AccountInfos = {
2632
accountQuota?: AccountQuota,
33+
limits?: AccountLimits,
2734
};
2835

2936
export type AuthV4Results = {
3037
userInfo: AuthInfoType,
3138
authorizationResults?: AuthorizationResults,
3239
accountQuota: AccountQuota,
40+
limits?: AccountLimits,
3341
};
3442

3543
export type AccountCanonicalInfo = {

lib/auth/Vault.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function vaultSignatureCb(
6666
log.addDefaultFields(auditLog);
6767
return callback(null, userInfo, authorizationResults, streamingV4Params, {
6868
accountQuota: info.accountQuota || {},
69+
limits: info.limits || {},
6970
});
7071
}
7172
export type AuthV2RequestParams = {
@@ -474,13 +475,13 @@ export default class Vault {
474475
/**
475476
* Calls Vault to retrieve the default encryption key id of the account, or creates it if it doesn't exist.
476477
*
477-
* @param {string} canonicalID - The canonical id of the account for which
478+
* @param {string} canonicalID - The canonical id of the account for which
478479
* the encryption key id is being retrieved or created.
479480
* @param {RequestLogger} log - logger
480-
* @param {(err: Error | null, data?: {
481-
* canonicalId: string,
482-
* encryptionKeyId: string,
483-
* action: 'retrieved' | 'created'
481+
* @param {(err: Error | null, data?: {
482+
* canonicalId: string,
483+
* encryptionKeyId: string,
484+
* action: 'retrieved' | 'created'
484485
* }) => void}
485486
* - canonicalId: The canonical id of the account.
486487
* - encryptionKeyId: The retrieved or newly created encryption key id.
@@ -491,10 +492,10 @@ export default class Vault {
491492
getOrCreateEncryptionKeyId(
492493
canonicalID: string,
493494
log: RequestLogger,
494-
callback: (err: Error | null, data?: {
495-
canonicalId: string,
496-
encryptionKeyId: string,
497-
action: 'retrieved' | 'created'
495+
callback: (err: Error | null, data?: {
496+
canonicalId: string,
497+
encryptionKeyId: string,
498+
action: 'retrieved' | 'created'
498499
}) => void
499500
) {
500501
log.trace('sending request context params to vault to get or create encryption key id');

0 commit comments

Comments
 (0)