tdviet / fedcloudclient

EGI FedCloud Client
https://fedcloudclient.fedcloud.eu
MIT License
8 stars 10 forks source link

Clarify env commands and their intended usage #70

Closed thebe14 closed 3 years ago

thebe14 commented 3 years ago

Why is the command fedcloud endpoint env printing the token but the command fedcloud site env not printing the token, instead prints a reminder to set it?

tdviet commented 3 years ago

fedcloud endpoint env needs an access token as input parameter for making probes to sites. As the command already has the access token, it is easy to print it to output.

fedcloud site env, like all other fedcloud site subcommands, doesn't need access tokens, all information can be retrieved from the site configurations without authentication. Access tokens typically expire in one hour, so users need to refresh them frequently. It may be more convenient to tell users how to set OS_ACCESS_TOKEN separately, so they can refresh just the token without running the command again.

Forcing users to submit access tokens to the command as input parameters just for printing it to output seems unfriendly for me. On the other hand, having two similar commands with different behaviors is really confusing, too.

fedcloud endpoint env command (and whole endpoint.py) has much longer history, but I expect it will slowly expires after creating fedcloud site env in site.py. The project_id in the fedcloud endpoint subcommands is difficult to get and remember, it is more friendly to use VO name in the site.py module.

tdviet commented 3 years ago

Compromise: if access token is available (e.g. OIDC_AGENT_ACCOUNT is set), OS_ACCESS_TOKEN will be set, otherwise print reminder https://github.com/tdviet/fedcloudclient/pull/77