Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We use Jsonnet extensively in Aperture project for generating control policies.

- Policy spec is expressed in protobuf format

- GRPC gateway plugin is used to generate Swagger (OpenAPI v2) spec from proto files

- Jsonnet bindings are generated from Swagger spec.

- Blueprints are implemented using Jsonnet bindings. The users generate policies from blueprints by providing configuration in yaml (using aperturectl CLI) or via jsonnet mixin.

Relevant links:

- Aperture Blueprints (Jsonnet): https://github.com/fluxninja/aperture/tree/main/blueprints

- Generated doc example: https://docs.fluxninja.com/development/reference/policies/bu...

- CLI for generating policies from blueprints: https://docs.fluxninja.com/development/reference/aperturectl...

- Policy spec: https://docs.fluxninja.com/development/reference/policies/sp...



I'm interested in the code that processes the swagger/openapi into jsonnet, can you link to that?


It’s customized to our policy spec. But you can learn from this and adapt it to your spec.

https://github.com/fluxninja/aperture/blob/main/scripts/json...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: