AEF_GW is a component designed to facilitate the integration of legacy systems with the **Common API Framework (CAPIF)**. It streamlines the process, enabling legacy systems to interact with CAPIF, ensuring compatibility and simplifying the adoption of modern APIs.
Project description
AEF_GW (API Exposer Function Gateway)
AEF_GW is a component designed to facilitate the integration of legacy systems with the Common API Framework (CAPIF). It streamlines the process, enabling legacy systems to interact with CAPIF, ensuring compatibility and simplifying the adoption of modern APIs.
AEF_GW leverages the Opencapif_sdk for running the component.
Understanding AEF_GW
AEF_GW acts as a bridge between legacy systems and CAPIF, translating and exposing APIs from legacy systems in a way that allows them to interact with the CAPIF environment. It handles communication both with legacy systems (southbound) and with CAPIF (northbound), ensuring secure, flexible, and reliable API interaction.
Getting Started
Requirements
To use AEF_GW, a registered user account within the target CAPIF instance is required.
Contact the administrator to obtain the required predefined credentials (CAPIF username and password).
In addition, ensure the following dependencies are installed:
- Python 3.8+
pipenvorvirtualenvfor managing dependencies- Required Python packages listed in
requirements.txt
Installation
-
Clone the repository:
git clone https://github.com/your-username/aef_gw.git cd aef_gw
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Verify installation:
python -m aef_gw --help
Configuration
AEF_GW requires configuration files for both northbound (communication with CAPIF) and southbound (communication with legacy systems) integrations.
Northbound Configuration
The northbound configuration is stored in a YAML file (northbound.yaml).
The YAML northbound configuration includes:
- ip: The IP address that will be exposed.
- port: The port that will be exposed.
- opencapif_sdk_configuration: Configuration for the OpenCapif SDK.
- openapi: Configuration for the OpenAPI specification.
Opencapif SDK Configuration
These are the fields of the opencapif_sdk_configuration
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.capif_register_port: The register host port number.capif_username: The CAPIF username.capif_password: The CAPIF password.debug_mode: A boolean value to enable or disable SDK logs (e.g.,TrueorFalse).
In the provider field only one field is required:
provider: Fields for certificate generation, withcsr_country_namerequiring a two-letter country code.
Here is an example of provider:
provider:
cert_generation:
csr_common_name: "name"
csr_organizational_unit: "team"
csr_organization: "ACME"
csr_locality: "Texas"
csr_state_or_province_name: "Artic"
csr_country_name: "ES"
csr_email_address: "yeti@gmail.com"
OpenAPI Configuration
The openapi field in the northbound.yaml file must follow the OpenAPI Specification. This configuration defines the structure of the API that will be exposed to CAPIF.
The openapi field must contain a valid OpenAPI object, as defined in the specification. Below is an example of a minimal OpenAPI configuration:
Important: Ensure that the OpenAPI configuration complies with the OpenAPI Specification. Tools like Swagger Editor or Redocly OpenAPI Lint can help validate your OpenAPI files.
Below is an example of the complete configuration structure for northbound:
northbound:
ip: 0.0.0.0
port: 3000
opencapif_sdk_configuration:
capif_host: "capif-prev.mobilesandbox.cloud"
register_host: "registercapif-prev.mobilesandbox.cloud"
capif_https_port: "36212"
capif_register_port: "36211"
capif_username: "echeva_0"
capif_password: "echevapass"
debug_mode: "True"
provider:
cert_generation:
csr_common_name: "name"
csr_organizational_unit: "team"
csr_organization: "ACME"
csr_locality: "Texas"
csr_state_or_province_name: "Artic"
csr_country_name: "ES"
csr_email_address: "yeti@gmail.com"
openapi:
openapi: 3.0.0
info:
title: Simple API
description: This is a simple example of an API using OpenAPI 3.0
version: 1.0.0
servers:
- url: http://localhost:8080
description: Local server
paths:
/greet:
get:
summary: Greet the user
description: Returns a greeting message.
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Hello, world!"
/greet/{name}:
get:
summary: Personalized greeting
description: Returns a personalized greeting message.
parameters:
- name: name
in: path
required: true
description: The name of the person to greet.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Hello, John!"
components:
schemas:
GreetingResponse:
type: object
properties:
message:
type: string
example: "Hello!"
Southbound Configuration
The southbound configuration is stored in a YAML file (southbound.yaml).
The YAML southbound configuration includes:
- ip: The IP address to be exposed.
- port: The port to be exposed.
- type: The type of endpoint exposed in the southbound interface.
- authentication_method: In this version of AEF_GW, only HTTP Basic Authentication is supported.
- credentials: The credentials required for authentication in the southbound interface.
- paths: The mapping between northbound and southbound paths, including the method type and parameter correlations, if applicable.
Below is an example of the complete configuration structure for southbound:
southbound:
ip: 0.0.0.0
port: 8000
type: REST
authentication_method: "HTTP Basic Authentication"
credentials:
username: "admin"
password: "password123"
paths:
- northbound_path: "/greet"
southbound_path: "/meet"
method: GET
- northbound_path: "/greet/{name}"
southbound_path: "/meet/{person}"
method: GET
parameters:
- name: person
Usage
-
Populate the configuration files:
- Place the
northbound.yamlfile in the./config_samples/directory. - Place the
southbound.yamlfile in the same directory.
- Place the
-
Start the gateway:
python -m aef_gw
-
Access the API documentation: Visit
http://127.0.0.1:8080/docsto explore the available endpoints and their operations.
Development
Adding a New Endpoint
To add a new endpoint, modify the OpenAPI configuration in the __openapi_modifications method and define the corresponding route in the run.py file.
Example:
/greeting/{name}:
post:
summary: "Generate a personalized greeting"
description: "Generates a plain text greeting for the provided name."
operationId: aef_gw.run.post_greeting_name
Contributing
We welcome contributions to improve AEF_GW. To contribute:
- Fork the repository.
- Create a feature branch.
- Commit your changes and open a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For support or inquiries, please contact support@example.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aef_gw-0.1.2.tar.gz.
File metadata
- Download URL: aef_gw-0.1.2.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f73ba312ac6712d550607be20cb4e143956b0a170ac25d2793306f901c7f8ede
|
|
| MD5 |
c38e1b437725ad0561f62e2047a8873a
|
|
| BLAKE2b-256 |
1ed7fc699b16fade057205a7c449ea34d09a924ff983df747d8bad84b0dd2fe4
|
File details
Details for the file aef_gw-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aef_gw-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8983451fdca5b99839165647fe2e08748cc285cde49f818347be567b1c799c7
|
|
| MD5 |
5c8766c7454f90acfd81c763add6c188
|
|
| BLAKE2b-256 |
f8ea5f1307fa106ee7f73b1ff79b21a10ac9fefc9f0f5742af2ad217d7a8c38d
|