Files
mdm-ordinis/docs
Zimin A.N. b601c4636f feat(swagger): OAuth2/Keycloak PKCE flow в Swagger UI + docs links
OpenApiConfig:
- Добавлена OAuth2 security scheme (authorization_code flow с Keycloak
  realm `nstart`). Auth/token URLs из ordinis.openapi.oauth.issuer-uri
  configuration property (default: auth.nstart.space/realms/nstart).
- BearerAuth scheme сохранён secondary — для pre-issued tokens из CI/scripts.
- Servers list переупорядочен — prod первый, staging второй.
- Description обновлён с pointer на /docs/ для full integration guide.

application.yml:
- springdoc.swagger-ui.oauth: client-id (env override), use-pkce-with-
  authorization-code-grant=true. Public client `ordinis-swagger`
  настраивается отдельно в Keycloak — see keycloak-setup-swagger-client.md
  в ordinis-infra repo.
- ORDINIS_OPENAPI_OAUTH_ISSUER_URI env var для override realm на разных
  окружениях.

docs/integration/api/read-endpoints.md:
- Swagger UI section обновлён: акцент на Authorize button + Keycloak
  PKCE login (no client_secret needed), tip про bearerAuth fallback.

docs/index.md:
- Добавлен tab "Я хочу пощупать API" с link на Swagger UI.

После deploy:
- https://ordinis.k8s.264.nstart.cloud/swagger-ui.html  — Swagger UI
- https://ordinis.k8s.264.nstart.cloud/v3/api-docs      — OpenAPI spec
Authorize → выбрать oauth2 → Keycloak login (PKCE) → Try it out с JWT.
2026-05-08 00:08:29 +03:00
..

Ordinis Integrator Guide (Diplodoc / YFM)

Consumer-facing документация Ordinis НСИ ЦУОД. Build через Diplodoc (open-source documentation platform от Yandex), source — YFM (Yandex Flavored Markdown).

Scope: только то, что нужно интеграторам (Альтум team, BI, third-party consumers). Operator runbooks, архитектурные deep-dives и project state — во внутренней документации в ../docs-internal/, не в Diplodoc build.

Структура

docs/
├── package.json           # @diplodoc/cli + build scripts
├── .yfm                   # Diplodoc config
├── toc.yaml               # Содержание / sidebar
├── index.md               # Главная (integrator-focused tabs)
└── integration/
    ├── api/               # 11 глав про API integration
    │   ├── index.md
    │   ├── auth.md
    │   ├── read-endpoints.md
    │   ├── events.md
    │   ├── webhooks.md
    │   ├── bitemporal.md
    │   ├── x-references.md
    │   ├── caching.md
    │   ├── errors.md
    │   ├── best-practices.md
    │   └── bundle-cuod.md
    └── altum-imaging-order.md

Внутренние материалы (НЕ в Diplodoc build):

docs-internal/
├── ops/      # Operator runbook (on-call)
├── status/   # Project state snapshots
└── tech/     # Legacy technical pages

Сборка

Требуется Node 18+.

cd docs
pnpm install
pnpm build           # → ./_dist (HTML)
pnpm serve           # → http://localhost:8088
pnpm dev             # build + serve одной командой

Build output (_dist/) — статический HTML, deployable в:

  • GitLab Pages
  • S3 / object storage
  • nginx/ingress на k8s cluster

Editorial guidelines

Этот set документации — public contract для интеграторов:

  1. Не leak'аем internal architecture — никаких internal alert names, service paths, internal infrastructure URLs.
  2. API contract стабилен — изменения требуют semver bump + announcement.
  3. Consumer-side examples для каждой концепции (Python, Node, либо Spring).
  4. Версионирование через bundle / API major.

Для operator-side / dev-side материалов — docs-internal/ либо design docs в ~/.gstack/projects/claude/.

YFM extensions используются

  • {% list tabs %} — табы для switching между audiences
  • {% note info|warning|tip %} — выделенные блоки
  • mermaid code blocks — диаграммы (graph LR, gantt)
  • toc.yaml cross-links — sidebar navigation

Roadmap

  • Базовая структура integration guide (11 страниц)
  • CI job build-docs в .gitlab-ci.yml
  • GitLab Pages / k8s ingress deployment
  • Search plugin
  • EN translation (через langs: в .yfm)
  • Includes для shared snippets (auth examples, error tables)
  • Versioning — separate doc trees per API major version