Technical Services
Non Insurance Services
Config Center Service
Sidebar On this page

What is Config Center

A configuration center is a centralized component used to manage environment-specific parameters for a microservice application. These parameters may include:

  • Database connection strings
  • Server addresses
  • API keys
  • Other settings that vary between environments

Benefits of Using a Configuration Center

Using a configuration center simplifies managing and maintaining multiple environments, like development, staging, and production. Instead of hardcoding environment-specific settings into the application code, these settings can be stored in the configuration center and accessed at runtime.

This approach has several advantages:

  1. Simplify Updates: It allows for easy configuration changes without having to modify and redeploy application code.

  2. Reduce Risk: It can help prevent errors caused by environment-specific settings being inadvertently included in code repositories or deployment packages.

  3. Enhance Security: It can improve security by allowing sensitive parameters to be stored separately from application code and only accessed by authorized users.

How to Use Config Center

  • Configuration rules
    • The key of the configuration center data is separated by ’/’, where each level has different meanings. The value is the configuration data. If it is the current effective environment, the environment name is local.
configcenter_rule
  • View configuration
    • Three modes: TableTree and JSON
configcenter_view
  • Add configuration
    • Add key:value
configcenter_create
  • Delete configuration
    • Two modes of deletion
configcenter_delete
  • Batch deletion
configcenter_batch_delete

Service Integration

  • Template integration
    • The integration method is simple and easy to operate, convenient and fast.
  • SDK integration
    • You can add the SDK provided by insureMO with less dependence.
  • API Integration
    • You need to get the processing configuration yourself.

Data Storage

For private installation, it’s important to understand that config-center is powered by eted in the backend as separate middleware.

  • About etcd
    Etcd is a distributed key-value store that can be used to store and retrieve configuration data in a reliable, scalable, and highly available manner. In distributed systems, it is often used for:
    • Service discovery
    • Configuration management
    • Coordination in distributed systems

Using etcd for configuration management allows to store configuration data as key-value pairs, where each key represents a configuration parameter and each value represents its corresponding value.

By organizing configuration data in this way, users can easily manage different configurations for different environments by creating separate keys for each environment.

Usage Scenario

  • Unified management of service configuration
  • The service calls and reads configuration

Page

API

The latest API version is V2, with the base path /config/v2. The V1 APIs (/config/export, /config/import, /config/configs) are deprecated.
V2 APIs require MO user authentication (via gateway Bearer token).
Gateway URL format: {{insuremo_gw_url}}/mo-fo/v1/config/v2/{endpoint}

Get Configuration (Service Invocation)

  • GET request:
    {{insuremo_gw_url}}/mo-fo/v1/config/v2/configs

  • Query Params:

    ParameterRequiredDescription
    profileYesTenant code, e.g. foundation
    environmentNoEnvironment name, default is local
    applicationNoApplication name, e.g. urp-service
    keyNoSpecific key name
    modeNoSet to mix to merge public application configs with the specified application configs
  • Headers:
    Authorization: Bearer xxxxxxxxxxxxxxxxxx

  • Response: Returns decrypted plaintext values. Sensitive configs are automatically decrypted before returning.

  • Response Body:

    {
    "code": "i_common_success",
    "message": "request success",
    "trace_id": "",
    "env_name": "test_env",
    "date": "2026-07-29T03:46:38.224Z",
    "data": {
    "env": "local",
    "profile": "tenant-a",
    "application": "my-app",
    "label": "",
    "key": "",
    "data": {
    "db.host": "localhost",
    "db.port": "3306"
    }
    }
    }
    FieldTypeDescription
    codestringResponse code, e.g. i_common_success
    messagestringResponse message
    trace_idstringTrace ID for request tracking
    env_namestringEnvironment name
    datestringResponse timestamp (ISO 8601)
    data.envstringEnvironment
    data.profilestringTenant code
    data.applicationstringApplication name
    data.labelstringLabel
    data.keystringKey filter
    data.datamap[string]stringKey-value pairs of configuration data (decrypted plaintext)

