Skip to content

Conversation

Andy-Grigg
Copy link
Contributor

@Andy-Grigg Andy-Grigg commented Jul 14, 2022

Closes #222

This PR includes a very rough initial implementation of the client credential flow from requests-auth:

  • Renames the existing with_oauth() method to with_oauth_pkce()
  • Introduces a new method with_oauth_client_credentials()

I suspect there's a lot of duplication here, and that this isn't necessarily the most user-friendly way of doing it. Adding another level of builder also doesn't seem sensible though.

PR is based on both #221 and #139 , hence the large number of commits.

Tested against a real service implementing OIDC client credential flow and confirmed working.

@Andy-Grigg Andy-Grigg requested a review from da1910 July 14, 2022 21:00
@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #223 (116847c) into main (fec10be) will increase coverage by 1.56%.
The diff coverage is 81.53%.

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   91.88%   93.44%   +1.56%     
==========================================
  Files           8        8              
  Lines         826      809      -17     
==========================================
- Hits          759      756       -3     
+ Misses         67       53      -14     
Impacted Files Coverage Δ
src/ansys/openapi/common/_contrib/granta.py 100.00% <ø> (ø)
src/ansys/openapi/common/_util.py 99.39% <ø> (-0.05%) ⬇️
src/ansys/openapi/common/_api_client.py 97.17% <75.00%> (-0.75%) ⬇️
src/ansys/openapi/common/_oidc.py 85.60% <79.31%> (+11.10%) ⬆️
src/ansys/openapi/common/_session.py 86.45% <84.61%> (-1.12%) ⬇️
src/ansys/openapi/common/__init__.py 100.00% <100.00%> (ø)

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 fec10be...116847c. Read the comment docs.

@da1910 da1910 changed the base branch from main to ci/add_sonarcloud July 18, 2022 15:24
@da1910 da1910 changed the base branch from ci/add_sonarcloud to main July 18, 2022 15:24
@Andy-Grigg Andy-Grigg changed the base branch from main to release/1.1 July 18, 2022 15:26
@Andy-Grigg Andy-Grigg changed the base branch from release/1.1 to main July 18, 2022 15:26
@Andy-Grigg
Copy link
Contributor Author

Closing this to try and clean up diff.

@Andy-Grigg Andy-Grigg closed this Jul 18, 2022
@Andy-Grigg Andy-Grigg deleted the feat/222-add-client-credential-flow branch July 18, 2022 15:34
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.

Add support for client credentials OIDC flow

2 participants