Skip to content
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

Use X.509 credentials specified in rucio.cfg with gfal operations #3957

Closed
mkszuba opened this issue Aug 25, 2020 · 3 comments
Closed

Use X.509 credentials specified in rucio.cfg with gfal operations #3957

mkszuba opened this issue Aug 25, 2020 · 3 comments

Comments

@mkszuba
Copy link

mkszuba commented Aug 25, 2020

Motivation

(Note: for simplicity I shall discuss this for the auth_type = x509_proxy scenario, that said the same applies to 'x509')

It would IMHO be very useful if the Rucio client set the X.509 credentials of gfal operations to those Rucio itself uses. As things stand now, 'rucio download' and 'rucio upload' end up looking for the proxy certificate in /tmp/x509up_u${UID} regardless of what the value of client_x509_proxy in rucio.cfg is - and unless gfal2 or its Python bindings feature some magic environment variables for this purpose, there doesn't seem to currently be a way of changing this behaviour. This can lead to somewhat confusing behaviour when interactions with the Rucio server itself work fine but things break as soon as a file transfer is to be executed.

Modification

At a quick glance at the code, it seems this would be a simple matter of extending rucio.rse.protocols.gfal.connect() to set additional option strings on the newly created gfal2 context:

  • for 'x509_proxy', X509/CERT
  • for 'x509', X509/CERT and X509/KEY

similarly to how it is already done with bearer tokens. I haven't tested this yet, though.

@mkszuba mkszuba changed the title Use X.509 credentials specified in rucio.cfg with gfal operations [client] Use X.509 credentials specified in rucio.cfg with gfal operations Aug 25, 2020
@mlassnig
Copy link
Contributor

mlassnig commented Aug 25, 2020

Hi @mkszuba

yes, you are absolutely right. By default gfal uses the X509_USER_PROXY, or alternatively the X509_USER_CERT & X509_USER_KEY environment variables. My suggestion would be to check if these variables exist, and if not use the values from the rucio.cfg

Would that be an ok approach?

@mkszuba
Copy link
Author

mkszuba commented Aug 27, 2020

Makes sense to me - that way these variables will not suddenly stop working for people who do use them. Moreover, from what I can see in the code rucio-clients already support X509_USER_PROXY - albeit only for certain protocols (it would probably make sense to perform the relevant environment lookups only once, e.g. while populating self.creds in baseclient).

@bari12
Copy link
Member

bari12 commented Jun 3, 2021

Needs to be added here

def connect(self):

@bari12 bari12 changed the title [client] Use X.509 credentials specified in rucio.cfg with gfal operations Use X.509 credentials specified in rucio.cfg with gfal operations Jun 3, 2021
@rcarpa rcarpa self-assigned this Jul 2, 2021
rcarpa added a commit to rcarpa/rucio that referenced this issue Sep 21, 2021
…cio#3957

It is only used if the gfal context wasn't already configured to
use other credentials. This is done to avoid breaking existing
configurations.
rcarpa added a commit to rcarpa/rucio that referenced this issue Oct 18, 2021
…cio#3957

It is only used if the gfal context wasn't already configured to
use other credentials. This is done to avoid breaking existing
configurations.
rcarpa added a commit to rcarpa/rucio that referenced this issue Oct 19, 2021
…cio#3957

It is only used if the gfal context wasn't already configured to
use other credentials. This is done to avoid breaking existing
configurations.
bari12 added a commit that referenced this issue Oct 26, 2021
…_rucio_cfg

Protocols: allow usage of rucio.cfg x509 proxy for gfal operations #3957
bari12 pushed a commit that referenced this issue Oct 26, 2021


It is only used if the gfal context wasn't already configured to
use other credentials. This is done to avoid breaking existing
configurations.
@bari12 bari12 added this to the 1.26.8-clients milestone Oct 26, 2021
@bari12 bari12 closed this as completed Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants