r-lib / keyring

:closed_lock_with_key: Access the system credential store from R
https://keyring.r-lib.org/
Other
196 stars 28 forks source link

Patching wincred backend to include encoding options #88

Closed awong234 closed 3 years ago

awong234 commented 4 years ago

Addresses #85 .

Setter updates

Getter updates

All tests pass.

I consider this to be draft status; while all tests pass and the intended functionality of getting and setting encodings in 92% of all values in iconvlist() works (python included), a few outstanding issues/questions remain:

Thank you for your review!

gaborcsardi commented 3 years ago

Thanks! This is a big PR, so I'll get to it near the next keyring release. Just one quick question now:

Updates b_wincred_set_with_value, encoding the password with an encoding if and only if a) and option is set or b) and environment variable is set.

Isn't this a breaking change?

awong234 commented 3 years ago

Hi Gabor, thank you for taking a look. I think that it wouldn't be a breaking change (although certainly correct me if I am mistaken) because the API was not changed, and the user experience was kept the same so old scripts will not break. My statement that you quoted is misleading, I apologize; if nothing is explicitly done by the user (by setting an option, or environment variable), then the behavior of keyring is the same as before.

Details

If a user desires a specific encoding it is obtained via a new function get_encoding_opt, which

This is then passed to b_wincred_decode, which is passed the encoding obtained from get_encoding_opt, and either uses b_wincred_decode_auto (which just wraps around existing encoding behavior), or encodes with the users' specified encoding.

codecov-commenter commented 3 years ago

Codecov Report

Merging #88 (c1c5fbd) into master (c91e87d) will decrease coverage by 0.58%. The diff coverage is 0.00%.

:exclamation: Current head c1c5fbd differs from pull request most recent head e570f8f. Consider uploading reports for the commit e570f8f to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #88      +/-   ##
==========================================
- Coverage   32.78%   32.19%   -0.59%     
==========================================
  Files          15       15              
  Lines        1269     1292      +23     
==========================================
  Hits          416      416              
- Misses        853      876      +23     
Impacted Files Coverage Δ
R/api.R 35.29% <ø> (ø)
R/backend-wincred.R 0.00% <0.00%> (ø)
R/utils.R 25.00% <0.00%> (-10.49%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c91e87d...e570f8f. Read the comment docs.

gaborcsardi commented 3 years ago

Thanks, merged now!

awong234 commented 3 years ago

Just reviewed the commits, thanks for the review & merge Gabor! Glad to have helped.