mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-05 06:25:08 +09:00
feat: special character check (#797)
* feat: add config option for special character handling * chore: update dist files
This commit is contained in:
+6
-3
@@ -20748,18 +20748,21 @@ function reset() {
|
||||
exports.reset = reset;
|
||||
function verifyKeys(creds) {
|
||||
if (!creds) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (creds.AccessKeyId) {
|
||||
if (SPECIAL_CHARS_REGEX.test(creds.AccessKeyId)) {
|
||||
throw new Error('AccessKeyId contains special characters.');
|
||||
core.debug('AccessKeyId contains special characters.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (creds.SecretAccessKey) {
|
||||
if (SPECIAL_CHARS_REGEX.test(creds.SecretAccessKey)) {
|
||||
throw new Error('SecretAccessKey contains special characters.');
|
||||
core.debug('SecretAccessKey contains special characters.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.verifyKeys = verifyKeys;
|
||||
// Retries the promise with exponential backoff if the error isRetryable up to maxRetries time.
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ export declare function defaultSleep(ms: number): Promise<unknown>;
|
||||
declare let sleep: typeof defaultSleep;
|
||||
export declare function withsleep(s: typeof sleep): void;
|
||||
export declare function reset(): void;
|
||||
export declare function verifyKeys(creds: Partial<Credentials> | undefined): void;
|
||||
export declare function verifyKeys(creds: Partial<Credentials> | undefined): boolean;
|
||||
export declare function retryAndBackoff<T>(fn: () => Promise<T>, isRetryable: boolean, maxRetries?: number, retries?: number, base?: number): Promise<T>;
|
||||
export declare function errorMessage(error: unknown): string;
|
||||
export declare function isDefined<T>(i: T | undefined | null): i is T;
|
||||
|
||||
Reference in New Issue
Block a user