-
-
Notifications
You must be signed in to change notification settings - Fork 247
Description
Describe the problem
I want to install dependencies when creating a project from a copier template. The dependencies are hosted on a private pypi mirror. Credentials are required to install dependencies from there. I run the installation via a python script. But we could also assume that we want to set an environment variable etc.
So, in the template I ask for the username and password. I mark the password as secret. I did not find any proper documentation of how to use this password securely.
In the documentation for tasks the template variables are inserted via {{ var_name }}. Using this exposes the secret variable.
Template
username:
type: str
password:
type: str
secret: true
default: "1234"
_tasks:
- "python my_script.py --username={{ username }} --password={{ password }}"To Reproduce
- Run
copier copy --trustwith the template from above - Answer
- username="user"
- password="secret1234"
- Output will be
> Running task 1 of 1: python my_script.py --username=user --password=secret1234
With this the password is exposed in the terminal
Logs
No response
Expected behavior
There a multiple options:
- I can surpress the output of tasks, e.g only show
Running task 1 of 1. - The output of the tasks detects the password to be a secret and uses asteriks instead, e.g.
Running task 1 of 1: python my_script.py --username=user --password=*** - There is another way to access information provided via a secret template variable, e.g. an environment variable.
I prefer option 2, but am also happy with any other option
Screenshots/screencasts/logs
No response
Operating system
Windows
Operating system distribution and version
Windows 11
Copier version
9.4.1
Python version
3.11
Installation method
pip+pypi
Additional context
No response