News for hackers. Stuff that matters.
Re:Jsonnet – The Data Templating Language by gillh on Monday March 27, 2023 @01:49PM (#35329883)
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...

Re:Jsonnet – The Data Templating Language by Duologic on Wednesday March 29, 2023 @01:20PM (#35360287)
I'm interested in the code that processes the swagger/openapi into jsonnet, can you link to that?
Re:Jsonnet – The Data Templating Language by gillh on Wednesday March 29, 2023 @01:24PM (#35360344)
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...