Skip to content

Commit

Permalink
Add warnings about using the password option
Browse files Browse the repository at this point in the history
  • Loading branch information
MattMonk committed Aug 20, 2024
1 parent 0c55905 commit 5982755
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Currently, only files can be used as inputs or outputs and not directories.
The plugin can be used without specifying any options relating to the URLs, in which case all information must be contained in the URL passed by the user.

The options for `host`, `port`, `username`, `password` and `url_decorator` can be specifed to make the URLs shorter and easier to use.

Please note: if the `password` option is supplied (even implicitly via the environment variable `SNAKEMAKE_STORAGE_XROOTD_PASSWORD`) it will be displayed in plaintext as part of the XRootD URLs when Snakemake prints information about a rule. Only use the `password` option in trusted environments.
12 changes: 11 additions & 1 deletion snakemake_storage_plugin_xrootd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ class StorageProviderSettings(StorageProviderSettingsBase):
password: Optional[str] = field(
default=None,
metadata={
"help": "The password to use for authentication",
"help": "The password to use for authentication. NOTE: Only use this "
"setting in trusted environments! Snakemake will print the "
"password in plaintext as part of the XRootD URLs used in the "
"inputs/outputs of jobs.",
"env_var": True,
"required": False,
},
Expand All @@ -94,6 +97,13 @@ class StorageProvider(StorageProviderBase):
def __post_init__(self):
self.username = self.settings.username
self.password = self.settings.password
if self.password is not None:
get_logger().warning(
"A password has been specified -- it will be printed "
"in plaintext when Snakemake displays the "
"inputs/outputs of jobs! Only use this option in "
"trusted environments."
)
self.host = self.settings.host
self.port = self.settings.port
self.url_decorator = self.settings.url_decorator
Expand Down

0 comments on commit 5982755

Please sign in to comment.