Skip to content
Open
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
23 changes: 15 additions & 8 deletions content/docs/api-service/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ failure, after the fact.

The plugin name is `group/name:version`. `group` and `name` match
`^[a-z][a-z0-9-]*$`; `version` matches `^v\d+\.\d+(\.\d+)?$` or is the literal
`latest`. The service itself requires the `:version` part — the easyp CLI adds
`:latest` when a `remote:` entry omits it.
`latest`. The service itself requires the `:version` part — EasyP v1 CLI
combines `remote:` and `version:` from `easyp.gen.yaml` into
`group/name:version` (EasyP v0.17 appended `:latest` when a `remote:` entry
omitted it).

<Callout type="info">
`latest` selects the highest registered version: the registry reads the
Expand Down Expand Up @@ -112,7 +114,8 @@ attempts, and only when the error text contains `connection refused` or
Stderr is kept up to 1 MiB for the error message.
- The process gets its own process group, and on timeout the whole group is
killed with `SIGKILL`.
- The working directory is not set; it is the service's.
- Each invocation gets a fresh temporary working directory under
`plugins_dir/.tmp` (`run-*`), which is removed when the process exits.

That is the whole containment. See [Security](/docs/api-service/security) for
what it does not cover.
Expand Down Expand Up @@ -147,9 +150,10 @@ mounted, or baked into an image. The registry row only points at them.

Republishing a version (`plugins publish --force`) uploads the new archive and
replaces the recorded checksum through `UpdatePlugin`. On next use every replica
sees that its `.sha256` marker no longer matches the registry and refetches; a
directory without a marker (unpacked before v1.2.0) counts as current. An
archive overwritten in storage any other way no longer has the recorded
sees that its `.sha256` marker no longer matches the registry and refetches;
since v1.2.1, a directory without a marker (unpacked before v1.2.0) is also
refetched once whenever the registry has a recorded checksum, and gets a marker.
An archive overwritten in storage any other way no longer has the recorded
checksum, and its next download fails with `CHECKSUM_MISMATCH` — republish it
with `publish --force`, or publish a new version.

Expand All @@ -164,8 +168,11 @@ generation with `UNAVAILABLE` / `STORAGE_UNAVAILABLE`.
| `audit_log` | Enterprise audit trail, partitioned by month, plus `audit_log_default`. |
| `goose_db_version` | Applied migrations. |

Migrations are embedded and applied by the service at start, under a PostgreSQL
session lock. There are no down migrations.
Migrations are embedded and applied automatically (`goose Up`) by the service at
start under a PostgreSQL session lock. Both SQL migrations include
`-- +goose Down` blocks, though the service never runs rollbacks automatically
(and rolling back `00002_audit_log_partitioning.sql` cannot restore partitions
already dropped by retention).

If PostgreSQL is unreachable at start, the service retries with exponential
backoff capped at 5 s. At runtime the readiness endpoint `/` on the health port
Expand Down
26 changes: 16 additions & 10 deletions content/docs/api-service/architecture.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ gRPC-статусы, и конвертация снаружи переписал

Имя плагина — `group/name:version`. `group` и `name` соответствуют
`^[a-z][a-z0-9-]*$`; `version` — `^v\d+\.\d+(\.\d+)?$` или литерал `latest`.
Сервису часть `:version` нужна обязательно — easyp CLI сам дописывает `:latest`,
если в `remote:` её нет.
Сервису часть `:version` нужна обязательно — EasyP v1 CLI склеивает `remote:` и
`version:` из `easyp.gen.yaml` в `group/name:version` (в EasyP v0.17 CLI сам
дописывал `:latest`, если в `remote:` версии не было).

<Callout type="info">
`latest` выбирает самую новую зарегистрированную версию: реестр читает версии
Expand Down Expand Up @@ -112,7 +113,8 @@ gRPC-статусы, и конвертация снаружи переписал
для сообщения об ошибке.
- Процесс получает свою группу процессов, и по таймауту вся группа убивается
`SIGKILL`.
- Рабочая директория не задаётся — она та же, что у сервиса.
- Каждый запуск получает свежий временный рабочий каталог в `plugins_dir/.tmp`
(`run-*`), который удаляется после завершения процесса.

