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

Created AbstractAuthenticator and made necessary updates to LdapLogin #822

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

marcus-oscarsson
Copy link
Member

@marcus-oscarsson marcus-oscarsson commented Nov 30, 2023

Greetings from the MXCuBE meeting :)

Introduced AbstractAuthenticator and made necessary updates to LdapLogin

This also means that we should move the authenticate call from ISPyBclient to the the authenticate/login
logic.

All *LdapLogin classes have been updated so that they care now call *Authenticator

Copy link

github-actions bot commented Nov 30, 2023

Coverage

Coverage Report •
FileStmtsMissCoverMissing
mxcubecore/HardwareObjects
   Beamline.py30710267%145–159, 271, 293, 337, 348, 370, 426, 438, 449, 460, 482, 493, 506, 517, 528, 539, 550, 561, 572, 583, 594, 606, 621, 632, 645, 656, 671, 682, 693, 709, 725, 742–828, 835–845, 848, 851–862
   LdapAuthenticator.py1021020%7–185
mxcubecore/HardwareObjects/abstract
   AbstractAuthenticator.py13130%22–50
mxcubecore/HardwareObjects/mockup
   ISPyBClientMockup.py2082080%5–725
   LdapAuthenticatorMockup.py13130%1–30
TOTAL59311548208% 

Tests Skipped Failures Errors Time
1925 0 💤 0 ❌ 0 🔥 1m 34s ⏱️

@marcus-oscarsson marcus-oscarsson changed the title Created AbstractAuthenticator and made necessary updates for the LdapLogin Created AbstractAuthenticator and made necessary updates to LdapLogin Nov 30, 2023
@marcus-oscarsson
Copy link
Member Author

@rhfogh, @MartinSavko: Do you see an issue with this on the Qt client side ?

@rhfogh
Copy link
Collaborator

rhfogh commented Dec 12, 2023

I am a little confused. I do not see AbstractAuthenticator or the relevant mockup anywhere in either code or config files, in the PR or the pre-existing code. Should they not be there?

Copy link
Collaborator

@rhfogh rhfogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify where the AnstractAuthernticator mentioned is supposed to live.

@marcus-oscarsson marcus-oscarsson force-pushed the mo-abstract-authenticator branch from f719c18 to 4f29862 Compare December 12, 2023 12:12
@marcus-oscarsson
Copy link
Member Author

@rhfogh :) thanks, I forgot to add those files, done now

Copy link
Collaborator

@rhfogh rhfogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typos. Apart from that OK on my side - a standard mockup run works without trouble. But then I do not use authentication anyway, so I can hardly speak for that part.

def get_field_values(self):
return self._field_values

def invlidate(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: invalidate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;) Thanks !

super().init()

@abc.abstractmethod
def authenticte(self, username: str, password: str) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: authenticate

This one is still spelled wrong

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh my, I'm need to go the eye doctor :) thanks !

@marcus-oscarsson marcus-oscarsson force-pushed the mo-abstract-authenticator branch from 9f3965f to b61fdf0 Compare December 12, 2023 13:04
@fabcor-maxiv
Copy link
Contributor

Does this pull request imply some changes that a facility should make in their facility-specific code? Or is that intended to be "backwards compatible" so to say?

And this pull request from the web part mxcube/mxcubeweb#1140 is required, is that right? Or are the 2 pull requests independent?

@marcus-oscarsson
Copy link
Member Author

marcus-oscarsson commented Dec 12, 2023

This PR and mxcube/mxcubeweb#1140 are independent. It makes it possible to decouple the authentication bit from the ISPyB client (for instance in your case ISPyBrestClient) from the rest.

EDIT The actual decoupling of ISPyB and authentication is for a future PR

@marcus-oscarsson marcus-oscarsson merged commit fa5dfe4 into develop Dec 12, 2023
10 checks passed
Comment on lines +744 to +745
("Using Authenticatior from ISPyBClient is depricated,
"use Authenticator to authenticate spereatly and then login to ISPyB"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid syntax, is it? Maybe missing a closing " on line 744.
I am confused, if I am right and it is not valid syntax, then shouldn't it immediately fail? :D

(Also typo: "deprecated" not "depricated".)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - this is invalid - my editor says so too. Maybe ISPyBClient is not imported?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was missing a "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants