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

[PR #1046/c4f86654 backport][0.28] Fix failure-edge-cases in outh2-client-workflow. #1047

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/pulp-glue/+fix_auth_regression.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Addressed some edge-case failures in the oauth2-client workflow.
10 changes: 7 additions & 3 deletions pulp-glue/pulp_glue/common/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,20 @@ def __call__(
authorized_schemes.append(security_schemes[name])
authorized_schemes_types.add(security_schemes[name]["type"])

# Check for oauth2 scheme first
if "oauth2" in authorized_schemes_types:
for flow in authorized_schemes:
if flow["type"] == "oauth2":
oauth2_flow = OpenAPISecurityScheme(flow)

# We "know" we'll have an outh2-flow here
if oauth2_flow.flow_type == "client_credentials":
result = self.oauth2_client_credentials_auth(oauth2_flow)
if result:
return result
elif "http" in authorized_schemes_types:
if result:
return result

# if we get here, either no-oauth2, OR we couldn't find creds
if "http" in authorized_schemes_types:
result = self.basic_auth()
if result:
return result
Expand Down
Loading