Skip to content

Commit 9aff811

Browse files
committed
debugging patch
1 parent d06672c commit 9aff811

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/token-federation-test.yml

+39
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,45 @@ jobs:
6262
pip install -e .
6363
pip install pyarrow
6464
65+
- name: Create debugging patch script
66+
run: |
67+
cat > patch_for_debugging.py << 'EOF'
68+
#!/usr/bin/env python3
69+
70+
def patch_code():
71+
with open('src/databricks/sql/auth/token_federation.py', 'r') as f:
72+
content = f.read()
73+
74+
# Add verbose request debugging
75+
modified = content.replace(
76+
'try:\n # Make the token exchange request',
77+
'try:\n import urllib.parse\n # Debug full request\n print(f"Token endpoint: {self.token_endpoint}")\n print(f"Request parameters: {urllib.parse.urlencode(params)}")\n print(f"Request headers: {headers}")\n # Make the token exchange request'
78+
)
79+
80+
# Add verbose response debugging
81+
modified = modified.replace(
82+
'response = requests.post(self.token_endpoint, data=params, headers=headers)',
83+
'response = requests.post(self.token_endpoint, data=params, headers=headers)\n print(f"Response status: {response.status_code}")\n print(f"Response headers: {dict(response.headers)}")\n print(f"Response body: {response.text}")'
84+
)
85+
86+
# Improve error handling
87+
modified = modified.replace(
88+
'except RequestException as e:',
89+
'except RequestException as e:\n if hasattr(e, "response") and e.response:\n print(f"Error response status: {e.response.status_code}")\n print(f"Error response headers: {dict(e.response.headers)}")\n print(f"Error response text: {e.response.text}")'
90+
)
91+
92+
with open('src/databricks/sql/auth/token_federation.py', 'w') as f:
93+
f.write(modified)
94+
95+
if __name__ == "__main__":
96+
patch_code()
97+
EOF
98+
99+
chmod +x patch_for_debugging.py
100+
101+
- name: Apply debugging patches to token_federation.py
102+
run: python patch_for_debugging.py
103+
65104
- name: Get GitHub OIDC token
66105
id: get-id-token
67106
uses: actions/github-script@v7

0 commit comments

Comments
 (0)