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

Enable to specify project id in OpenStack OIDC auth #1293

Merged
merged 3 commits into from Jun 22, 2019

Conversation

micafer
Copy link
Contributor

@micafer micafer commented May 31, 2019

Enable to specify project id in OpenStack OIDC auth

Description

In current implementation the OpenStack OIDC auth the first project available is selected.
This PR enables to specify the project id using the domain_name (as the tenant_name attribute is used to specify the protocol). The domain_name attribute can be used either to select the domain name in case of domain scoped token or to select the project name in case of project scoped token

Status

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

@codecov-io
Copy link

Codecov Report

Merging #1293 into trunk will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk    #1293      +/-   ##
==========================================
+ Coverage   85.95%   85.95%   +<.01%     
==========================================
  Files         359      359              
  Lines       73911    73916       +5     
  Branches     6705     6708       +3     
==========================================
+ Hits        63530    63535       +5     
+ Misses       7699     7698       -1     
- Partials     2682     2683       +1
Impacted Files Coverage Δ
libcloud/test/common/test_openstack_identity.py 98.06% <50%> (ø) ⬆️
libcloud/common/openstack_identity.py 75.89% <71.42%> (-0.11%) ⬇️
libcloud/test/compute/test_ec2.py 97.9% <0%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a948b1...f096db4. Read the comment docs.

@Kami
Copy link
Member

Kami commented Jun 22, 2019

Thanks for the contribution.

Can you please also open a PR with a corresponding documentation change (ideally with a code example on how to specify a project)?

return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK])
raise NotImplementedError()

def _v3_auth_projects(self, method, url, body, headers):
if method == 'GET':
# get user projects
body = json.dumps({"projects": [{"id": "project_id"}]})
body = json.dumps({"projects": [{"id": "project_id", "name": "project_name"},
Copy link
Member

Choose a reason for hiding this comment

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

It would also be good to add a test case for scenario where invalid project id is specified.

@asfgit asfgit merged commit f096db4 into apache:trunk Jun 22, 2019
asfgit pushed a commit that referenced this pull request Jun 22, 2019
@Kami
Copy link
Member

Kami commented Jun 22, 2019

I went ahead and merged it into trunk, but I would appreciate if you can open a new PR with corresponding documentation and tests change.

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

Successfully merging this pull request may close these issues.

None yet

4 participants