Logging feature developed

This feature allows the user to notify to the CCF certain logs of a service which is being used as a provider

Merge request reports

Loading
+39
Changes for .github/workflows/gitlab.yml: 39 added lines, 0 removed lines.
Original line number Diff line number Diff line
name: Sync GitHub to GitLab

on:
  push:
    branches:
      - develop  # Se activa cuando hay cambios en la rama develop

jobs:
  create-merge-request:
    runs-on: ubuntu-latest

    steps:
      # 1. Checkout del código desde GitHub
      - name: Checkout GitHub repository
        uses: actions/checkout@v4

      # 2. Crear un Merge Request en GitLab
      - name: Create Merge Request in GitLab
        env:
          GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
        run: |
          # Información del MR
          PROJECT_ID="335" # Reemplaza con el ID del proyecto de GitLab
          SOURCE_BRANCH="develop"
          TARGET_BRANCH="main"

          # Crear el Merge Request usando la API de GitLab
          curl -X POST \
            -H "Content-Type: application/json" \
            -H "Authorization: Bearer $GITLAB_TOKEN" \
            -d '{
              "id": "'"${PROJECT_ID}"'",
              "source_branch": "'"${SOURCE_BRANCH}"'",
              "target_branch": "'"${TARGET_BRANCH}"'",
              "title": "Sync develop to main",
              "remove_source_branch": false,
              "squash": false
            }' \
            https://labs.etsi.org/api/v4/projects/${PROJECT_ID}/merge_requests
+70
Changes for .github/workflows/python-publish.yml: 70 added lines, 0 removed lines.
Original line number Diff line number Diff line
# This workflow will upload a Python Package to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
  release:
    types: [published]

permissions:
  contents: read

jobs:
  release-build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Build release distributions
        run: |
          # NOTE: put your own distribution build steps here.
          python -m pip install build
          python -m build

      - name: Upload distributions
        uses: actions/upload-artifact@v4
        with:
          name: release-dists
          path: dist/

  pypi-publish:
    runs-on: ubuntu-latest
    needs:
      - release-build
    permissions:
      # IMPORTANT: this permission is mandatory for trusted publishing
      id-token: write

    # Dedicated environments with protections for publishing are strongly recommended.
    # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
    environment:
      name: pypi
      # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
      
      #
      # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
      # ALTERNATIVE: exactly, uncomment the following line instead:
      url: https://pypi.org/project/opencapif-sdk/${{ github.event.release.name }}

    steps:
      - name: Retrieve release distributions
        uses: actions/download-artifact@v4
        with:
          name: release-dists
          path: dist/

      - name: Publish release distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          packages-dir: dist/
+14 −4
Changes for config/capif_sdk_config.json: 14 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
    "invoker_folder": "",
    "capif_callback_url": "",
    "supported_features":"",
    "check_authentication":{
    "check_authentication_data":{
      "ip":"",
      "port":""
    },
@@ -18,7 +18,7 @@
      "csr_common_name": "",
      "csr_organizational_unit": "",
      "csr_organization": "",
      "crs_locality": "",
      "csr_locality": "",
      "csr_state_or_province_name": "",
      "csr_country_name": "",
      "csr_email_address": ""
@@ -41,6 +41,7 @@
  },
  "provider": {
    "provider_folder": "",
    "supported_features": "",
    "apfs": "",
    "aefs": "",
    "publish_req": {
@@ -55,11 +56,20 @@
      "csr_common_name": "",
      "csr_organizational_unit": "",
      "csr_organization": "",
      "crs_locality": "",
      "csr_locality": "",
      "csr_state_or_province_name": "",
      "csr_country_name": "",
      "csr_email_address": ""
    },
    "api_description_path": ""
    "api_description_path": "",
    "log":{            
      "apiName": "",
      "apiVersion": "",
      "resourceName": "",
      "uri": "",
      "protocol": "",
      "operation": "",
      "result": ""
    }
   }
}
+3
Changes for doc/sdk_configuration.md: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ When configuring the SDK as a **Network App Invoker**, the following fields must
For SDK configuration as a **Network App Provider**, the following fields are required:

- `provider_folder`
- `supported_features`
- `cert_generation` (fields such as `csr_common_name`, `csr_country_name`, etc.)
- `APFs`
- `AEFs`
@@ -80,6 +81,7 @@ This file can also be populated using [environment variables](../samples/envirom

- `invoker_folder`: The path (relative or absolute) where invoker information (certificates, keys, etc.) is stored.
- `provider_folder`: The path (relative or absolute) where provider information is stored.
- `supported_features`: A string used to indicate the features supported by an API. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F". [More information](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29571_CommonData.yaml)
- `capif_host`: The domain name of the CAPIF host.
- `register_host`: The domain name of the register host.
- `capif_https_port`: The CAPIF host port number.
@@ -95,6 +97,7 @@ This file can also be populated using [environment variables](../samples/envirom
- [`publish_req`](#configuration-of-publish_req): Fields required for API publishing.
- `api_description_path`: The path to the [ServiceAPIDescription](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) JSON file.
- `check_authentication_data`: The `ip` and `port` of the target Provider's AEF to get their supported features from.
- `log`: The structure defined in the [Log schema](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Logging_API_Invocation_API.yaml), it is not needed to fulfill the `apiId` field.


## Configuration via `capif_sdk_register.json`
+15
Changes for doc/sdk_full_documentation.md: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ The SDK simplifies API deletion. Service deletion requires prior onboarding and
**Required SDK inputs**:
- publisher_apf_id
- publisher_aefs_ids
- service_api_id

### Service Update

@@ -162,6 +163,20 @@ The provider must be onboarded before using these features.

![Provider_update-offboard](./images/flows_provider_update_offboard.jpg)

### Create logs

OpenCAPIF SDK references:
- **Function**: `create_logs(aefId, api_invoker_id)`

The provider notifies to the CCF that the published API has been used by certain invoker.

For leveraging this feature the Provider must have onboarded and published an API previously.

**Required SDK input**:
- aefId (Within the function)
- api_invoker_id (Within the function)
- log (Within [SDK configuration](./sdk_configuration.md) or object)

## Invoker Network App

The OpenCAPIF SDK enables efficient implementation of invoker functionality for Network App. This section details the SDK features related to CAPIF invokers.
Loading
Loading