Commit fce54456 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'OCF-Doc36-documentation-how-to-manage-dynamic-configuration-2' into 'develop'

Resolve "Documentation how to manage dynamic configuration"

Closes #36

See merge request !38
parents ebfc621d fa08531b
Loading
Loading
Loading
Loading
Loading
+2 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −0

File added.

Preview size limit exceeded, changes collapsed.

+76 −0
Original line number Diff line number Diff line
# CAPIF Dynamic Configuration

## Overview
CAPIF supports dynamic configuration management, enabling modifications without requiring redeployment. This is achieved by storing configurations in MongoDB collections for both CAPIF and Register services, allowing CAPIF to retrieve and apply configuration changes dynamically.

This new approach provides:
  
* **Real-time configuration updates**: Modify parameters on the fly.
* **Extensibility**: Add new parameters or sections dynamically.
* **Improved flexibility**: Reduce static configuration dependencies.

## CAPIF Configuration

In the CAPIF MongoDB instance, it is included a collection of the configuration.

```json
capif_configuration: {
  "config_name": "default",
  "version": "1.0",
  "description": "Default CAPIF Configuration",
  "settings": {
    "certificates_expiry": {
      ttl_superadmin_cert: "4300h",
      ttl_invoker_cert: "4300h",
      ttl_provider_cert: "4300h",
    },
    "security_method_priority": {
      oauth: 1,
      pki: 2,
      psk: 3
    },
    "acl_policy_settings": {
      allowed_total_invocations: 5,
      allowed_invocations_per_second: 10,
      allowed_invocation_time_range_days: 365
    }
  }
}
```


## Register Configuration

Similarly, the Register service includes a dynamic configuration stored in its MongoDB instance:

```json
capif_configuration: {
  "config_name": "default",
  "version": "1.0",
  "description": "Default Register Configuration",
  "settings": {
    "certificates_expiry": {
      ttl_superadmin_cert: "4300h",
    }
  }
}
```

## Configuration Management Endpoints

Both CAPIF and the register configuration are managed via API, the general configuration of CAPIF from the Helper service and the register configuration from the register. In both services these endpoints enable:

1. Retrieving the current configuration – View the existing settings stored in MongoDB.

2. Modifying configuration parameters – Update specific values dynamically.

3. Adding new configuration settings – Introduce additional parameters within existing sections or create entirely new sections in the configuration.

For more details, you can check the API documentation of the Helper and Register services:

- [Helper Service API Documentation](../helper/swagger.md)
- [Register Service API Documentation](../register/swagger.md)



doc/helper/helper.md

0 → 100644
+31 −0
Original line number Diff line number Diff line
# Introduction to the Helper Service

## Overview

CAPIF does not include any built-in mechanism to expose data via API. This makes it difficult to retrieve essential information such as the number of registered API Invokers, a list of available API Invokers, etc.

Without a dedicated tool, accessing this data requires direct database queries, making it inefficient and impractical.

## Helper Service

The Helper Service addresses this limitation by acting as an intermediary that exposes CAPIF’s stored data in a structured and accessible manner. This service provides APIs that allow users to query the CAPIF database and obtain valuable insights, such as:

- The total count and details of registered API Invokers and API Providers.
- A structured and API-driven way to retrieve CAPIF-related information.
- Simplified access to important data without the need for direct database interactions.
- Access to security contexts, helping manage authentication and authorization processes.
- Retrieval of event records, providing insight into CAPIF system activities.
- The ability to delete different CAPIF entities, facilitating resource management.
- Full control over CAPIF dynamic configuration, including:
    - Retrieving the current configuration.
    - Modifying specific parameters.
    - Adding or updating configuration settings dynamically.

By this Helper Service, CAPIF users can effortlessly retrieve and manage critical system information, improving overall visibility and efficiency.


## API Documentation

For a detailed API reference, please check the **Helper Service Swagger Documentation**:

➡️ [Helper Service API Documentation](../helper/swagger.md)
Loading