Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions content/docs/api-service/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ A `GenerateCode` call passes through these interceptors, outermost first:
| 4 | Prometheus | `easyp_api_grpc_server_*` metrics. |
| 5 | logging | Structured request log. |
| 6 | panic recovery | Turns a panic into `INTERNAL` and counts it in `easyp_panics_total`. |
| 7 | validation | Calls `Validate()` on messages that implement it. The generated `easyp.generator.v1` messages do not, so in v1.0.2 this is a pass-through; names, versions and plugin configs are validated in the core instead. |
| 7 | validation | Calls `Validate()` on messages that implement it. The generated `easyp.generator.v1` messages do not, so this is a pass-through; names, versions and plugin configs are validated in the core instead. |
| 8 | rate limit | Token bucket per client address: `rate_limit.requests_per_second`, `rate_limit.burst`. Refusal: `RESOURCE_EXHAUSTED`. |
| 9 | concurrency limit | At most `rate_limit.max_concurrent_per_ip` requests in flight per address. Refusal: `RESOURCE_EXHAUSTED`. |
| 10 | auth | Bearer token check: always for writes, for everything when `auth.require_authentication` is set. Refusal: `UNAUTHENTICATED`. |
| 11 | licence | Refuses methods mapped to a feature the licence does not include (`PERMISSION_DENIED`). In v1.0.2 no method is mapped, so it passes everything; the licence is enforced in the core (audit, plugin count) and at start (worker ceilings). |
| 11 | licence | Refuses methods mapped to a feature the licence does not include (`PERMISSION_DENIED`). No method is mapped, so it passes everything; the licence is enforced in the core (audit, plugin count) and at start (worker ceilings). |
| 12 | error code conversion | Innermost. Maps domain errors from the handler to gRPC codes and adds `google.rpc.ErrorInfo`. |

The code converter is deliberately last: interceptors already produce gRPC
Expand All @@ -63,10 +63,12 @@ The plugin name is `group/name:version`. `group` and `name` match
`latest`. The service itself requires the `:version` part — the easyp CLI adds
`:latest` when a `remote:` entry omits it.

<Callout type="warn">
`latest` selects the registered version that sorts last **as a string**
(`ORDER BY version DESC` on a text column). With `v1.36.9` and `v1.36.10` both
registered, `latest` is `v1.36.9`. Pin versions.
<Callout type="info">
`latest` selects the highest registered version: the registry reads the
plugin's versions and compares them as numbers part by part, a missing patch
counting as zero. With `v1.36.9` and `v1.36.11` both registered, `latest` is
`v1.36.11`. It changes when a newer version is published — pin versions where
the output has to be reproducible.
</Callout>

## Worker pool: two limits, one queue size
Expand Down
15 changes: 8 additions & 7 deletions content/docs/api-service/architecture.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ flowchart TB
| 4 | Prometheus | Метрики `easyp_api_grpc_server_*`. |
| 5 | logging | Структурированный лог запроса. |
| 6 | panic recovery | Превращает панику в `INTERNAL` и считает её в `easyp_panics_total`. |
| 7 | validation | Вызывает `Validate()` у сообщений, которые его реализуют. Сгенерированные сообщения `easyp.generator.v1` его не реализуют, поэтому в v1.0.2 это проход насквозь; имена, версии и конфиги плагинов проверяются в core. |
| 7 | validation | Вызывает `Validate()` у сообщений, которые его реализуют. Сгенерированные сообщения `easyp.generator.v1` его не реализуют, поэтому это проход насквозь; имена, версии и конфиги плагинов проверяются в core. |
| 8 | rate limit | Token bucket на адрес клиента: `rate_limit.requests_per_second`, `rate_limit.burst`. Отказ: `RESOURCE_EXHAUSTED`. |
| 9 | concurrency limit | Не больше `rate_limit.max_concurrent_per_ip` запросов в полёте на адрес. Отказ: `RESOURCE_EXHAUSTED`. |
| 10 | auth | Проверка bearer-токена: всегда для записи, для всего — при `auth.require_authentication`. Отказ: `UNAUTHENTICATED`. |
| 11 | licence | Отклоняет методы, привязанные к фиче, которой нет в лицензии (`PERMISSION_DENIED`). В v1.0.2 ни один метод не привязан, так что он пропускает всё; лицензия применяется в core (аудит, число плагинов) и при старте (потолки воркеров). |
| 11 | licence | Отклоняет методы, привязанные к фиче, которой нет в лицензии (`PERMISSION_DENIED`). Ни один метод не привязан, так что он пропускает всё; лицензия применяется в core (аудит, число плагинов) и при старте (потолки воркеров). |
| 12 | error code conversion | Самый внутренний. Переводит доменные ошибки хендлера в gRPC-коды и добавляет `google.rpc.ErrorInfo`. |

