debug keys
This commit is contained in:
parent
2210f6ac73
commit
dd6886aec6
2 changed files with 17 additions and 10 deletions
7
.github/workflows/test-integration.yml
vendored
7
.github/workflows/test-integration.yml
vendored
|
|
@ -36,13 +36,6 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: uv sync --group dev
|
||||
|
||||
- name: Debug keys directory
|
||||
run: |
|
||||
ls -la keys/ || echo "keys dir doesn't exist"
|
||||
whoami
|
||||
pwd
|
||||
id
|
||||
|
||||
- name: Run integration tests
|
||||
env:
|
||||
OPENSEARCH_HOST: localhost
|
||||
|
|
|
|||
20
src/main.py
20
src/main.py
|
|
@ -183,15 +183,19 @@ def generate_jwt_keys():
|
|||
# Generate keys if they don't exist
|
||||
if not os.path.exists(private_key_path):
|
||||
try:
|
||||
logger.info("Generating RSA keys", private_key_path=private_key_path, public_key_path=public_key_path)
|
||||
|
||||
# Generate private key
|
||||
subprocess.run(
|
||||
result = subprocess.run(
|
||||
["openssl", "genrsa", "-out", private_key_path, "2048"],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
logger.info("Private key generation completed", stdout=result.stdout, stderr=result.stderr)
|
||||
|
||||
# Generate public key
|
||||
subprocess.run(
|
||||
result = subprocess.run(
|
||||
[
|
||||
"openssl",
|
||||
"rsa",
|
||||
|
|
@ -203,11 +207,21 @@ def generate_jwt_keys():
|
|||
],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
logger.info("Public key generation completed", stdout=result.stdout, stderr=result.stderr)
|
||||
|
||||
# Verify files were created and are readable
|
||||
logger.info("Verifying generated keys")
|
||||
logger.info("Private key exists", exists=os.path.exists(private_key_path))
|
||||
logger.info("Public key exists", exists=os.path.exists(public_key_path))
|
||||
if os.path.exists(private_key_path):
|
||||
stat_info = os.stat(private_key_path)
|
||||
logger.info("Private key permissions", mode=oct(stat_info.st_mode), uid=stat_info.st_uid, gid=stat_info.st_gid)
|
||||
|
||||
logger.info("Generated RSA keys for JWT signing")
|
||||
except subprocess.CalledProcessError as e:
|
||||
logger.error("Failed to generate RSA keys", error=str(e))
|
||||
logger.error("Failed to generate RSA keys", error=str(e), stdout=e.stdout, stderr=e.stderr)
|
||||
raise
|
||||
else:
|
||||
logger.info("RSA keys already exist, skipping generation")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue