debug keys

This commit is contained in:
phact 2025-09-12 15:40:31 -04:00
parent 2210f6ac73
commit dd6886aec6
2 changed files with 17 additions and 10 deletions

View file

@ -36,13 +36,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: uv sync --group dev 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 - name: Run integration tests
env: env:
OPENSEARCH_HOST: localhost OPENSEARCH_HOST: localhost

View file

@ -183,15 +183,19 @@ def generate_jwt_keys():
# Generate keys if they don't exist # Generate keys if they don't exist
if not os.path.exists(private_key_path): if not os.path.exists(private_key_path):
try: try:
logger.info("Generating RSA keys", private_key_path=private_key_path, public_key_path=public_key_path)
# Generate private key # Generate private key
subprocess.run( result = subprocess.run(
["openssl", "genrsa", "-out", private_key_path, "2048"], ["openssl", "genrsa", "-out", private_key_path, "2048"],
check=True, check=True,
capture_output=True, capture_output=True,
text=True,
) )
logger.info("Private key generation completed", stdout=result.stdout, stderr=result.stderr)
# Generate public key # Generate public key
subprocess.run( result = subprocess.run(
[ [
"openssl", "openssl",
"rsa", "rsa",
@ -203,11 +207,21 @@ def generate_jwt_keys():
], ],
check=True, check=True,
capture_output=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") logger.info("Generated RSA keys for JWT signing")
except subprocess.CalledProcessError as e: 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 raise
else: else:
logger.info("RSA keys already exist, skipping generation") logger.info("RSA keys already exist, skipping generation")