configu / configu

Open-source ConfigOps infrastructure ⚙️

Home Page:https://configu.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement `hidden` Property for Cfgu Declaration

rannn505 opened this issue · comments

Suggestion

Incorporate a hidden boolean property into the Cfgu declarations, providing a means for users to mark specific ConfigKeys as hidden. These hidden keys will be excluded from export results but can still be utilized within the context for evaluations and other internal operations.

Example:

{
  "DATABASE_URL": {
    "type": "String",
    "template": "{{POSTGRES_USER}}:{{POSTGRES_PASSWORD}}@{{POSTGRES_HOST}}/{{POSTGRES_DB}}",
    "depends": ["POSTGRES_USER", "POSTGRES_PASSWORD", "POSTGRES_HOST", "POSTGRES_DB"]
  },
  "POSTGRES_USER": {
    "type": "String",
    "hidden": true
  },
  "POSTGRES_PASSWORD": {
    "type": "String",
    "hidden": true
  },
  "POSTGRES_HOST": {
    "type": "String"
  },
  "POSTGRES_DB": {
    "type": "String"
  }
}

In this setup, keys like POSTGRES_USER, and POSTGRES_PASSWORD are marked with "hidden": true, indicating that while they contribute to the configuration context (e.g., being part of the DATABASE_URL template), they should not appear in the final exported configurations.

Motivation

The hidden property adds a layer of flexibility and security by allowing sensitive or context-specific configuration keys to remain internal. It helps keep exported configurations clean and focused on the essential, sharable settings, avoiding the exposure of internal details or sensitive information that's only relevant for intermediate computation or context setup.

Context

fixes #336

Development Plan

  • Add hidden prop to Cfgu
  • Modify ExportCommand.run to filter hidden configs
  • Update docs (if necessary)

Questions / Requests

Notes / Comments / Additional