Loading services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py +3 −6 Original line number Original line Diff line number Diff line Loading @@ -119,19 +119,16 @@ def verbose_formatter(): datefmt='%d/%m/%Y %H:%M:%S' datefmt='%d/%m/%Y %H:%M:%S' ) ) # with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as pub_file: # pub_data = pub_file.read() with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as f: with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as f: pem_data = f.read() pem_data = f.read() # Extraer el primer certificado del PEM (aunque venga en bundle) # Extract the first certificate from the PEM (even if it comes in a bundle) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) # Extraer la clave pública # Extract the public key public_key = cert.public_key() public_key = cert.public_key() # Convertir la clave pública a PEM (lo que JWT necesita) # Convert the public key to PEM (which JWT needs) pub_data = public_key.public_bytes( pub_data = public_key.public_bytes( encoding=serialization.Encoding.PEM, encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo, format=serialization.PublicFormat.SubjectPublicKeyInfo, Loading services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh +17 −26 Original line number Original line Diff line number Diff line Loading @@ -10,25 +10,16 @@ RETRY_DELAY=10 # Attempt counter # Attempt counter ATTEMPT=0 ATTEMPT=0 HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" while [ $ATTEMPT -lt $MAX_RETRIES ]; do while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" echo "Attempt $ATTEMPT of $MAX_RETRIES" # Make the request to Vault and store the response in a variable # Get CCF_ID from helper # RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ # --header "X-Vault-Token: $VAULT_TOKEN" \ # --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" | jq -r '.data.data.pub_key') # CCF_ID="CCF11111111-2222-3333-4444-555555555555" # -------------------------------------------------------------- # 0) Get CCF_ID from helper # -------------------------------------------------------------- HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) Loading services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py +3 −6 Original line number Original line Diff line number Diff line Loading @@ -112,19 +112,16 @@ def verbose_formatter(): ) ) # with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as pub_file: # pub_data = pub_file.read() with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as f: with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as f: pem_data = f.read() pem_data = f.read() # Extraer el primer certificado del PEM (aunque venga en bundle) # Extract the first certificate from the PEM (even if it comes in a bundle) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) # Extraer la clave pública # Extract the public key public_key = cert.public_key() public_key = cert.public_key() # Convertir la clave pública a PEM (lo que JWT necesita) # Convert the public key to PEM (which JWT needs) pub_data = public_key.public_bytes( pub_data = public_key.public_bytes( encoding=serialization.Encoding.PEM, encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo, format=serialization.PublicFormat.SubjectPublicKeyInfo, Loading services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh +17 −20 Original line number Original line Diff line number Diff line Loading @@ -10,20 +10,17 @@ RETRY_DELAY=10 # Attempt counter # Attempt counter ATTEMPT=0 ATTEMPT=0 HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" while [ $ATTEMPT -lt $MAX_RETRIES ]; do while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" echo "Attempt $ATTEMPT of $MAX_RETRIES" # CCF_ID="CCF11111111-2222-3333-4444-555555555555" # -------------------------------------------------------------- # 0) Get CCF_ID from helper # -------------------------------------------------------------- HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" # Get CCF_ID from helper echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) Loading services/TS29222_CAPIF_Security_API/prepare_security.sh +17 −25 Original line number Original line Diff line number Diff line Loading @@ -47,24 +47,16 @@ fi ATTEMPT=0 ATTEMPT=0 SUCCES_OPERATION=false SUCCES_OPERATION=false HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" while [ $ATTEMPT -lt $MAX_RETRIES ]; do while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" echo "Attempt $ATTEMPT of $MAX_RETRIES" # Make the request to Vault and store the response in a variable # Get CCF_ID from helper # RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ # --header "X-Vault-Token: $VAULT_TOKEN" \ # --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" | jq -r '.data.data.key') # CCF_ID="CCF11111111-2222-3333-4444-555555555555" # -------------------------------------------------------------- # 0) Get CCF_ID from helper # -------------------------------------------------------------- HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) Loading Loading
services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py +3 −6 Original line number Original line Diff line number Diff line Loading @@ -119,19 +119,16 @@ def verbose_formatter(): datefmt='%d/%m/%Y %H:%M:%S' datefmt='%d/%m/%Y %H:%M:%S' ) ) # with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as pub_file: # pub_data = pub_file.read() with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as f: with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as f: pem_data = f.read() pem_data = f.read() # Extraer el primer certificado del PEM (aunque venga en bundle) # Extract the first certificate from the PEM (even if it comes in a bundle) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) # Extraer la clave pública # Extract the public key public_key = cert.public_key() public_key = cert.public_key() # Convertir la clave pública a PEM (lo que JWT necesita) # Convert the public key to PEM (which JWT needs) pub_data = public_key.public_bytes( pub_data = public_key.public_bytes( encoding=serialization.Encoding.PEM, encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo, format=serialization.PublicFormat.SubjectPublicKeyInfo, Loading
services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh +17 −26 Original line number Original line Diff line number Diff line Loading @@ -10,25 +10,16 @@ RETRY_DELAY=10 # Attempt counter # Attempt counter ATTEMPT=0 ATTEMPT=0 HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" while [ $ATTEMPT -lt $MAX_RETRIES ]; do while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" echo "Attempt $ATTEMPT of $MAX_RETRIES" # Make the request to Vault and store the response in a variable # Get CCF_ID from helper # RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ # --header "X-Vault-Token: $VAULT_TOKEN" \ # --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" | jq -r '.data.data.pub_key') # CCF_ID="CCF11111111-2222-3333-4444-555555555555" # -------------------------------------------------------------- # 0) Get CCF_ID from helper # -------------------------------------------------------------- HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) Loading
services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py +3 −6 Original line number Original line Diff line number Diff line Loading @@ -112,19 +112,16 @@ def verbose_formatter(): ) ) # with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as pub_file: # pub_data = pub_file.read() with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as f: with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as f: pem_data = f.read() pem_data = f.read() # Extraer el primer certificado del PEM (aunque venga en bundle) # Extract the first certificate from the PEM (even if it comes in a bundle) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) cert = x509.load_pem_x509_certificate(pem_data, default_backend()) # Extraer la clave pública # Extract the public key public_key = cert.public_key() public_key = cert.public_key() # Convertir la clave pública a PEM (lo que JWT necesita) # Convert the public key to PEM (which JWT needs) pub_data = public_key.public_bytes( pub_data = public_key.public_bytes( encoding=serialization.Encoding.PEM, encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo, format=serialization.PublicFormat.SubjectPublicKeyInfo, Loading
services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh +17 −20 Original line number Original line Diff line number Diff line Loading @@ -10,20 +10,17 @@ RETRY_DELAY=10 # Attempt counter # Attempt counter ATTEMPT=0 ATTEMPT=0 HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" while [ $ATTEMPT -lt $MAX_RETRIES ]; do while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" echo "Attempt $ATTEMPT of $MAX_RETRIES" # CCF_ID="CCF11111111-2222-3333-4444-555555555555" # -------------------------------------------------------------- # 0) Get CCF_ID from helper # -------------------------------------------------------------- HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" # Get CCF_ID from helper echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) Loading
services/TS29222_CAPIF_Security_API/prepare_security.sh +17 −25 Original line number Original line Diff line number Diff line Loading @@ -47,24 +47,16 @@ fi ATTEMPT=0 ATTEMPT=0 SUCCES_OPERATION=false SUCCES_OPERATION=false HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" while [ $ATTEMPT -lt $MAX_RETRIES ]; do while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" echo "Attempt $ATTEMPT of $MAX_RETRIES" # Make the request to Vault and store the response in a variable # Get CCF_ID from helper # RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ # --header "X-Vault-Token: $VAULT_TOKEN" \ # --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" | jq -r '.data.data.key') # CCF_ID="CCF11111111-2222-3333-4444-555555555555" # -------------------------------------------------------------- # 0) Get CCF_ID from helper # -------------------------------------------------------------- HELPER_URL="http://helper:8080/api/getCcfId" ATTEMPT_CCFID=0 CCF_ID="" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) Loading