Конвертер кодов стоит последним намеренно: интерсепторы уже возвращают
Expand All @@ -63,11 +63,12 @@ gRPC-статусы, и конвертация снаружи переписал
Сервису часть `:version` нужна обязательно — easyp CLI сам дописывает `:latest`,
если в `remote:` её нет.

<Callout type="warn">
`latest` выбирает зарегистрированную версию, которая **при сравнении строк**
оказывается последней (`ORDER BY version DESC` по текстовой колонке). Если
зарегистрированы `v1.36.9` и `v1.36.10`, `latest` — это `v1.36.9`. Фиксируйте
версии.
<Callout type="info">
`latest` выбирает самую новую зарегистрированную версию: реестр читает версии
плагина и сравнивает их как числа по частям, отсутствующий патч считается нулём.
Если зарегистрированы `v1.36.9` и `v1.36.11`, `latest` — это `v1.36.11`. Он
меняется, когда публикуется более новая версия, — фиксируйте версии там, где
результат должен воспроизводиться.
</Callout>

## Пул воркеров: два лимита, один размер очереди
Expand Down
2 changes: 1 addition & 1 deletion content/docs/api-service/client-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generate:
| host | A host containing `localhost` or `127.0.0.1` is always plaintext unless `https://` is given. |
| port | Optional. Without it the gRPC client's default applies (443 for TLS); the Helm chart's ingress serves on 443, a bare service listens on 23410. |
| group/name | Must match a registered plugin. |
| version | Optional. Omitted → `latest`, which is the version that sorts last as a string, not the newest semantic version. |
| version | Optional. Omitted → `latest`, the highest registered version compared by number (`v1.36.11` over `v1.36.9`). |

`opts` are joined into the `CodeGeneratorRequest` parameter
(`paths=source_relative,require_unimplemented_servers=false`), exactly as for
Expand Down
2 changes: 1 addition & 1 deletion content/docs/api-service/client-usage.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generate:
| host | Хост, содержащий `localhost` или `127.0.0.1`, всегда без шифрования, если не указан `https://`. |
| port | Необязателен. Без него действует порт gRPC-клиента по умолчанию (443 для TLS); ingress из Helm-чарта слушает 443, сервис без обвязки — 23410. |
| group/name | Должны совпадать с зарегистрированным плагином. |
| version | Необязательна. Без неё — `latest`, то есть версия, последняя при сравнении строк, а не самая новая семантическая версия. |
| version | Необязательна. Без неё — `latest`, то есть самая новая зарегистрированная версия при сравнении номеров как чисел (`v1.36.11` новее `v1.36.9`). |

`opts` склеиваются в параметр `CodeGeneratorRequest`
(`paths=source_relative,require_unimplemented_servers=false`) — так же, как для
Expand Down
2 changes: 1 addition & 1 deletion content/docs/api-service/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ supplied through the environment than written into the file.

<Callout type="info">
This table was generated from the binary's own list of settings
(`config.Leaves()` in `internal/config/fields.go`) for v1.0.2: 55 settings.
(`config.Leaves()` in `internal/config/fields.go`) for v1.3.2: 55 settings.
`easyp-svc config print` on your version is the authority if they ever disagree.
</Callout>
2 changes: 1 addition & 1 deletion content/docs/api-service/configuration.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ mcp:

<Callout type="info">
Таблица сгенерирована из собственного списка настроек бинарника
(`config.Leaves()` в `internal/config/fields.go`) для v1.0.2: 55 настроек. Если
(`config.Leaves()` в `internal/config/fields.go`) для v1.3.2: 55 настроек. Если
они когда-нибудь разойдутся, прав `easyp-svc config print` вашей версии.
</Callout>
Loading
Loading