Open DannyDainton opened 2 years ago
Any updates? I have a script that takes secret keys from global variables in postman and creates their corresponding base64 encoded keys in global variables but I'm not able to mask them programmatically. They are created as plain text base64 encoded values.
:shipit: please
Hello to everyone 🙂
I am struggling with the same issue, I've search everywhere but I didn't found out any answers 🙁
Is there any workaround to fix this ?
Best regards
I would like to know as well
Same here...
Same...
+1 REQUIRED
+1
+1
+1
+1
+1
+1
+1
+1
+1
Same, this is a hard stop with us developing some of our new APIs.
same issue
The suggestion in the description ☝️ was for something like:
let token = pm.response.json().access_token;
pm.environment.set('token', token, 'secret');
I would also be happy with a specific method called setSecret(...):
let token = pm.response.json().access_token;
pm.environment.setSecret('token', token);
Facing the similar issue. Tried to set the type programmatically, no luck.
Any updates/solution on this?
pm.test("Management Access token is received and will be set as environment variable", () => {
const jsonData = pm.response.json();
pm.expect(jsonData).to.have.property('access_token');
pm.environment.set('management_access_token', jsonData.access_token,'secret')
});
+1 I would like this feature.
+1
+1
+1
Would love this feature
+1
+1 would like to have this feature
+1
+1
no news?
+5
+1
+1
+1
still open after over two years?
@nshoemaker-elfin nobody cares about community
+1
I tried using pm.environment.set("token", pm.variables.replaceIn(token), pm.environment.toObject(), "secret");
as suggested by ChatGpt --but it did not work
+1
I think I might have found a solution to this, but I need to find on which project it was and test it again to ensure it would still work properly today.
I'll keep you in touch by the end of the week
@Vikmanatus, did you had a chance to take a look at that? 👀
btw, +1
+1
Hey folks 👋🏻
Just providing some additional information since it been a while since I opened this issue.
With V11, we have introduced the Postman Vault, which allows you to store your sensitive data in an encrypted local vault that is not synced with the Postman Cloud. Also, we have added multiple security features to help prevent accidental exposure of your API credentials.
The secret type is basically giving a false sense of security for those sensitive values. It's essentially only masking that data in the UI, it's not encrypted and is still sent as plain text.
Note that you can't set or access vault secrets in scripts. (source)
This is very sad, as I have credentials coming through the return of an API, so I won't be able to enhance my security. 🤡
The secret type is basically giving a false sense of security for those sensitive values. It's essentially only masking that data in the UI, it's not encrypted and is still sent as plain text.
It would still be valuable for short lived secrets like access tokens
+1
+1
Is there an existing request for this feature?
Is your feature request related to a problem?
With the great addition of the
secret
variable type in the platform, users can now set the type manually through the UI but having the ability to set them via a script would round out the flow. By manually setting it, you would be exposing that 'secret' value toover the shoulder
attacks until you have set the type and then hit save to mask the value.The
.set()
function already has a 3rd optional arg for thetype
but as 'secret' isn't in the Variable Types it would fallback to 'default'.Describe the solution you'd like
Using the sandbox environment to set the variable type. A basic example of getting an access token value from a response body and then setting this as a secret variable:
Describe alternatives you've considered
The Postman API can be used to programmatically set the
type
which could be done in a script using thepm.sendRequest()
function but that seems a bit too long-winded to achieve what could be done in theset()
function.Additional context
No response