Это вся изоляция. Чего она не покрывает — в
[Безопасности](/ru/docs/api-service/security).
Expand Down Expand Up @@ -148,11 +150,12 @@ gRPC-статусы, и конвертация снаружи переписал
Повторная публикация версии (`plugins publish --force`) загружает новый архив и
заменяет записанную контрольную сумму через `UpdatePlugin`. При следующем
обращении каждая реплика видит, что её маркер `.sha256` больше не совпадает с
реестром, и скачивает архив заново; каталог без маркера (распакованный до
v1.2.0) считается актуальным. Архив, перезаписанный в хранилище любым другим
способом, уже не имеет записанной контрольной суммы, и его следующее скачивание
падает с `CHECKSUM_MISMATCH` — перепубликуйте его через `publish --force` или
выпустите новую версию.
реестром, и скачивает архив заново; начиная с v1.2.1 каталог без маркера
(распакованный до v1.2.0) также перекачивается один раз при наличии записанной
контрольной суммы и получает маркер. Архив, перезаписанный в хранилище любым
другим способом, уже не имеет записанной контрольной суммы, и его следующее
скачивание падает с `CHECKSUM_MISMATCH` — перепубликуйте его через
`publish --force` или выпустите новую версию.

Недоступность хранилища или исчезнувший из бакета архив дают при генерации
`UNAVAILABLE` / `STORAGE_UNAVAILABLE`.
Expand All @@ -165,8 +168,11 @@ v1.2.0) считается актуальным. Архив, перезапис
| `audit_log` | Журнал аудита Enterprise, партиции по месяцам плюс `audit_log_default`. |
| `goose_db_version` | Применённые миграции. |

Миграции встроены в бинарник и применяются сервисом при старте под сессионной
блокировкой PostgreSQL. Down-миграций нет.
Миграции встроены в бинарник и автоматически применяются (`goose Up`) сервисом
при старте под сессионной блокировкой PostgreSQL. Обе SQL-миграции содержат
блоки `-- +goose Down`, хотя сервис не выполняет откаты автоматически (а откат
`00002_audit_log_partitioning.sql` не может восстановить партиции, уже
удалённые по retention).

Если PostgreSQL недоступен при старте, сервис повторяет попытки с
экспоненциальной задержкой не больше 5 с. Во время работы readiness `/` на
Expand Down
8 changes: 5 additions & 3 deletions content/docs/api-service/authentication-and-licensing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The licence is a PASETO v4.public token signed with Ed25519. Verification is
offline: the service does not call anything.

1. The token comes from `license.key` (`LICENSE_KEY`) or the file named by
`license.file`.
`license.file` (`LICENSE_FILE`).
2. The key id in the token's footer selects a public key from
`license.public_keys`; an entry under `"*"` verifies any key id. The Helm
chart ships easyp.tech's current public key (`2026-08`).
Expand All @@ -135,8 +135,10 @@ release, not the token.
- The token is re-validated every `license.cache_ttl` (5 minutes), so the tier
changes on a running service. Replacing the token itself needs a restart.

