Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sunbit committed Jan 15, 2025
1 parent d1c8fed commit 50fe440
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions nuclia_e2e/nuclia_e2e/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,26 @@
},
}

from base64 import b64encode
import base64
import json
print(b64encode(json.dumps(CLUSTERS_CONFIG["prod"]["zones"][0]["permanent_nua_key"], indent=4).encode()))
print(b64encode(json.dumps(CLUSTERS_CONFIG["prod"]["zones"][1]["permanent_nua_key"], indent=4).encode()))


# Assuming CLUSTERS_CONFIG is already defined
def split_into_chunks(text, chunk_size):
return [text[i:i + chunk_size] for i in range(0, len(text), chunk_size)]


for zone in CLUSTERS_CONFIG["prod"]["zones"]:
# Extract the permanent_nua_key
key = zone["permanent_nua_key"]

# Split the key into chunks of 100 characters
chunks = split_into_chunks(key, 100)

# Encode each chunk in Base64
encoded_chunks = [base64.b64encode(chunk.encode()).decode() for chunk in chunks]

print(encoded_chunks)

class ManagerAPI:
def __init__(self, global_api, session: aiohttp.ClientSession):
Expand Down

0 comments on commit 50fe440

Please sign in to comment.