Allow LookupUser via usrname

Bug #2065343 reported by Jason Stephenson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NCIPServer
New
Undecided
Unassigned

Bug Description

To go along with the change to allow authentication with usernames in bug 2018615, it might be convenient to allow LookupUser to check for the patron's usrname in addition to barcode. A possible implementation was discussed in IRC on 2024-05-09: http://irc.evergreen-ils.org/evergreen/2024-05-09#i_551688.

I like the approach of adding a new function retrieve_user_by_usrname to complement retrieve_user_by_barcode.

I think the new implementation should try retrieve_user_by_barcode, if that fails it should then try retreieve_user_by_usrname, and report a problem if the latter fails. I suppose that could all be wrapped into a single function: retrieve_user_by_barcode_or_usrname, if we're feeling spicy.

Tags: pullrequest
Revision history for this message
Jason Boyer (jboyer) wrote :

I did not feel spicy yesterday, but there's a small branch that does the thing (at least for LookupUser) here: https://git.evergreen-ils.org/?p=working/NCIPServer.git;a=shortlog;h=refs/heads/user/jboyer/lp2065343_username_login / working/user/jboyer/lp2065343_username_login

Presently the user's primary barcode is still returned rather than their username, though I suspect this is actually a feature as it avoids remote systems having to know that johnqpub and 1234576 are the same accounts.

tags: added: pullrequest
Revision history for this message
Jason Boyer (jboyer) wrote (last edit ):

Something I did not notice initially is that this branch requires the patch from bug 2018615 (including Jason's "login via identifier" followup. (Which is to say that main + this branch alone will definitely not work.)

Additionally, because of the number of patches in the air that touch auth this does not yet work with the "Require patron auth" patch, though that should be a very simple issue to fix.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Jason, thanks for getting to this! I'll take a look in a few days.

I pushed bug 2018615 to main yesterday. You could rebase on main and it should be good.

Revision history for this message
Jason Stephenson (jstephenson) wrote (last edit ):

Oh, duh! I'm an idiot. I was thinking of bug 2064296 when I said I pushed it to main yesterday.

To me, it makes sense having this branch require the other since I envision this as a follow up to the other. We'll call it a happy accident in the spirit of Bob Ross.

I rebased my branch on bug 2018615, yesterday: user/dyrcona/lp2018615-rebase-signoff.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.