Skip to content

Commit 72b7f09

Browse files
committed
fix: critical bugs from code review
- Add missing stat and sys imports in auth.py - Fix undefined token_id variable in chelon-service.py by extracting it from token string before validation These bugs would cause NameError at runtime. Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
1 parent 0cffb81 commit 72b7f09

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

server/auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"""
44

55
import os
6+
import sys
7+
import stat
68
import json
79
import logging
810
import hashlib

server/chelon-service.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ def _handle_signing(operation):
8686

8787
token = auth_header.split(' ', 1)[1]
8888

89+
# Extract token_id from token string before validation for audit logging
90+
# Token format is "token_id:secret"
91+
token_id = None
92+
if token and ':' in token:
93+
token_id = token.split(':', 1)[0]
94+
8995
try:
9096
token_info = token_auth.validate_token(token)
9197
except ValueError as e:

0 commit comments

Comments
 (0)