-
Notifications
You must be signed in to change notification settings - Fork 926
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
Fix openstack v3 authentication #744
Conversation
Great, thanks! I will do a proper review later, but from a quick glance, it looks like it would be great to add some more tests to cover all the (edge) cases. |
@Kami I don't know how to add tests for this fix because I need to check the body of the request but all tests seems to test the reply. To test the body of the request I have to do it in |
timeout=None, parent_conn=None): | ||
super(OpenStackIdentityConnection, self).__init__(user_id=user_id, | ||
key=key, | ||
url=auth_url, | ||
timeout=timeout) | ||
|
||
self.auth_url = auth_url |
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.
(just thinking out loud)
I assume you removed those attributes since they are duplicated aka are declared again a couple of lines below, right?
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.
Right
@Kami: Now default values are specified in the method signature. |
:type token_scope: ``str`` | ||
""" | ||
super(OpenStackIdentity_3_0_Connection, | ||
self).__init__(auth_url=auth_url, | ||
user_id=user_id, | ||
key=key, | ||
tenant_name=tenant_name, | ||
domain_name=domain_name, | ||
token_scope=token_scope, | ||
timeout=timeout, | ||
parent_conn=parent_conn) |
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.
I would suggest to change that code to:
def __init__(self, *args, **kwargs):
# Docstring
super(OpenStackIdentity_3_0_Connection, self).__init__(*args, **kwargs)
So the signature doesn't have to be specified twice.
But I know that kwargs
are not appreciated, so tell me if you want me to do this change or not.
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.
@schaubl this is a clear case to use kwargs, its not that the project dictates not using kwargs but in the case where the keyword arguments can be listed they can.
this is fine as is.
@schaubl Thanks. I will review the changes again and if everything looks good go ahead and merge them intro trunk. |
Merged, thanks! |
Fix openstack v3 authentication
Description
This PR allows to define the OpenStack
domain
to another value that the defaultDefault
.It also adds the ability to define the
scope
of the token.With the code for the OpenStack Identity API v3, two new parameters were added:
domain_name
andtoken_scope
but it was impossible to define them to a value other than their respective default.Status
Checklist (tick everything that applies)
ICLA (required for bigger changes)