구성 내보내기

GET /v1/config-export · 권한 config:read 및 내보내는 각 종류의 읽기 권한

환경의 구성을 환경에 종속되지 않는 하나의 문서로 반환하므로, 검토하거나 버전 관리에 보관하거나 나중에 다른 환경에 적용할 수 있습니다. 이 문서에는 환경별 ID, 버전, 타임스탬프 또는 비밀 값이 포함되지 않습니다. 리소스는 key으로 서로를 참조합니다. 같은 구성은 항상 바이트 단위로 동일한 문서를 생성합니다(종류는 아래 순서대로, 그다음 key 순으로 정렬하며, 집합형 목록은 정렬됩니다). 응답은 JSON이며 이는 유효한 YAML이기도 합니다. keenauth config export는 기본적으로 YAML을 출력합니다.

요청

환경은 자격 증명에서 결정됩니다. 유일한 쿼리 매개변수는 선택 사항입니다.

매개변수 설명
kinds 내보낼 종류를 쉼표로 구분하여 지정합니다(예: kinds=connection,api). 지정하지 않으면 모든 종류를 내보냅니다.
종류 key config:read 외 권한
environment_settings default environment-settings:read
identity_settings default identity-settings:read
attack_protection default attack-protection:read
branding default branding:read
connection 연결 key connections:read
api API key apis:read, applications:read
role 역할 key roles:read, apis:read
application 애플리케이션 key applications:read, apis:read, connections:read
application_branding 애플리케이션 key branding:read, applications:read

api, role 및 application도 참조하는 종류의 권한이 필요합니다. 참조는 key로 해석되기 때문입니다. config:read만으로는 리소스 읽기 권한이 부여되지 않습니다.

응답

200 OK 응답은 Cache-Control: no-store과 함께 반환됩니다.

{
  "apiVersion": "config.keenauth.com/v1",
  "kinds": ["connection", "api", "application"],
  "resources": [
    {"kind": "connection", "key": "db", "spec": {"type": "database", "strategy": "password", "name": "db", "display_name": null, "status": "active", "settings": {}, "client_secret": null}},
    {"kind": "api", "key": "orders", "spec": {"identifier": "https://api.example.com/orders", "name": "Orders", "access_token_lifetime_s": 3600, "token_format": "jwt", "rbac_mode": "off", "allow_offline_access": false, "require_resource_indicator": false, "dpop_required": false, "mcp_profile": false, "first_party_access": "all", "introspection_applications": [], "permissions": [{"value": "orders:read", "display_name": null, "description": null, "consent_text_i18n": {}, "sensitivity": "normal"}]}},
    {"kind": "application", "key": "web", "spec": {"name": "Web", "app_type": "spa", "default_api": "orders", "connections": ["db"], "api_grants": [{"api": "orders", "scopes": ["orders:read"], "default_scopes": []}], "redirect_uris": ["https://app.example.com/callback"]}}
  ],
  "warnings": [
    {"code": "resource_skipped", "kind": "application", "key": "partner-bot", "reason": "organization_owned"}
  ]
}

위 application 사양은 축약되었습니다. 전체 필드 목록은 API 참조에 있습니다.

오류

HTTP 코드 발생 시점
401 unauthenticated 자격 증명이 없거나 잘못되었거나 취소되었습니다.
403 insufficient_permissions 자격 증명에 필요한 권한이 없습니다. required_permissions에 필요한 모든 권한이 나열됩니다.
413 config_document_too_large 문서가 리소스 5,000개 또는 10 MiB를 초과합니다. kinds로 더 적은 종류를 내보내십시오.
422 validation_failed kinds가 반복되거나, 256자를 초과하거나, 알 수 없는 종류를 지정합니다.
429 rate_limited 요청 한도를 초과했습니다. Retry-After 기간 후에 다시 시도하십시오.
503 service_unavailable 종속 서비스를 일시적으로 사용할 수 없습니다. Retry-After 기간 후에 다시 시도하십시오.

예제

curl "https://api.eu.keenauth.com/v1/config-export?kinds=connection,api,application" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"

keenauth config export --kinds connection,api,application > keenauth.yaml