#72 refine login failed message of all authentications fail
Closed by julian8628. Opened by julian8628.
julian8628/koji login-failed-msg  into  master

Download 72.patch
  • fix issue#57
  • show available authtypes
  • show the information for each authtype. for "ssl", show current cert locations
  • show using --authtype=noauth to skip authentication phase.

  • fix issue#155

rebased

1 new commit added

  • test

rebased

update this PR

  • create a class ClientAuthHandler to build the login logic
  • if no --authtype specified, SSLAuthHandler.login() will always try first
  • UnitTests haven't been added

@xning, @mikem, please have a look

update this PR

create a class ClientAuthHandler to build the login logic
if no --authtype specified, SSLAuthHandler.login() will always try first
UnitTests haven't been added

@xning, @mikem, please have a look
The OrderedDict is not available on the RHEL5, perhaps you can try the list of tuples.

1 new commit added

  • [cli] change OrderedDict to [(tuple)]

It's an interesting approach. More verbose than I expected.

I don't think the output from an auth failure is going to help most folks, though. Here is are some example errors:

Unable to log in, no authentication methods available, or all authentication met
hods failed.
                        [Auth-Trace] :
                            - [0] ssl: {'proxyuser': None, 'serverca': '/home/mi
ke/.fedora-server-ca.cert', 'cert': '/home/mike/.fedora.cert', 'ca': '~/.fedora-
server-ca.cert', 'error': "Error: [('SSL routines', 'SSL3_READ_BYTES', 'sslv3 al
ert certificate expired'), ('SSL routines', 'SSL3_READ_BYTES', 'ssl handshake fa
ilure')]"}
    - [1] kerberos: {'proxyuser': None, 'error': 'AuthError: Kerberos authentica
tion failed: Ticket expired (-1765328352)', 'keytab': None, 'principal': None}
                        using --authtype=noauth to skip login phase

and

Unable to log in, no authentication methods available, or all authentication met
hods failed.
                        [Auth-Trace] :
                            - [0] kerberos: {'proxyuser': None, 'error': 'AuthEr
ror: Kerberos authentication failed: Ticket expired (-1765328352)', 'keytab': No
ne, 'principal': None}
                        using --authtype=noauth to skip login phase

When auth goes wrong, what the user needs to know is:

  1. what type of auth was attempted
  2. some info on the auth parameters

I.e. similar information to what the hello output generates when successful.

@mikem
I'll add the help info in the trace.
Would I remove the error msg from it?

rebased

1 new commit added

  • [cli] unittests for login handlers

please avoid merges within pull requests

5 new commits added

  • [cli] unittests for login handlers
  • [cli] improve the stderr info
  • [cli] change OrderedDict to [(tuple)]
  • [cli] adjust activate_session logic
  • refine login failed message of all authentications fail

rebased

updated

rebased

It is already on line 2

rebased

@tkopecek updated

rebased

1 new commit added

  • move cli.activate_session() to koji.ClientSession.activate()

Updated for ISSUE #155

  1. I moved cli.activate_session() to koji.ClientSession.activate()

  2. error msg is always passed to invokers wrapped by Exception. Invoker could decide if print it or not.

@mikem
Is it over-pattern to seperate the logic by increase the code from 20 lines to about 200 lines?

I'd rather not change the signature of the (still local) activate_session function.

Needs a rebase, which is painful as-is, but becomes painless if you follow the above and amend the last commit. I have done so here

https://github.com/mikem23/koji-playground/tree/login-failed-msg-2

@mikem
Is it over-pattern to seperate the logic by increase the code from 20 lines to about 200 lines?

a bit. It's not necessarily a problem, but it does seem like a lot of change to accomplish the stated goal.

I'd rather not change the signature of the (still local) activate_session function.
Needs a rebase, which is painful as-is, but becomes painless if you follow the above and amend the last commit. I have done so here
https://github.com/mikem23/koji-playground/tree/login-failed-msg-2

rebased.
I found a bug in my last commit, I tried to change global options to signature args of activate_session following your comment in issue#155

This also means refactoring this a bit. No more global options. Probably shouldn't print.
This probably also ties into PR #72

But a lots of handler functions would change the value of options.
Rollbacking to no change for global options could avoid this.
Would we change the signature of global options to make it clearer differing from handler options?

rebased

rebased onto 8bc920c912a138fc5688972a3c66994041212f56

cancel this PR, since it looks not good enough nowadays

Pull-Request has been closed by julian8628

Metadata