mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-04 06:15:07 +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.
|
||||
|
||||
Reference in New Issue
Block a user