Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce secret data type #1226

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
master:
new features:
- Added support for "password" data type in Variable

4.1.0:
date: 2021-08-16
new features:
Expand Down
44 changes: 25 additions & 19 deletions lib/collection/variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,28 @@ _.assign(Variable, /** @lends Variable */ {
*/
number: Number,

/**
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is not a change, but merely a code reorder for clean addition of new type

* Free-form type of a value. This is the default for any variable, unless specified otherwise. It ensures that
* the variable can store data in any type and no conversion is done while using {@link Variable#get}.
*/
any: {
/**
* @param {*} val -
* @returns {*}
*/
in (val) {
return val; // pass through
},

/**
* @param {*} val -
* @returns {*}
*/
out (val) {
return val; // pass through
}
},

/**
* A "array" type value stores Array data format
*/
Expand Down Expand Up @@ -342,26 +364,10 @@ _.assign(Variable, /** @lends Variable */ {
},

/**
* Free-form type of a value. This is the default for any variable, unless specified otherwise. It ensures that
* the variable can store data in any type and no conversion is done while using {@link Variable#get}.
* A "password" type is essentially a string. The conflation of data-type and input nature is a deliberate
* attempt to make dealing with sensitive data within environment templates.
*/
any: {
/**
* @param {*} val -
* @returns {*}
*/
in (val) {
return val; // pass through
},

/**
* @param {*} val -
* @returns {*}
*/
out (val) {
return val; // pass through
}
}
password: String
},

/**
Expand Down
Loading