-
Notifications
You must be signed in to change notification settings - Fork 74
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
cern: allow users based on 'IdentityClass' #181
cern: allow users based on 'IdentityClass' #181
Conversation
Lightweight accounts do not have a |
The external id is treated as a string so probably not an issue as long as the two doesn't conflict. Did you try it out? |
@lnielsen it appears that all of them are treated as string, no? I would go for string to be safe, and then let who is using that value do the parsing and eventually fail in a controlled manner. @zzacharo I would also add, if the @lnielsen agrees, a new config variable for |
What was the conclusion in the end - that we close or integrate this PR? |
There was no further discussion I guess... Integrate? @zzacharo? |
7e3cc12
to
48e6075
Compare
e84c133
to
0a4ad05
Compare
invenio_oauthclient/errors.py
Outdated
@@ -71,3 +71,7 @@ def __init__(self, message, remote, response): | |||
super(OAuthClientError, self).__init__( | |||
self.description or message, remote, response | |||
) | |||
|
|||
|
|||
class OauthCernRejectedAccountError(OAuthResponseError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OAuthCERNRejectedAccountError
(sorry to be annoying with the naming)
invenio_oauthclient/handlers.py
Outdated
@@ -227,6 +228,11 @@ def inner(*args, **kwargs): | |||
return oauth2_handle_error( | |||
e.remote, e.response, e.code, e.uri, e.description | |||
) | |||
except OauthCernRejectedAccountError as e: | |||
current_app.logger.warning(e.message, exc_info=True) | |||
flash(_('Cern account not allowed.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cern -> CERN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine for me, just the naming. However, @pamfilos or @tiborsimko should have a look at it since I'm not familiar with the CERN OAuth.
0a4ad05
to
220c0c1
Compare
220c0c1
to
5ea4b79
Compare
@tiborsimko can you please check this PR so we can merge it if you don't see any problem? |
c05719f
to
2430e1c
Compare
closes #178 .