mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-11-30 11:44:23 +01:00
fix: Mask assume role response in debug output (#102)
This commit is contained in:
1 parent
ad85e9c2d3
commit
df7d846161
3 files changed
+30
-8
No files matched your search
@@ -594,4 +594,26 @@ describe('Configure AWS Credentials', () => {
|
||||
})
|
||||
});
|
||||
|
||||
test('masks variables before exporting', async () => {
|
||||
let maskedValues = [];
|
||||
const publicFields = ['AWS_REGION', 'AWS_DEFAULT_REGION'];
|
||||
core.setSecret.mockReset();
|
||||
core.setSecret.mockImplementation((secret) => {
|
||||
maskedValues.push(secret);
|
||||
});
|
||||
|
||||
core.exportVariable.mockReset();
|
||||
core.exportVariable.mockImplementation((name, value) => {
|
||||
if (!maskedValues.includes(value) && !publicFields.includes(name)) {
|
||||
throw new Error(value + " for variable " + name + " is not masked yet!");
|
||||
}
|
||||
});
|
||||
|
||||
core.getInput = jest
|
||||
.fn()
|
||||
.mockImplementation(mockGetInput(ASSUME_ROLE_INPUTS));
|
||||
|
||||
await run();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user