yamlock 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/docs/yaml-behavior.md +8 -0
- package/package.json +7 -7
- package/CHANGELOG.md +0 -205
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/yamlock)
|
|
8
8
|
[](https://github.com/phoenixweiss/yamlock/actions/workflows/ci.yml)
|
|
9
9
|
|
|
10
|
+
[Project website](https://phoenixweiss.github.io/yamlock/)
|
|
11
|
+
|
|
10
12
|
# yamlock
|
|
11
13
|
|
|
12
14
|
Value-level encryption for YAML and JSON configuration files. The name **yamlock** combines "YAML" and "lock" while also sounding like "warlock", hinting at a little configuration magic.
|
package/docs/yaml-behavior.md
CHANGED
|
@@ -5,6 +5,14 @@ and serializes that value back to YAML. It does not edit or round-trip the
|
|
|
5
5
|
original YAML syntax tree. A write can therefore preserve data while changing
|
|
6
6
|
or removing presentation details.
|
|
7
7
|
|
|
8
|
+
Empty or comment-only files are treated as empty mappings. Multiple YAML
|
|
9
|
+
documents are rejected before processing or writing.
|
|
10
|
+
|
|
11
|
+
YAML merge sequences (`<<: [source1, source2, ...]`) are limited to 100 source
|
|
12
|
+
mappings. The loader also limits total merge work across the document, counting
|
|
13
|
+
empty source mappings as work. Inputs exceeding these limits are rejected before
|
|
14
|
+
processing or writing; neither the source nor a separate output is modified.
|
|
15
|
+
|
|
8
16
|
## What happens during a rewrite
|
|
9
17
|
|
|
10
18
|
| YAML feature | Current behavior |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yamlock",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"author": "PAVEL TKACHEV (phoenixweiss) <mail@phoenixweiss.me>",
|
|
5
5
|
"description": "Value-level encryption for YAML/JSON configuration files with CLI + Node.js APIs.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/phoenixweiss/yamlock#readme",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"js-yaml": "^4.3.
|
|
60
|
+
"js-yaml": "^4.3.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@eslint/js": "^
|
|
63
|
+
"@eslint/js": "^10.0.1",
|
|
64
64
|
"@types/node": "^22.0.0",
|
|
65
|
-
"eslint": "^9.
|
|
66
|
-
"globals": "^
|
|
67
|
-
"rimraf": "^
|
|
68
|
-
"typescript": "^
|
|
65
|
+
"eslint": "^10.9.0",
|
|
66
|
+
"globals": "^17.11.0",
|
|
67
|
+
"rimraf": "^6.1.3",
|
|
68
|
+
"typescript": "^7.0.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. Release versions are finalized in dedicated commits and use matching numeric Git tags.
|
|
4
|
-
|
|
5
|
-
## [Unreleased]
|
|
6
|
-
|
|
7
|
-
## [1.1.0] - 2026-08-14
|
|
8
|
-
|
|
9
|
-
### Added
|
|
10
|
-
- Tag-gated GitHub Release automation that reuses the full CI matrix, validates the tag against `main`, derives notes from the matching changelog section, verifies a draft, and publishes the release as latest.
|
|
11
|
-
- Structural `pathPatterns` / `--path-patterns` selectors for `processConfig` and CLI encrypt/decrypt/migrate workflows, with whole-segment `*`, `[*]`, and `**` matching, exact-path authentication, and fail-closed validation without reinterpreting existing `paths`.
|
|
12
|
-
|
|
13
|
-
## [1.0.0] - 2026-08-11
|
|
14
|
-
|
|
15
|
-
### Added
|
|
16
|
-
- Authenticated payload v2 for the Node.js API, using AES-256-GCM, scrypt, strict parsing, and authenticated field-path metadata.
|
|
17
|
-
- Frozen legacy payload fixtures and v2 regression tests for deterministic vectors, tampering, malformed input, mixed-format configs, and resource limits.
|
|
18
|
-
- Payload v2 design documentation covering the threat model, serialized format, compatibility, and staged migration.
|
|
19
|
-
- Safe `yamlock migrate` workflow with dry-run summaries, selective paths, mixed-format validation, explicit backups, separate outputs, and atomic permission-preserving writes.
|
|
20
|
-
- Explicit CLI legacy-write compatibility through `yamlock encrypt --legacy`; custom encryption algorithms require this mode.
|
|
21
|
-
- Strict repeated-encryption checks through CLI `--error-on-encrypted` and Node.js `existingPayloadPolicy: 'error'`.
|
|
22
|
-
- Explicit `--force-encrypt` / `existingPayloadPolicy: 'encrypt'` handling for intentional `yl|...` plaintext or nested encryption.
|
|
23
|
-
- YAML rewrite documentation and regression coverage for comments, formatting, anchors, aliases, merge keys, and explicit/custom tags.
|
|
24
|
-
- Public `serializePath(segments)` helper for constructing canonical field paths without string ambiguity.
|
|
25
|
-
- Edge-case regression coverage for empty containers, sparse arrays, special and Unicode keys, empty strings, and large values.
|
|
26
|
-
- Automated npm tarball smoke coverage for package contents, public API imports, and the installed distribution-first CLI.
|
|
27
|
-
- Stable public Node.js error classes and `ERR_*` codes for validation, payload, authentication, legacy decryption, and config-processing failures.
|
|
28
|
-
- Bundled TypeScript declarations and a documented `1.x` stability contract for the public Node.js API.
|
|
29
|
-
- Built-in coverage thresholds plus automated Markdown-link and release-metadata checks.
|
|
30
|
-
- Packaged runnable API and CI/CD examples with regression coverage against the installed distribution.
|
|
31
|
-
- Conventional `help`, `-h`, and `--help` CLI entry points with installed-package smoke coverage.
|
|
32
|
-
- Tracked Bumpster configuration, synchronized `VERSION` metadata, and a pre-bump release gate.
|
|
33
|
-
|
|
34
|
-
### Changed
|
|
35
|
-
- Updated `js-yaml` to 4.3.1 to address merge-key, alias, and ordered-map denial-of-service advisories; refreshed ESLint 9 tooling within the existing major version.
|
|
36
|
-
- Package builds now exclude ignored local dotfiles, and tarball smoke checks recursively for local workflow artifacts.
|
|
37
|
-
- CI now covers supported Node.js releases on Linux and macOS, uses current Node 24-based GitHub Actions, and performs a tag-gated package preflight.
|
|
38
|
-
- Development and dependency updates now target `dev`; Bumpster releases atomically synchronize `dev`, `main`, and `vX.Y.Z` tags.
|
|
39
|
-
- `encryptValue`, `processConfig`, and `yamlock encrypt` now write authenticated v2 payloads by default.
|
|
40
|
-
- `decryptValue` and `processConfig` continue to auto-detect and read both legacy and v2 payloads; API callers can request legacy writing explicitly with `formatVersion: 1` or legacy algorithm options.
|
|
41
|
-
- Repeated `processConfig`/CLI encryption now authenticates and preserves existing payloads instead of adding another encryption layer; fully encrypted in-place inputs are not rewritten.
|
|
42
|
-
- CLI argument parsing now rejects unknown or duplicate options, missing values, extra positional arguments, and options that do not belong to the selected command before reading input files; `keygen --length` accepts only integers from 1 to 4096 bytes.
|
|
43
|
-
- CLI integration tests now force an explicit source mode through the real `bin/yamlock` launcher, preventing stale local `dist` output from masking source changes while preserving distribution-first behavior for normal runs.
|
|
44
|
-
- `processConfig` now validates non-string policies, path options, serializer output, collisions, and circular structures; opaque values are preserved by `ignore`, while `stringify` fails closed for values that cannot be converted without type loss.
|
|
45
|
-
- Selective processing applies non-string policies only to selected leaves, and YAML timestamp values are no longer collapsed into empty objects during CLI traversal.
|
|
46
|
-
- Normal CLI encrypt/decrypt writes now use the shared atomic temporary-file writer, verify that the source did not change after reading, preserve source or existing-output modes, reject symbolic-link paths, and clean up temporary files after failures.
|
|
47
|
-
- CLI help now warns that YAML presentation details are normalized during writes and points users toward `--dry-run` or `--output` workflows.
|
|
48
|
-
- YAML and JSON parse failures now report sanitized diagnostics without echoing source lines that may contain secrets.
|
|
49
|
-
- Default field paths now escape reserved characters in object keys, CLI path lists understand escaped commas, and existing payloads with legacy ambiguous paths remain readable.
|
|
50
|
-
- Config processing and migration now preserve sparse-array length and holes; `processConfig` also retains null prototypes and own keys such as `__proto__` without prototype assignment.
|
|
51
|
-
|
|
52
|
-
## [0.3.0] - 2025-12-01
|
|
53
|
-
### Added
|
|
54
|
-
- `processConfig` non-string policies (`ignore`, `stringify`, `error`) and optional `pathSerializer` hook.
|
|
55
|
-
- Unit tests demonstrating the new policies.
|
|
56
|
-
|
|
57
|
-
### Changed
|
|
58
|
-
- README highlights non-string handling in the advanced usage section.
|
|
59
|
-
|
|
60
|
-
## [0.2.10] - 2025-12-01
|
|
61
|
-
### Added
|
|
62
|
-
- README example demonstrating the `--dry-run` workflow (with sample diff output).
|
|
63
|
-
|
|
64
|
-
### Changed
|
|
65
|
-
- Package version bumped to keep documentation in sync.
|
|
66
|
-
|
|
67
|
-
## [0.2.9] - 2025-12-01
|
|
68
|
-
### Added
|
|
69
|
-
- CLI `--dry-run` flag prints the diff without touching files.
|
|
70
|
-
- Structured error codes (e.g., `[yamlock:ERR_MISSING_KEY]`) for machine-readable failure handling.
|
|
71
|
-
- Integration tests covering dry-run and the new error format.
|
|
72
|
-
|
|
73
|
-
### Changed
|
|
74
|
-
- README documents the `--dry-run` flag and behavior.
|
|
75
|
-
|
|
76
|
-
## [0.2.8] - 2025-12-01
|
|
77
|
-
### Added
|
|
78
|
-
- Advanced usage docs: selective path tips, CI/CD workflow example (`examples/docs/ci-cd.md`), and an expanded key-rotation guide with scripting advice.
|
|
79
|
-
- README now links to the new docs and highlights selective encryption in a dedicated section.
|
|
80
|
-
|
|
81
|
-
### Changed
|
|
82
|
-
- Package version bumped to keep documentation in sync.
|
|
83
|
-
|
|
84
|
-
## [0.2.7] - 2025-12-01
|
|
85
|
-
### Added
|
|
86
|
-
- README badges for npm version and Node test status, plus a release information section summarizing install options.
|
|
87
|
-
|
|
88
|
-
### Changed
|
|
89
|
-
- Package version bumped to keep documentation in sync.
|
|
90
|
-
|
|
91
|
-
## [0.2.6] - 2025-11-28
|
|
92
|
-
### Added
|
|
93
|
-
- Unit tests covering `processConfig` path filters and CLI integration tests for custom algorithms/decrypt paths.
|
|
94
|
-
|
|
95
|
-
### Changed
|
|
96
|
-
- README/CLI behavior unchanged.
|
|
97
|
-
|
|
98
|
-
## [0.2.5] - 2025-11-28
|
|
99
|
-
### Added
|
|
100
|
-
- `yamlock algorithms` now distinguishes between tested presets and other OpenSSL-provided ciphers.
|
|
101
|
-
- Integration tests updated to confirm the new output format.
|
|
102
|
-
|
|
103
|
-
### Changed
|
|
104
|
-
- README notes that the algorithms command shows both tested and additional cipher lists.
|
|
105
|
-
|
|
106
|
-
## [0.2.4] - 2025-11-28
|
|
107
|
-
### Added
|
|
108
|
-
- `yamlock keygen` command generates random keys with configurable length and format, including guidance on storing them.
|
|
109
|
-
- Integration tests covering key generation.
|
|
110
|
-
|
|
111
|
-
### Changed
|
|
112
|
-
- README documents the key generator usage.
|
|
113
|
-
|
|
114
|
-
## [0.2.3] - 2025-11-27
|
|
115
|
-
### Added
|
|
116
|
-
- `yamlock version` command prints the installed CLI version.
|
|
117
|
-
- `yamlock algorithms` lists all ciphers available in the current runtime.
|
|
118
|
-
- Integration tests cover the new commands.
|
|
119
|
-
|
|
120
|
-
### Changed
|
|
121
|
-
- CLI help and README highlight the new commands.
|
|
122
|
-
- Moved shared fixtures under `fixtures/` so the test runner skips them as standalone suites.
|
|
123
|
-
|
|
124
|
-
## [0.2.2] - 2025-11-27
|
|
125
|
-
### Added
|
|
126
|
-
- CLI support for `--paths` (partial encryption/decryption) and `--output` (separate destination files).
|
|
127
|
-
- `processConfig` now accepts targeted path lists so API/CLI share the same behavior.
|
|
128
|
-
|
|
129
|
-
### Changed
|
|
130
|
-
- README documents the new CLI options with examples.
|
|
131
|
-
|
|
132
|
-
## [0.2.1] - 2025-11-26
|
|
133
|
-
### Changed
|
|
134
|
-
- Unified unit tests around shared fixtures/helpers to remove duplication and ensure every supported algorithm is exercised consistently.
|
|
135
|
-
|
|
136
|
-
## [0.2.0] - 2025-11-26
|
|
137
|
-
### Added
|
|
138
|
-
- Algorithm presets with override support (e.g., `chacha20-poly1305` with auth tags, configurable key/IV lengths).
|
|
139
|
-
- API support for passing algorithm options through `encryptValue`, `decryptValue`, and `processConfig`.
|
|
140
|
-
- Additional unit coverage for presets and algorithm-aware config processing.
|
|
141
|
-
|
|
142
|
-
## [0.1.2] - 2025-11-26
|
|
143
|
-
### Fixed
|
|
144
|
-
- CLI binary now falls back to the source entry during development, ensuring `yamlock` works when installed globally or run via `node bin/yamlock`.
|
|
145
|
-
- Integration tests call the published bin, catching future regressions.
|
|
146
|
-
|
|
147
|
-
## [0.1.1] - 2025-11-26
|
|
148
|
-
### Added
|
|
149
|
-
- Key rotation guide under `docs/key-rotation.md` and README link.
|
|
150
|
-
- Documented CLI exit codes and reference to the example script.
|
|
151
|
-
|
|
152
|
-
## [0.1.0] - 2025-11-26
|
|
153
|
-
### Added
|
|
154
|
-
- Example script under `examples/basic.js` demonstrating encrypt/decrypt flows.
|
|
155
|
-
- GitHub Actions CI workflow to lint, test, and build on pushes/PRs.
|
|
156
|
-
- README now links to the example script.
|
|
157
|
-
|
|
158
|
-
## [0.0.10] - 2025-11-26
|
|
159
|
-
### Added
|
|
160
|
-
- Expanded README with usage examples, encrypted format description, and contributing link.
|
|
161
|
-
- CONTRIBUTING guide plus GitHub issue and pull request templates.
|
|
162
|
-
|
|
163
|
-
## [0.0.9] - 2025-11-26
|
|
164
|
-
### Added
|
|
165
|
-
- CLI now auto-detects YAML vs JSON, loads via js-yaml, and writes back preserving the original format.
|
|
166
|
-
- Integration tests covering YAML encrypt/decrypt flows.
|
|
167
|
-
|
|
168
|
-
## [0.0.8] - 2025-11-26
|
|
169
|
-
### Added
|
|
170
|
-
- CLI skeleton capable of encrypting/decrypting JSON files with `--key` and `--algorithm` options.
|
|
171
|
-
- Integration tests covering CLI encrypt/decrypt flows and key validation.
|
|
172
|
-
|
|
173
|
-
## [0.0.7] - 2025-11-26
|
|
174
|
-
### Added
|
|
175
|
-
- Public API exports for `encryptValue`, `decryptValue`, `processConfig`, and `getSupportedAlgorithms`.
|
|
176
|
-
- Unit tests ensuring the API surface is available and round-trips data correctly.
|
|
177
|
-
|
|
178
|
-
## [0.0.6] - 2025-11-25
|
|
179
|
-
### Added
|
|
180
|
-
- `processConfig` helper to walk objects/arrays and encrypt or decrypt every string value based on field paths.
|
|
181
|
-
- Unit tests covering nested traversal, arrays, round-trips, and validation errors.
|
|
182
|
-
|
|
183
|
-
## [0.0.5] - 2025-11-25
|
|
184
|
-
### Added
|
|
185
|
-
- Field path utilities that serialize nested object/array locations (`src/utils/path.js`).
|
|
186
|
-
- Unit tests covering dot/bracket formatting and invalid input handling.
|
|
187
|
-
|
|
188
|
-
## [0.0.4] - 2025-11-25
|
|
189
|
-
### Added
|
|
190
|
-
- `decryptValue` support with field-path validation and yamlock payload parsing.
|
|
191
|
-
- Unit tests for decrypt flow, mismatch handling, and invalid payload detection.
|
|
192
|
-
|
|
193
|
-
## [0.0.3] - 2025-11-24
|
|
194
|
-
### Added
|
|
195
|
-
- `encryptValue` function that encrypts string fields with per-path salts and random IVs.
|
|
196
|
-
- Unit tests covering payload structure, IV randomness, and validation checks.
|
|
197
|
-
|
|
198
|
-
## [0.0.2] - 2025-11-24
|
|
199
|
-
### Added
|
|
200
|
-
- Crypto utility helpers for key derivation, IV generation, salt encoding, and payload formatting/parsing.
|
|
201
|
-
- Unit tests covering the utility layer and yamlock payload parsing.
|
|
202
|
-
|
|
203
|
-
## [0.0.1] - 2025-11-24
|
|
204
|
-
### Added
|
|
205
|
-
- Initial project scaffold: package metadata, README baseline, ESLint config, CLI stub, and directory structure.
|