matin / garth

Garmin SSO auth + Connect Python client
MIT License
305 stars 22 forks source link

Set domain on OAuth1 token #25

Closed matin closed 1 year ago

matin commented 1 year ago

Whatever domain is being used during the original login is the same one that should continue to be used with the OAuth1 token. This change saves the domain on the OAuth1 token to ensure the correct domain is using when loading from a saved token.

This closes #24, which addresses the issue that caused #21.

This change is fully backwards compatible. The domain is only configured if there's one that's saved. If none is saved, the prior behaviors continues.

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (515933f) 100.00% compared to head (4a55056) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #25 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 29 29 Lines 1035 1036 +1 ========================================= + Hits 1035 1036 +1 ``` | [Flag](https://app.codecov.io/gh/matin/garth/pull/25/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/matin/garth/pull/25/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi) | `100.00% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/matin/garth/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi) | Coverage Δ | | |---|---|---| | [garth/auth\_tokens.py](https://app.codecov.io/gh/matin/garth/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi#diff-Z2FydGgvYXV0aF90b2tlbnMucHk=) | `100.00% <100.00%> (ø)` | | | [garth/http.py](https://app.codecov.io/gh/matin/garth/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi#diff-Z2FydGgvaHR0cC5weQ==) | `100.00% <100.00%> (ø)` | | | [garth/sso.py](https://app.codecov.io/gh/matin/garth/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi#diff-Z2FydGgvc3NvLnB5) | `100.00% <100.00%> (ø)` | | | [garth/version.py](https://app.codecov.io/gh/matin/garth/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi#diff-Z2FydGgvdmVyc2lvbi5weQ==) | `100.00% <100.00%> (ø)` | | | [tests/conftest.py](https://app.codecov.io/gh/matin/garth/pull/25?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matin+Tamizi#diff-dGVzdHMvY29uZnRlc3QucHk=) | `100.00% <ø> (ø)` | |

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