#112 [RFE] copr-cli whoami
Closed 7 years ago Opened 7 years ago by frostyx.

From time to time I would appreciate a simple command for copr-cli which would print parsed information from config - mainly the username. Example usage

$ copr-cli whoami
frostyx

This would be enough for simple refactoring of beaker tests, so clime would not have to be hardcoded into some (sanity) tests and only thing that would matter would be passed config file.

The command might also be more complex and dump all non-secret settings in some fancy format (such as json or just key: value pairs).

IIRC, I never needed more than just whoami, so I would be ok with simply that.


Does this require authentication against frontend? I mean -- do you want to know who you really are (or are not), or it is enough to know who you maybe just pretend to be :)?

If you needed authentication, @dturecek is working on slightly related bug https://bugzilla.redhat.com/show_bug.cgi?id=1431035 which could need inventing some cheap message between frontend/client (similar to whoami).

OTOH, if you don't have to contact frontend -- I have no preference (I usually read the file directly); though I would suggest you to not use whoami but rather authconfig or something which doesn't promise too much.

From time to time I would appreciate a simple command for copr-cli which would print parsed information from config - mainly the username. Example usage
$ copr-cli whoami
frostyx

This would be enough for simple refactoring of beaker tests, so clime would not have to be hardcoded into some (sanity) tests and only thing that would matter would be passed config file.
The command might also be more complex and dump all non-secret settings in some fancy format (such as json or just key: value pairs).
IIRC, I never needed more than just whoami, so I would be ok with simply that.

This sounds like quite a nice idea.

Does this require authentication against frontend?

I understand the difference, that you are talking about @praiskup, but honestly both implementations suits my use-case, so I am not going to force one over the other.

Personally I just don't want to parse the config file. I am good enough with copr-cli command for

>>> from copr import CoprClient
>>> client = CoprClient.create_from_file_config(...)
>>> client.username

Metadata Update from @clime:
- Issue status updated to: Closed (was: Open)

7 years ago

Log in to comment on this ticket.

Metadata