Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecretsManager.getSecretValue returns a string instead of an object #9

Open
maanenh opened this issue Mar 20, 2020 · 5 comments
Open

Comments

@maanenh
Copy link

maanenh commented Mar 20, 2020

The SecretsManager.getSecretValue method should return an object with signature:

     * @param data {Object} The de-serialized data returned from the request. Set to <tt>null</tt> if a request error occurs.
     * @param data.ARN {String} The ARN of the secret.
     * @param data.Name {String} The friendly name of the secret.
     * @param data.VersionId {String} The unique identifier of this version of the secret.
     * @param data.SecretBinary {Buffer|TypedArray|Blob|String} The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array.

But instead of an object, it returns a string that containts the stringified Json object.

@fufranci
Copy link

Is the stringified json object in err (1st param) or data (2nd param) of the callback?

https://github.com/aws/aws-greengrass-core-sdk-js/blob/master/aws-greengrass-core-sdk/secretsmanager.js#L107

@maanenh
Copy link
Author

maanenh commented Mar 25, 2020

It is in data (2nd param) in the case of a successful response.

@hui-yang
Copy link

Hi @maanenh ,
Correct me if I'm wrong, you didn't run into any functional error of the getSecretValue(params, callback) method call. Instead you are trying to point out that the return value type here does not match the documentation
https://github.com/aws/aws-greengrass-core-sdk-js/blob/master/aws-greengrass-core-sdk/secretsmanager.js#L105
It should parse the string response into a Json object before callback.

Does this correctly describe the issue you came across?

@maanenh
Copy link
Author

maanenh commented Apr 17, 2020

Hi @hui-yang ,
Indeed. It should parse the response to Json before the callback.

@sushantAtAws
Copy link

Thanks @maanenh. We have updated the documentation for now. The bug will be fixed (response will be Json object) in future release of the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants