Closed springbok closed 2 weeks ago
@springbok trying to reproduce this, it seems like the issue is with how the string is stored and not with how it is read by wing.
If you use single-quotes, the shell won't substitute $x
:
AI_PASSWORD='$2b$fsafrrewru3DSVF12$dnZV3fssfiV4Y1D/6MdCNBthKLKSj24560uXEH2zfHK9IMEK43GkcvF9YUTWzJcGJK'
And then util.env()
should show you the full value.
Perhaps related: it might be better to use cloud.Secret
to read secrets:
bring cloud;
let secret = new cloud.Secret(name: "AI_PASSWORD");
test "show me the secret" {
log(secret.value());
}
This is more portable.
When executed in sim
, it will read the secret from an environment variable (you can also put these in .env
) and when deployed to the cloud it will read from the default secret store (e.g. AWS Secrets Manager on AWS).
If you run wing secrets
, it will prompt you to store the secrets.
Closing for now as this doesn't seem to be an issue.
I tried this:
Here is an example string in my .env:
And read it using:
This happened:
It returns a partial string rather than the full string:
I expected this:
I expected to get the full string back:
Is there a workaround?
I've hard coded the string for now.
Anything else?
No response
Wing Version
0.74.38
Node.js Version
v20.13.0
Platform(s)
Linux
Community Notes