Skip to content

Enable to specify project id in OpenStack OIDC auth#1293

Merged
asfgit merged 3 commits intoapache:trunkfrom
micafer:oidc_project
Jun 22, 2019
Merged

Enable to specify project id in OpenStack OIDC auth#1293
asfgit merged 3 commits intoapache:trunkfrom
micafer:oidc_project

Conversation

@micafer
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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)?

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
Copy Markdown
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
Copy Markdown
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.

4 participants