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
Allow env access in Flows Run Script operation #16111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a solid approach to me 😄 I am wondering tho if we should stay on the safe side and block KEY
/SECRET
(or possibly database credentials) from being "allowed" 🤔
I don't think that's necessary. That configuration is in the env vars, which is sysadmin only. That's already "you have access to everything" access, so it's a free for all at that point. |
df9dc43
to
1cf4bb5
Compare
The There are numerous ways to accessed the variables in the run script operation as follows. module.exports = async function (data) {
// The following logs the same value
console.log(process.env); // Node.js method
console.log($env); // Global variable
console.log({{$env}}); // Parsed options
console.log(data.$env) // Passed data, or data['$env']
}; |
Yeah i think that one might be a bit overkill, none of the others are directly accessible as global variables right? |
@br41nslug That has been added that in #16180 🤔 |
Ah i did not know that 😓 never mind then |
@br41nslug The global variable in the run script operation is indeed overkill and hard to document. Removed! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we want to remove the exec-operation-specific handling of env vars completely to make it consistent with the other operations 🤔
Have change requests been resolved to merge this one @licitdev ? |
@br41nslug Yes they were. |
Description
Implements #16108. Allow access to environment variables via
data['$env']
ordata.$env
orprocess.env
in Flows Run Script operation.Type of Change
Requirements Checklist
If adding a new feature: