inbo / iassetR

Interact with the iAsset api using R
https://inbo.github.io/iassetR/
Other
0 stars 1 forks source link

my attempt at allowing storage of password in Sys env #38

Closed SanderDevisscher closed 4 months ago

SanderDevisscher commented 5 months ago

fixes #20

probably not really best practice but since we are not going to use iAsset for much longer I think we just need to make some progress. Can you take a look at this PR and also #31 ? I need both to make progress with https://github.com/inbo/aspbo/issues/8.

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (a501cb1) to head (f504bd3).

Files Patch % Lines
R/get_access_token.R 0.00% 28 Missing :warning:
R/get_username.R 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #38 +/- ## ===================================== Coverage 0.00% 0.00% ===================================== Files 4 5 +1 Lines 131 160 +29 ===================================== - Misses 131 160 +29 ```

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

PietrH commented 5 months ago

Something like this is best practise: https://blog.r-hub.io/2024/02/28/key-advantages-of-using-keyring/

rgbif works similar to your implementation.

PietrH commented 5 months ago

For the record, I would it if you could rewrite using keyring. But understand if you, like me, are out of time budget.

SanderDevisscher commented 5 months ago

@PietrH in my honest opinion, if a widely used package like rgbif works in a similar way, why should we do more? especially since we will be using this package for a relative short time (at least until june). Also I don't have enough time to properly dive into the specifics of keyring. So if you could just approve this PR so I can continue?

PietrH commented 5 months ago

Because GBIF doesn't handle personal information like iAsset does.

SanderDevisscher commented 5 months ago

Because GBIF doesn't handle personal like iAsset does.

TRUE, I'll try my best to implement keyring

PietrH commented 5 months ago

I'm attending a hackathon all of next week, but if you set me as reviewer I'll get to it as soon as I can

SanderDevisscher commented 5 months ago

@PietrH I've implemented (or at least attempted to implement) keyring. Can you review again ?

PietrH commented 5 months ago

I propose the following:

Tell me if this is too much, or if you get stuck, let me know and I'll help. If it's me causing extra work, I might as well do some of it.

PietrH commented 4 months ago

I'm having second thoughts about depreciating the username argument... I don't want to break existing scripts, or complicate the usage in github actions. So perhaps making it optional is an option, and then adding a helper that can fetch the username from the keyring...

SanderDevisscher commented 4 months ago

I'm having second thoughts about depreciating the username argument... I don't want to break existing scripts, or complicate the usage in github actions. So perhaps making it optional is an option, and then adding a helper that can fetch the username from the keyring...

ok for me

PietrH commented 4 months ago

@SanderDevisscher I'm done with my changes, can you take a look at this?

SanderDevisscher commented 4 months ago

@PietrH I expanded the error you get when you have more than 1 username associated with the "iasset_password" - service just so users (mainly myself) knows what to do to delete the unneeded usernames.

For the rest Its ok for me ! So whats next ? I Merge this PR ? Do you redo your review ?

PietrH commented 4 months ago

Nicely done!

If it's ok by you, it's ok by me. Go ahead and merge!