Skip to content

테마 API 서비스 인증 계약 ​

흐름 ​

ProcessCenter 서버는 브라우저에 인증 정보를 노출하지 않고, PortalConsole에서 발급한 단기 서비스 JWT로 UiPlatform의 테마 API를 호출한다.

text
ProcessCenter -- client_id/client_secret --> PortalConsole
ProcessCenter <-- short-lived JWT -------- PortalConsole
ProcessCenter -- Bearer JWT --------------> UiPlatform

JWT 계약 ​

  • iss: directory-service
  • sub: process-center
  • azp: process-center
  • portal_id: process-center
  • aud: ui-center-theme
  • token_use: service
  • scope: theme:catalog:read theme:policy:read theme:policy:write
  • 유효기간: 10분

UiPlatform는 서명, issuer, audience, subject, portal ID, token use, scope와 만료 시간을 검증한다. ProcessCenter 토큰은 process-center 정책만 읽고 쓸 수 있다.

Endpoint ​

text
POST /api/internal/service-token

요청 body:

json
{
  "client_id": "process-center",
  "client_secret": "<client-secret>",
  "audience": "ui-center-theme"
}

응답은 access_token, token_type, expires_in을 포함한다.

환경변수 ​

PortalConsole ​

text
PORTAL_JWT_SECRET
PROCESS_CENTER_SERVICE_CLIENT_SECRET

UiPlatform ​

text
PORTAL_JWT_SECRET

PortalConsole와 UiPlatform의 PORTAL_JWT_SECRET은 동일한 secret이어야 한다. PROCESS_CENTER_SERVICE_CLIENT_SECRET은 PortalConsole와 ProcessCenter에만 설정하고 로그나 코드에 남기지 않는다.

ProcessCenter ​

text
PORTAL_CONSOLE_ORIGIN
UI_PLATFORM_ORIGIN
PORTAL_CONSOLE_PORTAL_ID=process-center
PROCESS_CENTER_SERVICE_CLIENT_SECRET

기존 UI_CENTER_THEME_API_KEY는 사용하지 않는다.

API Key 제거 ​

UiPlatform는 ui_center_api_keys 테이블, UI_CENTER_THEME_API_KEY, validateUiCenterApiKey()를 사용하지 않는다. MySQL과 PostgreSQL migration은 해당 테이블을 삭제한다.