Closed joshuadavidthomas closed 6 months ago
I only did that as a way to make sure the the token was set.
Couple of options:
get_op_service_account_token
method when accessing the secret or in AppConfig.ready
.Pass in the environ:
result = subprocess.run(
[op, "read", op_uri],
capture_output=True,
env={"OP_SERVICE_ACCOUNT_TOKEN": op_token, **os.environ},
timeout=op_timeout,
)
op
cli gets the config from the environment.
Trying to access the secret of a URI, I am getting this error from the 1Password CLI:
Seems like explicitly setting the
env
of thesubprocess.run
is clobbering howop
get the config for the CLI tool.