awslabs / aws-crt-nodejs

NodeJS bindings for the AWS Common Runtime.
Apache License 2.0
40 stars 27 forks source link

Update Auth Interface #319

Closed xiazhvera closed 2 years ago

xiazhvera commented 2 years ago

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 8dafe85fdbc3881b08f76638207cf8e6f31fe32d into 05389e312a95b5d4377b4b9a745353f390dde45a - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 57154d68f0ef93dfd29e878bdb4277b4098da70a into 05389e312a95b5d4377b4b9a745353f390dde45a - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 0a1b2f9bd10b91d75b2b57d4e75951edecd3d4ac into 05389e312a95b5d4377b4b9a745353f390dde45a - view on LGTM.com

new alerts:

xiazhvera commented 2 years ago

Update the PR with code review.

  1. Move the Credentials Provider implementation to samples
  2. Moved the credentials_provider from WebsocketConfig to MqttConnectionConfig on browser side. For native, it will involve more interface changes, so I leave it as it is for now.

Other Issues: aws_region: Currently still leave it in AWSCredentials as it is also needed for signing functions. refreshCredential: refreshCredential() and Expiration_intervalL is used to refresh the session in advance. Since mqtt.js does not support promises, we use refreshCredential function to handles application-level authentication refreshing so that the websocket connection could simply grab the latest valid tokens when getCredentials() get called.