-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 2FA and any .netrc file #61
Conversation
Very cool addition! I hadn't the use of encrypted .netrc files, looks widely useful. |
I'm wondering whether We could have a I think it'd be better to do some refactoring like decoupling Also it seems search operations don't need us to be authenticated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look like it works for me, though I didn't check the 2FA yet since I haven't set that up in my account. Specifying the netrc file location seems useful, since I was just told that someone had problems running this in an environement with no $HOME
defined
Oh weird, somehow I didn't see the comment, maybe github didn't update it while I was approving
I think that sounds like a great idea.
Agreed that the design is poor right now. A change like that would improve things, as it shouldn't be hard to pass a token. The origin of the repo as "phd code that I just wanted nice for me" is creeping in
An even better reason to decouple the access token request |
OK. I'll look into it. I don't know how long the access_token stays valid. I'll have to check that first. |
This PR enables two things
Two-Factor authentication on CDSE
Current implementation was not compatible with accounts where 2FA is enabled. The related API is described on https://documentation.dataspace.copernicus.eu/APIs/Token.html
As I wasn't sure how to know whether the account requires 2FA, I didn't try to ask interactively for the 2FA token at the last moment.
Support
.netrc
stored in any locationI don't store my
.netrc
directly under$HOME
, but elsewhere. I've introduced the same option as the one supported by curl:--netrc-file
I'd have loved to support encrypted.netrc
-- which I use with git thanks togit-netrc-credential
. Alas I'm afraid this will introduce an unwelcome dependency.Note that this will also permit to support encrypted
.netrc
files out-of-the box thanks to:eof -d 2023-12-09 --netrc-file <(gpg -d ~/.config/.netrc.gpg | grep -v protocol)
Finally
I haven't updated version number.