diff options
| author | alex <alex@pdp7.net> | 2025-10-25 13:33:11 +0200 |
|---|---|---|
| committer | alexpdp7 <alex@corcoles.net> | 2025-10-25 13:34:28 +0200 |
| commit | 190b533c981984b6788396ae7a83dc550782d3c8 (patch) | |
| tree | 02b84353b0471fb4b99c27a7c2f65bcceb002a5d /programming | |
| parent | 817bd11af9a56d4ed4397cf0292abada13584ce5 (diff) | |
Replace programming/configuration_files_proposal with tojson link
Diffstat (limited to 'programming')
| -rw-r--r-- | programming/configuration_files_proposal.md | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/programming/configuration_files_proposal.md b/programming/configuration_files_proposal.md deleted file mode 100644 index 6000be49..00000000 --- a/programming/configuration_files_proposal.md +++ /dev/null @@ -1,92 +0,0 @@ -# Configuration files proposal - -No one will ever agree on the ideal configuration file format. -Therefore, we should allow people to use their preferred configuration file format in all programs. - -## Rough idea - -Write libraries for as many languages as possible that read files like: - -``` -#? yaml -my configuration: - option: value -``` - -``` -#? json -{"my configuration": {"option": "value"}} -``` - -and produces a JSON string with the "parsed" input from the second line onwards. -(Or optionally, a data structure appropriate for the language that you are using.) - -If your program uses this library to read configuration, then your users can write their configuration in their preferred language. - -## Challenges - -* How to prevent arbitrary code execution and other attacks? -* How to support as many configuration languages as possible? - -## Possible solutions - -Use capability-based runtimes and embed capabilities in the first line of the configuration file: - -``` - # Allow the specific format parser to... -+file(./**) # ... read files in the same directory as the configuration file and descendants. -+hostname # ... access the hostname. -+load(https://example.com/file,sha256:...,/file) # ... download a file from the Internet and expose it to the parser. -... -``` - -Be able to refer to different parsers: - -``` -# Built-in parsers -json -yaml -... - -# Parsers installed on the local system -/path/to/my/parser - -# Download parsers on demand -https://example.com/foo-parser -``` - -## Possible implementation - -Use WASM runtimes: - -* They already support capabilities. -* Parsers can be distributed as WASM blobs. - -Maybe use [Extism](https://github.com/extism/extism) to implement. - -## Motivating examples - -### Declarative CI - -`.github/workflows/workflow.yaml`: - -``` -#? https://jsonnet.org/jsonnet.wasm +load(https://jsonnetci.com/rust.libsonnet,sha256:...,/rust.libsonnet) -local rust = import '/rust.libsonnet'; - -rust.github({ - 'supported-archs': ['x86_64-unknown-linux-gnu', ...], - 'attach-binaries-to-releases': true, - 'upload-to-docsrs': true, - ... -}) -``` - -but also `.gitlab-ci.yml`: - -``` -#? https://jsonnet.org/jsonnet.wasm +load(https://jsonnetci.com/rust.libsonnet,sha256:...,/rust.libsonnet) -local rust = import '/rust.libsonnet'; - -rust.gitlab(...) -``` |
