IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
227 stars 119 forks source link

Use new IIASA-manager API with token refresh #684

Closed danielhuppmann closed 2 years ago

danielhuppmann commented 2 years ago

Please confirm that this PR has done the following:

Description of PR

This PR refactors the IIASA-manager-API authentication to the new (short-lived) token, including automated refresh. The PR also stricter behavior when reading a config file fails, and adds explicit test if arguments are missing from the credentials.

We decided to leave the current legacy-implementation for the anonymous login and application-list, because these features will change with the new ixmp package.

meksor commented 2 years ago

The equivalent to the anonymous login would be logging in as the "guest" user. Although I don't know if that user has a usable password set yet.

codecov[bot] commented 2 years ago

Codecov Report

Merging #684 (2dc4f6f) into main (1fc2fee) will decrease coverage by 0.0%. The diff coverage is 76.6%.

@@           Coverage Diff           @@
##            main    #684     +/-   ##
=======================================
- Coverage   94.7%   94.7%   -0.1%     
=======================================
  Files         59      59             
  Lines       5807    5836     +29     
=======================================
+ Hits        5504    5529     +25     
- Misses       303     307      +4     
Impacted Files Coverage Δ
pyam/iiasa.py 86.1% <72.3%> (-0.7%) :arrow_down:
tests/test_iiasa.py 97.1% <100.0%> (+0.2%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

danielhuppmann commented 2 years ago

The equivalent to the anonymous login would be logging in as the "guest" user. Although I don't know if that user has a usable password set yet.

Ok, not sure if the "guest" user should have a password... Let's discuss next week.