Dropping to Community is silent for clients: audit stops, the plugin ceiling
starts refusing registrations above 10. The alerts
Dropping to Community is silent for clients: on the running process, audit stops
and the 10-version plugin ceiling starts refusing new registrations immediately,
while the `worker_pool.workers` (4) and `worker_pool.max_concurrent_generations`
(16) ceilings take effect on restart (logged at `Warn`). The alerts
[EasypLicenceExpiringSoon](/docs/api-service/runbooks#easyplicenceexpiringsoon)
and [EasypLicenceInGrace](/docs/api-service/runbooks#easyplicenceingrace) exist
for this.
Expand Down
10 changes: 7 additions & 3 deletions content/docs/api-service/authentication-and-licensing.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ SDK — он поддерживает и то, и другое (`sdk.WithToken`,
Лицензия — токен PASETO v4.public, подписанный Ed25519. Проверка офлайновая:
сервис никуда не обращается.

1. Токен берётся из `license.key` (`LICENSE_KEY`) или из файла `license.file`.
1. Токен берётся из `license.key` (`LICENSE_KEY`) или из файла `license.file`
(`LICENSE_FILE`).
2. Key id из футера токена выбирает публичный ключ из `license.public_keys`;
запись под `"*"` проверяет любой key id. Helm-чарт поставляется с текущим
публичным ключом easyp.tech (`2026-08`).
Expand All @@ -134,8 +135,11 @@ SDK — он поддерживает и то, и другое (`sdk.WithToken`,
- Токен перепроверяется каждые `license.cache_ttl` (5 минут), поэтому редакция
меняется на работающем сервисе. Замена самого токена требует перезапуска.

Для клиентов переход на Community незаметен: аудит прекращается, потолок
плагинов начинает отклонять регистрации сверх 10. Для этого есть алерты
Для клиентов переход на Community незаметен: на работающем процессе аудит
прекращается и потолок в 10 версий плагинов начинает отклонять новые регистрации
сразу, а потолки `worker_pool.workers` (4) и
`worker_pool.max_concurrent_generations` (16) вступают в силу при перезапуске
(в лог пишется `Warn`). Для этого есть алерты
[EasypLicenceExpiringSoon](/ru/docs/api-service/runbooks#easyplicenceexpiringsoon)
и [EasypLicenceInGrace](/ru/docs/api-service/runbooks#easyplicenceingrace).

Expand Down
60 changes: 35 additions & 25 deletions content/docs/api-service/client-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,47 @@ description: "Pointing the easyp CLI at the service, using the Go SDK, and calli

## easyp CLI

A plugin runs on the service when its entry in `generate.plugins` uses `remote:`
instead of `name:`, `path:` or `command:`:
A plugin runs on the service when its entry under `plugins:` in
`easyp.gen.yaml` uses `remote:` and `version:` instead of `name:`, `path:` or
`command:`:

```yaml
generate:
inputs:
- directory:
path: .
root: proto
plugins:
- remote: "plugins.example.com/protocolbuffers/go:v1.36.10"
out: gen/go
opts:
paths: source_relative
- remote: "plugins.example.com/grpc/go:v1.6.2"
out: gen/go
opts:
paths: source_relative
require_unimplemented_servers: false
# easyp.gen.yaml
version: v1
plugins:
- remote: plugins.example.com/protocolbuffers/go
version: v1.36.10
out: gen/go
opts:
paths: source_relative
- remote: plugins.example.com/grpc/go
version: v1.6.2
out: gen/go
opts:
paths: source_relative
require_unimplemented_servers: false
```

### The `remote:` value
<Callout type="info">
On EasyP v0.17 (`easyp.yaml`), remote plugins live under `generate.plugins` and
carry the version in the URL:
`remote: "plugins.example.com/protocolbuffers/go:v1.36.10"`. EasyP v1 requires
`easyp.gen.yaml` with separate `remote:` and `version:` fields.
</Callout>

`[http://|https://]host[:port]/group/name[:version]`
### The `remote:` and `version:` values

`remote:` takes `[http://|https://]host[:port]/group/name` and `version:` takes
a pinned semver tag `vX.Y.Z` (in EasyP v0.17 `easyp.yaml`, both are combined as
`[http://|https://]host[:port]/group/name[:version]`).

| Part | Behaviour |
|---|---|
| scheme | Optional. `https://` or no scheme → TLS; `http://` → plaintext. |
| 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. |
| port | Optional. Without it, the easyp CLI defaults to `:443` — even when `http://` is specified, so include an explicit port for plaintext services (for example `localhost:23410`). 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`, the highest registered version compared by number (`v1.36.11` over `v1.36.9`). |
| version | Required in EasyP v1 (`version: vX.Y.Z`, separate from `remote:`; embedding `:version` in `remote:` or using `latest` is rejected). Direct gRPC/SDK callers — or EasyP v0.17 configs omitting `:version` — resolve `latest` to 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 All @@ -45,7 +54,8 @@ local plugins.
### What the CLI does and does not support

- It parses and resolves `.proto` files locally, including dependencies from
`deps`. Only the resulting `CodeGeneratorRequest` is sent.
`protobuf.mod` / `protobuf.lock` (or `deps` in EasyP v0.17). Only the
resulting `CodeGeneratorRequest` is sent.
- One gRPC call per plugin, each on a new connection, with a fixed **30-second**
deadline. The service's own limit is 120 s; a plugin that needs longer than 30 s
fails on the client side with `DeadlineExceeded` while the server may still be
Expand All @@ -59,8 +69,8 @@ local plugins.
pointing at `buf.build` does not reach Buf's remote plugins — Buf's registry
does not implement this API.

`command:` takes precedence over `remote:`; a plugin entry must have exactly one
source.
A plugin entry must have exactly one source (`name:`, `path:`, `command:`, or
`remote:`); combining them is rejected when validating `easyp.gen.yaml`.

## Go SDK

Expand Down Expand Up @@ -115,7 +125,7 @@ func main() {
| `WithTransportCredentials(creds)` | — | Private CA, client certificate (mTLS). |
| `WithToken(token)` | — | `authorization: Bearer` on every call. Needed for writes, and for reads when the service requires authentication. |
| `WithGenerateCodeTimeout(d)` | 30 s | Per-call deadline when the context has none. Raise it towards the server's `generation_timeout`. |
| `WithListPluginsTimeout(d)` | 10 s | Spans the whole paginated walk. |
| `WithListPluginsTimeout(d)` | 10 s | Applied **per page** (`Plugins` RPC), not across the whole walk. To cap the overall traversal budget, set a deadline on `ctx` (the earlier deadline wins). |
| `WithCreatePluginTimeout(d)` | 120 s | Registration checks the archive in storage, and reads it when the object carries no checksum. |
| `WithMaxRetries(n)`, `WithRetryBaseDelay(d)`, `WithRetryMaxDelay(d)` | 3, 100 ms, 5 s | Exponential backoff. |
| `WithMaxRecvMsgSize(n)` | 64 MiB | Matches the server's output limit. |
Expand Down
Loading
Loading