-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Create a <File> component #26
Comments
Some questions regarding the props:
|
I'd expect the prop
Yes. Defaults to current behavior where it might get the name from the file or from the
Some files need to be executable (scripts, for instance). Skip this part for now if you feel it's gonna take a lot of time. |
Its not that, I feel this is a security risk, I see what you mean, however if script files are generated I expect myself as a user to have to give the file access to run. A malicious template owner might add a script file hidden somewhere, which are executing once the user tries to use the "normal" library. The user would have no idea that is it happening since we already gave the file execution permissions. I know that at the moment hooks can easily be used to implement the same functionality, but I can imagine that would change as well in some way 🤷 In my mind these form for code generators are super awesome but also the perfect opportunity for malicious actors to inject anything into a persons computer. But I can also see the usefulness in having this prop. |
It's already a problem without hooks too. For instance, right now (without React) if the template file is executable, it will be copied as executable too if it's marked as It's a valid concern but it's also true it has nothing to do with the task at hand so I'd not worry about it now. Feel free to create an issue on the Generator to raise your concern. |
This is not true, the files are never copied with execution permissions even if they did since you install the template (before generating the files) all files are given |
Down to the actual
|
Seems to be an OS issue? nodejs/node#26936. It's respecting permissions for me on Mac OS X.
What about an JS object like: {
executable: true,
user: {
read: true,
write: true,
},
group: {
read: true,
write: true,
}
} And depending on the OS it will convert it down to the corresponding code. |
Done by asyncapi/generator-react-sdk@c884869 commit |
The template author should be able to use a component representing the current file being rendered. We can call this component
<File>
. It should take —at least— the following props:name
: It represents the name of the file in the output.permissions
: It represents the permissions of the file in the output.Hints
The text was updated successfully, but these errors were encountered: