Skip to content

Commit

Permalink
chore(secrets): adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Sep 8, 2023
1 parent f72af67 commit d37f581
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/compiled-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const rules = {
"camunda-compat/no-task-schedule": "error",
"camunda-compat/no-template": "error",
"camunda-compat/no-zeebe-properties": "error",
"camunda-compat/secrets": "error",
"camunda-compat/secrets": "warn",
"camunda-compat/sequence-flow-condition": "error",
"camunda-compat/signal-reference": "error",
"camunda-compat/start-form": "error",
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
return getEventBasedGatewayTargetNotAllowedErrorMessage(report);
}

if (type === ERROR_TYPES.SECRET_EXPRESSION_INVALID) {
return getSecretExpressionInvalidErrorMessage(report);
if (type === ERROR_TYPES.SECRET_EXPRESSION_FORMAT_DEPRECATED) {
return getSecretExpressionFormatDeprecatedErrorMessage(report);
}

return message;
Expand Down Expand Up @@ -633,12 +633,12 @@ function getPropertyValueNotAllowedErrorMessage(report, executionPlatform, execu
return message;
}

function getSecretExpressionInvalidErrorMessage(report) {
function getSecretExpressionFormatDeprecatedErrorMessage(report) {
const { data } = report;

const { property } = data;

return `Property <${ property }> is not a valid secret`;
return `Property <${ property }> uses deprecated secret expression format secrets.SECRET, use {{secrets.SECRET}} instead`;
}

function getElementPropertyValueDuplicatedErrorMessage(report) {
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ export function getErrorMessage(id, report) {
return 'Cannot be an expression.';
}

if (data.type === ERROR_TYPES.SECRET_EXPRESSION_INVALID) {
return 'Is not a valid secret.';
if (data.type === ERROR_TYPES.SECRET_EXPRESSION_FORMAT_DEPRECATED) {
return 'Secret expression format deprecated.';
}

if (id === 'isExecutable') {
Expand Down
8 changes: 4 additions & 4 deletions test/spec/utils/error-messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ describe('utils/error-messages', function() {
});


describe('secret expression invalid', function() {
describe('secret expression format deprecated', function() {

it('should adjust (correlation key)', async function() {

Expand Down Expand Up @@ -1808,7 +1808,7 @@ describe('utils/error-messages', function() {
const errorMessage = getErrorMessage(report);

// then
expect(errorMessage).to.equal('Property <correlationKey> is not a valid secret');
expect(errorMessage).to.equal('Property <correlationKey> uses deprecated secret expression format secrets.SECRET, use {{secrets.SECRET}} instead');
});


Expand Down Expand Up @@ -1837,7 +1837,7 @@ describe('utils/error-messages', function() {
const errorMessage = getErrorMessage(report);

// then
expect(errorMessage).to.equal('Property <source> is not a valid secret');
expect(errorMessage).to.equal('Property <source> uses deprecated secret expression format secrets.SECRET, use {{secrets.SECRET}} instead');
});


Expand Down Expand Up @@ -1866,7 +1866,7 @@ describe('utils/error-messages', function() {
const errorMessage = getErrorMessage(report);

// then
expect(errorMessage).to.equal('Property <value> is not a valid secret');
expect(errorMessage).to.equal('Property <value> uses deprecated secret expression format secrets.SECRET, use {{secrets.SECRET}} instead');
});

});
Expand Down
8 changes: 4 additions & 4 deletions test/spec/utils/properties-panel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ describe('utils/properties-panel', function() {
});


describe('secret expression invalid', function() {
describe('secret expression format deprecated', function() {

it('Subscription correlation key', async function() {

Expand All @@ -1590,7 +1590,7 @@ describe('utils/properties-panel', function() {
// then
expect(entryIds).to.eql([ 'messageSubscriptionCorrelationKey' ]);

expectErrorMessage(entryIds[ 0 ], 'Is not a valid secret.', report);
expectErrorMessage(entryIds[ 0 ], 'Secret expression format deprecated.', report);
});


Expand Down Expand Up @@ -1622,7 +1622,7 @@ describe('utils/properties-panel', function() {
// then
expect(entryIds).to.eql([ 'ServiceTask_1-input-0-source' ]);

expectErrorMessage(entryIds[ 0 ], 'Is not a valid secret.', report);
expectErrorMessage(entryIds[ 0 ], 'Secret expression format deprecated.', report);
});


Expand Down Expand Up @@ -1654,7 +1654,7 @@ describe('utils/properties-panel', function() {
// then
expect(entryIds).to.eql([ 'ServiceTask_1-extensionProperty-0-value' ]);

expectErrorMessage(entryIds[ 0 ], 'Is not a valid secret.', report);
expectErrorMessage(entryIds[ 0 ], 'Secret expression format deprecated.', report);
});

});
Expand Down

0 comments on commit d37f581

Please sign in to comment.