Export Configuration

  • GET request:
    {{insuremo_gw_url}}/mo-fo/v1/config/v2/export

  • Query Params:

    ParameterRequiredDescription
    profileYesTenant code, e.g. foundation
    environmentNoEnvironment name, e.g. dev, tst. Default is local
    applicationNoApplication name, e.g. urp-service
    keyNoSpecific key name to export
    included_prefixNoOnly export keys with this prefix
    excluded_prefixNoExclude keys with this prefix
    ignore_meta_dataNoIgnore meta data in export
  • Headers:
    Authorization: Bearer xxxxxxxxxxxxxxxxxx

  • Response: Returns encrypted/masked values. Sensitive configs are exported as *mo_encrypted* ciphertext.

  • Response Body:

    {
    "code": "i_common_success",
    "message": "request success",
    "trace_id": "",
    "env_name": "test_env",
    "date": "2026-07-29T03:46:38.224Z",
    "data": {
    "env": "local",
    "profile": "tenant-a",
    "application": "my-app",
    "label": "",
    "key": "",
    "data": {
    "db.host": "ENC(xxxx)",
    "db.port": "3306"
    }
    }
    }
    FieldTypeDescription
    codestringResponse code, e.g. i_common_success
    messagestringResponse message
    trace_idstringTrace ID for request tracking
    env_namestringEnvironment name
    datestringResponse timestamp (ISO 8601)
    data.envstringEnvironment
    data.profilestringTenant code
    data.applicationstringApplication name
    data.labelstringLabel
    data.keystringKey filter
    data.datamap[string]stringKey-value pairs of configuration data (sensitive values encrypted as ENC(...))

Import Configuration

  • POST request:
    {{insuremo_gw_url}}/mo-fo/v1/config/v2/import

  • Query Params:

    ParameterRequiredDescription
    is_hardNoIf true, data containing mo_deleted will not be deleted
  • Request Body:

    {
    "env": "local",
    "profile": "foundation",
    "application": "urp-service",
    "label": "",
    "key": "",
    "included_prefix": "",
    "excluded_prefix": "",
    "data": {
    "db.type": "mysql",
    "db.host": "172.25.14.34"
    }
    }
    FieldTypeDescription
    envstringEnvironment name
    profilestringTenant code
    applicationstringApplication name
    labelstringLabel
    keystringKey name
    included_prefixstringOnly import keys with this prefix
    excluded_prefixstringExclude keys with this prefix
    datamap[string]stringKey-value pairs of configuration data
  • Headers:
    Authorization: Bearer xxxxxxxxxxxxxxxxxx

  • Note: Sensitive keys (matching pwd/password/secret/token/credential/key) are automatically AES-encrypted on write.

  • Response Body:

    {
    "code": "i_common_success",
    "message": "request success",
    "trace_id": "",
    "env_name": "test_env",
    "date": "2026-07-29T03:46:38.224Z",
    "data": {
    "revision": "12345",
    "version": "v1.0.0",
    "count": {
    "put": 2,
    "delete": 0,
    "get": 0
    },
    "operator": "admin",
    "tenant_code": "tenant-a",
    "query_params": "version=v1.0.0",
    "modify_time": "2026-07-29T10:00:00Z",
    "trace_id": "abc123"
    }
    }
    FieldTypeDescription
    codestringResponse code, e.g. i_common_success
    messagestringResponse message
    trace_idstringTrace ID for request tracking
    env_namestringEnvironment name
    datestringResponse timestamp (ISO 8601)
    data.revisionstringRevision number of the import
    data.versionstringVersion of the import
    data.count.putnumberNumber of keys written
    data.count.deletenumberNumber of keys deleted
    data.count.getnumberNumber of keys read
    data.operatorstringOperator who performed the import
    data.tenant_codestringTenant code
    data.query_paramsstringQuery parameters used
    data.modify_timestringLast modification time (ISO 8601)
    data.trace_idstringTrace ID for this operation

Feedback
Was this page helpful?
|
Provide feedback