Skip to content

Commit

Permalink
Fix failure-edge-cases in outh2-client-workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggainey committed Aug 26, 2024
1 parent 579102a commit c4f8665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit c4f8665

Please sign in to comment.