Feat/dockerfiles

Proposers

  • Guillermo Sanz López (Telefónica)
  • Miguel Ángel Adorna Ruiz (Telefónica) ...

Description

Create a dummy Dockerfile for testing CICD.

Acknowledgements

This work is funded by the European Commission through the 6G-Path project with Grant Agreement number 101139172.

Merge request reports

Loading
+42
Changes for ci_cd_test/testing_samples/testing_invoker_sample/capif_sdk_config_sample.json: 42 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
{
  "capif_host": "capifcore",
  "register_host": "services-register-1",
  "capif_https_port": "443",
  "capif_register_port": "8080",
  "capif_username": "custom_user",
  "capif_password": "user_pass",
  "debug_mode": "True",
  "invoker": {
    "invoker_folder": "/sdk/testing_samples/testing_invoker_sample/test_invoker_certificate_folder",
    "capif_callback_url": "http://localhost:5000",
    "supported_features": "0",
    "check_authentication_data": {
      "ip": "",
      "port": ""
    },
    "cert_generation": {
      "csr_common_name": "sdk-capif-demo",
      "csr_organizational_unit": "discovery",
      "csr_organization": "telefonica",
      "csr_locality": "madrid",
      "csr_state_or_province_name": "madrid",
      "csr_country_name": "ES",
      "csr_email_address": "adios@gmail.com"
    },
    "discover_filter": {
      "api-name": "",
      "api-version": "",
      "comm-type": "",
      "protocol": "",
      "aef-id": "",
      "data-format": "",
      "api-cat": "",
      "preferred-aef-loc": "",
      "req-api-prov-name": "",
      "supported-features": "",
      "api-supported-features": "",
      "ue-ip-addr": "",
      "service-kpis": ""
    }
  }
}
+32
Changes for ci_cd_test/testing_samples/testing_invoker_sample/network_app_invoker.py: 32 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
import json
import time
import requests
from opencapif_sdk import capif_invoker_connector, service_discoverer
import logging


# Path to the OpenCAPIF SDK configuration file
capif_sdk_config_path = "./capif_sdk_config_sample.json"

import requests
import json

if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)

    # Onboard the Invoker (creates keys, registers, obtains certs)
    capif_connector = capif_invoker_connector(config_file=capif_sdk_config_path)
    capif_connector.onboard_invoker()
    print("✅ INVOKER ONBOARDING COMPLETED")

    # Discover APIs and obtain JWT token
    discoverer = service_discoverer(config_file=capif_sdk_config_path)
    discoverer.discover()
    discoverer.get_tokens()

    # Show the token
    print("✅ ACCESS TOKEN:")
    print(discoverer.token)

    # End
    print("🎉 Script finished successfully.")
