@unito/integration-cli 0.60.4 → 0.60.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,7 +69,11 @@ class Oauth2 extends core_1.Command {
|
|
|
69
69
|
throw new errors_1.MissingAuth2AuthorizationError();
|
|
70
70
|
}
|
|
71
71
|
// Decrypt any encrypted oauth2 fields (mainly clientSecret)
|
|
72
|
-
|
|
72
|
+
const decryptedEntries = await (0, decryption_1.decryptEntries)(configuration.name, environment, this.config.configDir, oauth2);
|
|
73
|
+
if (decryptedEntries.failed.length) {
|
|
74
|
+
throw new errors_1.EntryDecryptionError(decryptedEntries.failed.at(0), environment);
|
|
75
|
+
}
|
|
76
|
+
oauth2 = decryptedEntries.successful;
|
|
73
77
|
const testAccount = flags['test-account'];
|
|
74
78
|
const testAccountCredentials = configuration.testAccounts?.[testAccount];
|
|
75
79
|
let credentials;
|
|
@@ -10,6 +10,7 @@ const Oauth2Resource = tslib_1.__importStar(require("../../src/resources/oauth2"
|
|
|
10
10
|
const IntegrationsPlatform = tslib_1.__importStar(require("../../src/services/integrationsPlatform"));
|
|
11
11
|
const DecryptionResource = tslib_1.__importStar(require("../../src/resources/decryption"));
|
|
12
12
|
const configurationTypes_1 = require("../../src/configurationTypes");
|
|
13
|
+
const styles_1 = require("../helpers/styles");
|
|
13
14
|
describe('oauth2', () => {
|
|
14
15
|
let getConfigurationsStub;
|
|
15
16
|
let writeTestAccountStub;
|
|
@@ -253,4 +254,21 @@ describe('oauth2', () => {
|
|
|
253
254
|
'development',
|
|
254
255
|
]);
|
|
255
256
|
});
|
|
257
|
+
test_1.test
|
|
258
|
+
.stdout()
|
|
259
|
+
.stderr()
|
|
260
|
+
.do(() => getConfigurationsStub.returns({
|
|
261
|
+
...baseConfiguration,
|
|
262
|
+
testAccounts: {
|
|
263
|
+
development: { something: 'something' },
|
|
264
|
+
},
|
|
265
|
+
}))
|
|
266
|
+
.stub(DecryptionResource, 'decryptEntries', stub => stub.resolves({ successful: {}, failed: ['boom!'] }))
|
|
267
|
+
.command(['oauth2'])
|
|
268
|
+
.catch(ctx => {
|
|
269
|
+
(0, test_1.expect)(ctx.message).to.equal('EEXIT: -1');
|
|
270
|
+
})
|
|
271
|
+
.it('must successfully decrypt all secrets', ctx => {
|
|
272
|
+
(0, test_1.expect)(ctx.stderr).to.contain((0, styles_1.uncolorize)('The secret boom! could not be decrypted.'));
|
|
273
|
+
});
|
|
256
274
|
});
|
package/oclif.manifest.json
CHANGED