dapr / js-sdk

Dapr SDK for Javascript
Apache License 2.0
194 stars 82 forks source link

If an api token is not passed in the constructor, check the env variable #548

Closed elena-kolevska closed 10 months ago

elena-kolevska commented 10 months ago

Description

Adds the possibility to get an api token from the standard environment variable, as described in this proposal https://github.com/dapr/proposals/blob/main/0010-S-unified-api-token-env-variable.md

Issue reference

https://github.com/dapr/js-sdk/issues/547

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

codecov[bot] commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0fb83c1) 100.00% compared to head (887f55c) 35.30%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #548 +/- ## ============================================ - Coverage 100.00% 35.30% -64.70% ============================================ Files 1 91 +90 Lines 6 10447 +10441 Branches 1 411 +410 ============================================ + Hits 6 3688 +3682 - Misses 0 6700 +6700 - Partials 0 59 +59 ``` | [Files](https://app.codecov.io/gh/dapr/js-sdk/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr) | Coverage Δ | | |---|---|---| | [src/utils/Settings.util.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL3V0aWxzL1NldHRpbmdzLnV0aWwudHM=) | `75.00% <100.00%> (ø)` | | | [src/utils/Client.util.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/548?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL3V0aWxzL0NsaWVudC51dGlsLnRz) | `43.26% <0.00%> (ø)` | | ... and [88 files with indirect coverage changes](https://app.codecov.io/gh/dapr/js-sdk/pull/548/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.