+75
Changes for ci_cd_test/testing_samples/testing_provider_sample/capif_sdk_config_sample.json: 75 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
{
  "capif_host": "",
  "register_host": "",
  "capif_https_port": "",
  "capif_register_port": "",
  "capif_username": "",
  "capif_password": "",
  "debug_mode": "",
  "invoker": {
    "invoker_folder": "",
    "capif_callback_url": "",
    "supported_features":"",
    "check_authentication_data":{
      "ip":"",
      "port":""
    },
    "cert_generation": {
      "csr_common_name": "",
      "csr_organizational_unit": "",
      "csr_organization": "",
      "csr_locality": "",
      "csr_state_or_province_name": "",
      "csr_country_name": "",
      "csr_email_address": ""
    },
    "discover_filter": {
      "api-name": "",
      "api-version": "",
      "comm-type": "",
      "protocol": "",
      "aef-id": "",
      "data-format": "",
      "api-cat": "",
      "preferred-aef-loc": "",
      "req-api-prov-name": "",
      "supported-features": "",
      "api-supported-features": "",
      "ue-ip-addr": "",
      "service-kpis": ""
    }
  },
  "provider": {
    "provider_folder": "",
    "supported_features": "",
    "apfs": "2",
    "aefs": "3",
    "publish_req": {
      "service_api_id": "",
      "publisher_apf_id": "",
      "publisher_aefs_ids": [
        "",
        ""
      ]
    },
    "cert_generation": {
      "csr_common_name": "",
      "csr_organizational_unit": "",
      "csr_organization": "",
      "csr_locality": "",
      "csr_state_or_province_name": "",
      "csr_country_name": "",
      "csr_email_address": ""
    },
    "api_description_path": "",
    "log":{            
      "apiName": "",
      "apiVersion": "",
      "resourceName": "",
      "uri": "",
      "protocol": "",
      "operation": "",
      "result": ""
    }
   }
}
+x+330
Changes for ci_cd_test/testing_samples/testing_provider_sample/nef_upf_vendor_1.json: 330 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
{
    "apiName": "6G-resilience",
    "aefProfiles": [
        {
            "aefId": "AEF6fc1d116574bcc797ecd74b8902b35",
            "versions": [
                {
                    "apiVersion": "6G_Resilience_v1",
                    "expiry": "2100-11-30T10:32:02.004Z",
                    "resources": [
                        {
                            "resourceName": "RESILIENCE_MANAGEMENT",
                            "commType": "SUBSCRIBE_NOTIFY",
                            "uri": "/resilience",
                            "custOpName": "http_post",
                            "operations": [
                                "GET",
                                "POST"
                            ],
                            "description": "Endpoint to manage resilience functionalities in 6G networks"
                        },
                        {
                            "resourceName": "RESILIENCE_SINGLE",
                            "commType": "SUBSCRIBE_NOTIFY",
                            "uri": "/resilience/{profileId}",
                            "custOpName": "http_get",
                            "operations": [
                                "GET",
                                "PUT",
                                "DELETE"
                            ],
                            "description": "Endpoint to manage a single resilience profile"
                        }
                    ],
                    "custOperations": [
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "string",
                            "operations": [
                                "POST"
                            ],
                            "description": "Custom operation for managing 6G resilience parameters"
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        }
                    ]
                }
            ],
            "protocol": "HTTP_1_1",
            "dataFormat": "JSON",
            "securityMethods": [
                "OAUTH"
            ],
            "interfaceDescriptions": [
                {
                    "ipv4Addr": "localhost",
                    "port": 8088,
                    "securityMethods": [
                        "OAUTH"
                    ]
                }
            ]
        },
        {
            "aefId": "AEFa8e49e01d179c79e6a4750a8363f1d",
            "versions": [
                {
                    "apiVersion": "6G_Resilience_v1",
                    "expiry": "2100-11-30T10:32:02.004Z",
                    "resources": [
                        {
                            "resourceName": "SLICE_RESILIENCE",
                            "commType": "SUBSCRIBE_NOTIFY",
                            "uri": "/slice/resilience",
                            "custOpName": "http_post",
                            "operations": [
                                "GET",
                                "POST"
                            ],
                            "description": "Endpoint for managing resilience in network slices"
                        },
                        {
                            "resourceName": "SLICE_SINGLE_RESILIENCE",
                            "commType": "SUBSCRIBE_NOTIFY",
                            "uri": "/slice/{sliceId}/resilience",
                            "custOpName": "http_get",
                            "operations": [
                                "GET",
                                "PUT",
                                "DELETE"
                            ],
                            "description": "Endpoint for managing a single slice's resilience"
                        }
                    ],
                    "custOperations": [
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "string",
                            "operations": [
                                "POST"
                            ],
                            "description": "Custom operation for configuring resilience in network slices"
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "check-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Check authentication request."
                        },
                        {
                            "commType": "REQUEST_RESPONSE",
                            "custOpName": "revoke-authentication",
                            "operations": [
                                "POST"
                            ],
                            "description": "Revoke authorization for service APIs."
                        }
                    ]
                }
            ],
            "protocol": "HTTP_1_1",
            "dataFormat": "JSON",
            "securityMethods": [
                "OAUTH",
                "PSK"
            ],
            "interfaceDescriptions": [
                {
                    "ipv4Addr": "localhost",
                    "port": 8088,
                    "securityMethods": [
                        "OAUTH"
                    ]
                }
            ]
        }
    ],
    "description": "API of dummy Network-App to test",
    "supportedFeatures": "0",
    "shareableInfo": {
        "isShareable": true,
        "capifProvDoms": [
            "string"
        ]
    },
    "serviceAPICategory": "string",
    "apiSuppFeats": "0",
    "pubApiPath": {
        "ccfIds": [
            "string"
        ]
    },
    "ccfId": "string"
}
 No newline at end of file
+36
Changes for ci_cd_test/testing_samples/testing_provider_sample/network_app_provider.py: 36 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
from opencapif_sdk import capif_provider_connector
import json


capif_sdk_config_path = "./testing_CICD_capif_sdk_config_sample.json"

if __name__ == "__main__":
    try:
        # Initialize the connector
        capif_connector = capif_provider_connector(config_file=capif_sdk_config_path)
        print("PROVIDER ONBOARDING COMPLETED")
        capif_connector.onboard_provider()

        capif_connector.api_description_path = "./nef_upf_vendor_1.json"

        api6g = capif_connector.provider_capif_ids["APF-1"]
        api5g = capif_connector.provider_capif_ids["APF-2"]

        Peñuelas = capif_connector.provider_capif_ids["AEF-1"]
        Distrito = capif_connector.provider_capif_ids["AEF-2"]
        Valladolid = capif_connector.provider_capif_ids["AEF-3"]

        capif_connector.publish_req['publisher_apf_id'] = api6g

        capif_connector.publish_req['publisher_aefs_ids'] = [Peñuelas, Distrito]

        capif_connector.publish_services()

        print("API PUBLISHED")

    except FileNotFoundError as e:
        print(f"Error: {e}")
    except json.JSONDecodeError as e:
        print(f"Error reading the JSON file: {e}")
    except Exception as e:
        print(f"Unexpected error: {e}")
Loading
Loading