GitHub user noderat added a comment to the discussion: microsoft-psrp
securestring jinja2.exceptions.TemplateAssertionError
No, that is correct and follows my assumptions. According to the documentation
operator includes a jinja template filter that should be applied at the worker
during pre-processing of the task to tag an argument or string going to the
operator as a secure string, thus allowing secure parameters/arguments to be
passed to the remote machine. In this case I'm looking to pass a secure
argument to the operator.
@potiuk if somehow I'm misunderstanding things, how can the minimal example I
provided that throws an error be modified to demonstrate how to pass in a
parameter/argument in the operator and tag it as a SecureString as indicated in
the operator's documentation?
Again, here's the minimal failing example:
```python
import datetime
from airflow import DAG
from airflow.providers.microsoft.psrp.operators.psrp import PsrpOperator
with DAG(
dag_id="psrpoperator_securestring_error_reproduction",
start_date=None,
schedule_interval=None,
render_template_as_native_obj=True,
):
PsrpOperator(
psrp_conn_id = "SomeConnection",
cmdlet = "Write-Output",
arguments = [ "{{ 'foo' | securestring }}" ], # Attempt to pass 'foo'
to remote machine as a SecureString. Fails with error:
jinja2.exceptions.TemplateAssertionError: No filter named 'securestring'
)
```
GitHub link:
https://github.com/apache/airflow/discussions/44095#discussioncomment-11294724
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]