datamasque-cli 1.6.0__tar.gz → 1.7.0__tar.gz
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.
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/CHANGELOG.md +57 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/CONTRIBUTING.md +1 -1
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/PKG-INFO +62 -10
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/README.md +60 -8
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/README.md +18 -2
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/datamasque-cli/.claude-plugin/plugin.json +1 -1
- datamasque_cli-1.7.0/claude-skills/datamasque-cli/plugin.json +10 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/datamasque-cli/skills/datamasque-cli/SKILL.md +16 -2
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/.claude-plugin/plugin.json +1 -1
- datamasque_cli-1.7.0/claude-skills/ruleset-builder/plugin.json +16 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/skills/ruleset-builder/SKILL.md +8 -8
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/skills/ruleset-builder/references/ruleset-libraries-guide.md +6 -6
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/skills/ruleset-builder/references/ruleset-yaml-reference.md +2 -2
- datamasque_cli-1.7.0/claude-skills/ruleset-splitter/plugin.json +16 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/pyproject.toml +2 -2
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/client.py +21 -6
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/connections.py +36 -20
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/discovery.py +26 -12
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/discovery_config_libraries.py +47 -39
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/discovery_configs.py +52 -18
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/files.py +29 -9
- datamasque_cli-1.7.0/src/datamasque_cli/commands/projects.py +158 -0
- datamasque_cli-1.7.0/src/datamasque_cli/commands/resources.py +151 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/ruleset_libraries.py +50 -45
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/rulesets.py +97 -57
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/runs.py +48 -38
- datamasque_cli-1.7.0/src/datamasque_cli/commands/seeds.py +75 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/system.py +2 -1
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/table_references.py +65 -38
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/main.py +4 -0
- datamasque_cli-1.7.0/src/datamasque_cli/projects.py +152 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_connections.py +12 -11
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_discovery.py +66 -51
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_discovery_config_libraries.py +108 -45
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_discovery_configs.py +38 -15
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_files.py +8 -5
- datamasque_cli-1.7.0/tests/commands/test_project_options.py +409 -0
- datamasque_cli-1.7.0/tests/commands/test_projects.py +223 -0
- datamasque_cli-1.7.0/tests/commands/test_resources.py +183 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_ruleset_libraries.py +130 -16
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_rulesets.py +139 -59
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_runs.py +36 -52
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_seeds.py +6 -5
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_table_references.py +141 -41
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/conftest.py +30 -5
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/conftest.py +34 -20
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_discovery_configs.py +18 -15
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_rulesets.py +2 -2
- datamasque_cli-1.7.0/tests/test_plugin_manifests.py +15 -0
- datamasque_cli-1.7.0/tests/test_projects.py +131 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/uv.lock +5 -5
- datamasque_cli-1.6.0/src/datamasque_cli/commands/seeds.py +0 -57
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/.claude-plugin/marketplace.json +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/.github/workflows/ci.yml +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/.github/workflows/release-testpypi.yml +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/.github/workflows/release.yml +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/.gitignore +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/LICENSE +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/Makefile +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/NOTICE +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/assets/demo.gif +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/skills/ruleset-builder/references/fk-cascade.md +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/skills/ruleset-builder/references/hash-columns-guide.md +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-builder/skills/ruleset-builder/references/mask-definitions-guide.md +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-splitter/.claude-plugin/plugin.json +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/claude-skills/ruleset-splitter/skills/ruleset-splitter/SKILL.md +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/scripts/active_profile_env.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/scripts/bump_version.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/scripts/installation_smoke_test.sh +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/__init__.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/__init__.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/auth.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/ifm.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/commands/users.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/config.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/errors.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/fileio.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/output.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/protocols.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/src/datamasque_cli/py.typed +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/__init__.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/__init__.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_auth.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_catalog.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_ifm.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_system.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/commands/test_users.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/README.md +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/__init__.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_connections.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_delete_safety.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_discovery.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_runs.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_system.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/integration/test_table_references.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_client_auth.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_client_connections.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_client_env.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_client_ifm.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_client_profile.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_config.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_main.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_output.py +0 -0
- {datamasque_cli-1.6.0 → datamasque_cli-1.7.0}/tests/test_version.py +0 -0
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.7.0
|
|
4
|
+
|
|
5
|
+
`dm` works with DataMasque projects.
|
|
6
|
+
Every connection, ruleset, library, discovery config, seed, file and table
|
|
7
|
+
reference belongs to one project.
|
|
8
|
+
|
|
9
|
+
### Breaking changes
|
|
10
|
+
- `dm` needs DataMasque v3.26.22.0 or later, the first version with projects.
|
|
11
|
+
Use `datamasque-cli` 1.5.1 with an earlier DataMasque version.
|
|
12
|
+
- `--namespace` is removed from `dm libraries` and `dm discover libraries`.
|
|
13
|
+
Use `--project`.
|
|
14
|
+
- `dm rulesets export-bundle` and `import-bundle` use the v2 export and import
|
|
15
|
+
endpoints. A bundle files each item under its project, and an import puts
|
|
16
|
+
the item in that project.
|
|
17
|
+
- `dm rulesets export-bundle` bundles seed files only with
|
|
18
|
+
`--include-seed-files`.
|
|
19
|
+
- `dm` needs datamasque-python 1.6.0 or later.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- `--project` on connections, rulesets, libraries, discovery configs,
|
|
23
|
+
discovery config libraries, seeds, files, table references, runs and
|
|
24
|
+
discovery runs. It takes a project name in any case, or the numeric ID.
|
|
25
|
+
- List commands show each resource's project, and `--project` lists one
|
|
26
|
+
project's resources.
|
|
27
|
+
- Create, upload and validate commands put the resource in the `--project`
|
|
28
|
+
project. Without `--project` they use the instance's only project, and
|
|
29
|
+
fail and ask for `--project` when the instance has several.
|
|
30
|
+
- Get, update and delete commands find a name in any project. They ask for
|
|
31
|
+
`--project` when the name exists in more than one project.
|
|
32
|
+
- `dm projects` — manage projects (`list`, `get`, `create`, `update`,
|
|
33
|
+
`delete`). `list --include-deleted` adds deleted projects. `delete --to`
|
|
34
|
+
names the project that receives the deleted project's resources, and
|
|
35
|
+
`--check` lists what stops the delete without deleting.
|
|
36
|
+
- `dm resources move --to <project>` — move resources to another project,
|
|
37
|
+
with their files and runs. `--project`, `--type`, `--search` or exact names
|
|
38
|
+
select the resources. When a resource clashes with the destination, no
|
|
39
|
+
resource moves, and the command lists each conflict and exits with the
|
|
40
|
+
`conflict` code. `--check` previews the move.
|
|
41
|
+
- `dm rulesets export-bundle --include-seed-files` also bundles the custom
|
|
42
|
+
seed files the rulesets and libraries use.
|
|
43
|
+
- `dm rulesets import-bundle --fallback-project` names the project for the
|
|
44
|
+
items a bundle files under no project, such as the items in an older
|
|
45
|
+
bundle. Without it they go into the server's default project.
|
|
46
|
+
- Kiro can load the bundled skills. Each plugin under `claude-skills/` has a
|
|
47
|
+
root `plugin.json`, and `claude-skills/README.md` gives the Kiro import
|
|
48
|
+
steps.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
- `dm table-references create` and `update` look up `--connection` in the
|
|
52
|
+
reference's own project first, then in every project.
|
|
53
|
+
- The `ruleset-builder` skill reads its reference files by paths relative to
|
|
54
|
+
the skill directory, and tracks its steps with the host's task tool or a
|
|
55
|
+
chat checklist, so it runs in hosts other than Claude Code.
|
|
56
|
+
- The `datamasque-cli` and `ruleset-builder` plugins are version 1.2.0. Their
|
|
57
|
+
skills use `--project` in place of `--namespace`, so update the plugins with
|
|
58
|
+
`dm`.
|
|
59
|
+
|
|
3
60
|
## v1.6.0
|
|
4
61
|
|
|
5
62
|
### Added
|
|
@@ -97,7 +97,7 @@ so no DataMasque server is required.
|
|
|
97
97
|
### Integration tests
|
|
98
98
|
|
|
99
99
|
`tests/integration/` hits a real DataMasque instance to catch the bugs unit tests can't —
|
|
100
|
-
ruleset
|
|
100
|
+
a database and a file ruleset sharing a name,
|
|
101
101
|
delete targeting,
|
|
102
102
|
server-state resolution,
|
|
103
103
|
and the full `run start → retry → logs --follow` lifecycle.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datamasque-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Official command-line interface for the DataMasque data-masking platform.
|
|
5
5
|
Project-URL: Homepage, https://datamasque.com/
|
|
6
6
|
Project-URL: Repository, https://github.com/datamasque/datamasque-cli
|
|
@@ -23,7 +23,7 @@ Classifier: Topic :: Database
|
|
|
23
23
|
Classifier: Topic :: Utilities
|
|
24
24
|
Classifier: Typing :: Typed
|
|
25
25
|
Requires-Python: >=3.11
|
|
26
|
-
Requires-Dist: datamasque-python<2,>=1.
|
|
26
|
+
Requires-Dist: datamasque-python<2,>=1.6.0
|
|
27
27
|
Requires-Dist: pydantic<3,>=2.5
|
|
28
28
|
Requires-Dist: rich>=13.8
|
|
29
29
|
Requires-Dist: tomli-w<2,>=1.0.0
|
|
@@ -140,6 +140,28 @@ For instances with self-signed or expired TLS certificates
|
|
|
140
140
|
pass `--insecure` to `dm auth login` to persist the toggle on the profile,
|
|
141
141
|
or set `DATAMASQUE_VERIFY_SSL=false` to skip verification per call.
|
|
142
142
|
|
|
143
|
+
## Projects
|
|
144
|
+
|
|
145
|
+
Every connection, ruleset, library, discovery config, seed, file and table reference belongs to one project.
|
|
146
|
+
This CLI needs a DataMasque version with projects (v3.26.22.0 or later); use an earlier CLI release with older versions.
|
|
147
|
+
|
|
148
|
+
- `--project` takes a project name (any case) or its numeric ID.
|
|
149
|
+
- List commands show each resource's project, and `--project` lists only that project's resources
|
|
150
|
+
(plus the built-in seeds, for `dm seeds list`).
|
|
151
|
+
- Create, upload and validate commands put the resource in the `--project` project.
|
|
152
|
+
Without `--project`, a create updates the resource of that name in the one project that has it
|
|
153
|
+
(for rulesets and discovery configs, the one of the same type).
|
|
154
|
+
Otherwise they use the instance's only project, and fail asking for one when there are several.
|
|
155
|
+
- Get, update and delete commands find a resource by name in any project.
|
|
156
|
+
When the name exists in more than one project they fail asking for `--project`.
|
|
157
|
+
|
|
158
|
+
```console
|
|
159
|
+
dm rulesets list --project Finance
|
|
160
|
+
dm rulesets create --name customers --file rules.yaml --type database --project Finance
|
|
161
|
+
dm seeds upload names.csv --project Finance
|
|
162
|
+
dm run start -c finance_db -r customers --project Finance
|
|
163
|
+
```
|
|
164
|
+
|
|
143
165
|
## Commands
|
|
144
166
|
|
|
145
167
|
### Authentication
|
|
@@ -180,9 +202,11 @@ dm rulesets generate --file request.json # Generate from schema
|
|
|
180
202
|
dm rulesets generate --file req.json -o out.yaml # Generate to file
|
|
181
203
|
dm rulesets validate --file rules.yaml --type database|file # Validate against server (YAML under 60 KiB)
|
|
182
204
|
dm rulesets status <name> # Validation status; poll after creating YAML of 60 KiB+
|
|
183
|
-
dm rulesets export-bundle -o bundle.zip # Export rulesets + libraries
|
|
205
|
+
dm rulesets export-bundle -o bundle.zip # Export rulesets + libraries, by project
|
|
206
|
+
dm rulesets export-bundle -o bundle.zip --include-seed-files # Also bundle the custom seed files they use
|
|
184
207
|
dm rulesets import-bundle --file bundle.zip # Import a previously exported bundle
|
|
185
208
|
dm rulesets import-bundle -f bundle.zip --overwrite-rulesets --overwrite-libraries # Replace existing entries
|
|
209
|
+
dm rulesets import-bundle -f bundle.zip --fallback-project <project> # Project for items filed under none
|
|
186
210
|
```
|
|
187
211
|
|
|
188
212
|
### Ruleset libraries
|
|
@@ -192,11 +216,11 @@ dm libraries list # List all libraries
|
|
|
192
216
|
dm libraries get <name> # Show library details
|
|
193
217
|
dm libraries get <name> --yaml # Print raw YAML only
|
|
194
218
|
dm libraries create --name <n> --file lib.yaml # Create/update from file
|
|
195
|
-
dm libraries create --name <n> --file lib.yaml --
|
|
219
|
+
dm libraries create --name <n> --file lib.yaml --project pii # In a given project
|
|
196
220
|
dm libraries delete <name> # Delete a library
|
|
197
221
|
dm libraries validate <name> # Re-validate against current server schema
|
|
198
222
|
dm libraries status <name> # Validation status; poll after creating YAML of 60 KiB+
|
|
199
|
-
dm libraries usage <name> # Show rulesets using it
|
|
223
|
+
dm libraries usage <name> # Show rulesets using it, with their projects
|
|
200
224
|
```
|
|
201
225
|
|
|
202
226
|
### Table references
|
|
@@ -212,6 +236,34 @@ dm table-references update <name> --delimiter ';' --null-string NULL # Any CS
|
|
|
212
236
|
dm table-references delete <name> # Delete a table reference
|
|
213
237
|
```
|
|
214
238
|
|
|
239
|
+
### Projects
|
|
240
|
+
|
|
241
|
+
```console
|
|
242
|
+
dm projects list # id, name, description, created
|
|
243
|
+
dm projects list --include-deleted # Adds deleted projects, with a deleted column
|
|
244
|
+
dm projects get <name-or-id> # Show a project's details
|
|
245
|
+
dm projects create --name <name> --description "<text>"
|
|
246
|
+
dm projects update <name-or-id> --name <new-name> # Rename; --description changes the description
|
|
247
|
+
dm projects delete <name-or-id> --to <name-or-id> # Move every resource to the --to project, then delete
|
|
248
|
+
dm projects delete <name-or-id> --to <name-or-id> --check # Only list what would stop the delete
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Creating, renaming and deleting projects needs an admin user.
|
|
252
|
+
Renaming makes rulesets and configurations that import one of the project's libraries by the old project name invalid.
|
|
253
|
+
|
|
254
|
+
### Moving resources
|
|
255
|
+
|
|
256
|
+
```console
|
|
257
|
+
dm resources move --project Finance --to Archive # Every resource in Finance
|
|
258
|
+
dm resources move customers orders --type rulesets --to Archive # Rulesets with these exact names, from any project
|
|
259
|
+
dm resources move --search payroll --to HR --check # Only list the matches and what would stop them moving
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Resources move with their files and runs. `--project`, `--type`, `--search` and names combine; pass at least one.
|
|
263
|
+
All of the resources move, or none do. A resource that clashes with the destination (same name, or a file in the way)
|
|
264
|
+
stops the move, and the command exits with the `conflict` code, listing each one. A resource already in the
|
|
265
|
+
destination stays there, and the others move.
|
|
266
|
+
|
|
215
267
|
### In-flight masking
|
|
216
268
|
|
|
217
269
|
The IFM service runs alongside the admin server,
|
|
@@ -292,11 +344,11 @@ The same library can be imported by both database and file discovery configs.
|
|
|
292
344
|
|
|
293
345
|
```console
|
|
294
346
|
dm discover libraries list
|
|
295
|
-
dm discover libraries get <name> [--
|
|
296
|
-
dm discover libraries create --name <n> --
|
|
297
|
-
dm discover libraries delete <name> [--
|
|
298
|
-
dm discover libraries validate -f lib.yaml
|
|
299
|
-
dm discover libraries status <name> [--
|
|
347
|
+
dm discover libraries get <name> [--project org] [--yaml]
|
|
348
|
+
dm discover libraries create --name <n> --project org -f lib.yaml
|
|
349
|
+
dm discover libraries delete <name> [--project org] [--force] # --force if imported by configs
|
|
350
|
+
dm discover libraries validate -f lib.yaml [--project org]
|
|
351
|
+
dm discover libraries status <name> [--project org]
|
|
300
352
|
```
|
|
301
353
|
|
|
302
354
|
### Seeds
|
|
@@ -108,6 +108,28 @@ For instances with self-signed or expired TLS certificates
|
|
|
108
108
|
pass `--insecure` to `dm auth login` to persist the toggle on the profile,
|
|
109
109
|
or set `DATAMASQUE_VERIFY_SSL=false` to skip verification per call.
|
|
110
110
|
|
|
111
|
+
## Projects
|
|
112
|
+
|
|
113
|
+
Every connection, ruleset, library, discovery config, seed, file and table reference belongs to one project.
|
|
114
|
+
This CLI needs a DataMasque version with projects (v3.26.22.0 or later); use an earlier CLI release with older versions.
|
|
115
|
+
|
|
116
|
+
- `--project` takes a project name (any case) or its numeric ID.
|
|
117
|
+
- List commands show each resource's project, and `--project` lists only that project's resources
|
|
118
|
+
(plus the built-in seeds, for `dm seeds list`).
|
|
119
|
+
- Create, upload and validate commands put the resource in the `--project` project.
|
|
120
|
+
Without `--project`, a create updates the resource of that name in the one project that has it
|
|
121
|
+
(for rulesets and discovery configs, the one of the same type).
|
|
122
|
+
Otherwise they use the instance's only project, and fail asking for one when there are several.
|
|
123
|
+
- Get, update and delete commands find a resource by name in any project.
|
|
124
|
+
When the name exists in more than one project they fail asking for `--project`.
|
|
125
|
+
|
|
126
|
+
```console
|
|
127
|
+
dm rulesets list --project Finance
|
|
128
|
+
dm rulesets create --name customers --file rules.yaml --type database --project Finance
|
|
129
|
+
dm seeds upload names.csv --project Finance
|
|
130
|
+
dm run start -c finance_db -r customers --project Finance
|
|
131
|
+
```
|
|
132
|
+
|
|
111
133
|
## Commands
|
|
112
134
|
|
|
113
135
|
### Authentication
|
|
@@ -148,9 +170,11 @@ dm rulesets generate --file request.json # Generate from schema
|
|
|
148
170
|
dm rulesets generate --file req.json -o out.yaml # Generate to file
|
|
149
171
|
dm rulesets validate --file rules.yaml --type database|file # Validate against server (YAML under 60 KiB)
|
|
150
172
|
dm rulesets status <name> # Validation status; poll after creating YAML of 60 KiB+
|
|
151
|
-
dm rulesets export-bundle -o bundle.zip # Export rulesets + libraries
|
|
173
|
+
dm rulesets export-bundle -o bundle.zip # Export rulesets + libraries, by project
|
|
174
|
+
dm rulesets export-bundle -o bundle.zip --include-seed-files # Also bundle the custom seed files they use
|
|
152
175
|
dm rulesets import-bundle --file bundle.zip # Import a previously exported bundle
|
|
153
176
|
dm rulesets import-bundle -f bundle.zip --overwrite-rulesets --overwrite-libraries # Replace existing entries
|
|
177
|
+
dm rulesets import-bundle -f bundle.zip --fallback-project <project> # Project for items filed under none
|
|
154
178
|
```
|
|
155
179
|
|
|
156
180
|
### Ruleset libraries
|
|
@@ -160,11 +184,11 @@ dm libraries list # List all libraries
|
|
|
160
184
|
dm libraries get <name> # Show library details
|
|
161
185
|
dm libraries get <name> --yaml # Print raw YAML only
|
|
162
186
|
dm libraries create --name <n> --file lib.yaml # Create/update from file
|
|
163
|
-
dm libraries create --name <n> --file lib.yaml --
|
|
187
|
+
dm libraries create --name <n> --file lib.yaml --project pii # In a given project
|
|
164
188
|
dm libraries delete <name> # Delete a library
|
|
165
189
|
dm libraries validate <name> # Re-validate against current server schema
|
|
166
190
|
dm libraries status <name> # Validation status; poll after creating YAML of 60 KiB+
|
|
167
|
-
dm libraries usage <name> # Show rulesets using it
|
|
191
|
+
dm libraries usage <name> # Show rulesets using it, with their projects
|
|
168
192
|
```
|
|
169
193
|
|
|
170
194
|
### Table references
|
|
@@ -180,6 +204,34 @@ dm table-references update <name> --delimiter ';' --null-string NULL # Any CS
|
|
|
180
204
|
dm table-references delete <name> # Delete a table reference
|
|
181
205
|
```
|
|
182
206
|
|
|
207
|
+
### Projects
|
|
208
|
+
|
|
209
|
+
```console
|
|
210
|
+
dm projects list # id, name, description, created
|
|
211
|
+
dm projects list --include-deleted # Adds deleted projects, with a deleted column
|
|
212
|
+
dm projects get <name-or-id> # Show a project's details
|
|
213
|
+
dm projects create --name <name> --description "<text>"
|
|
214
|
+
dm projects update <name-or-id> --name <new-name> # Rename; --description changes the description
|
|
215
|
+
dm projects delete <name-or-id> --to <name-or-id> # Move every resource to the --to project, then delete
|
|
216
|
+
dm projects delete <name-or-id> --to <name-or-id> --check # Only list what would stop the delete
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Creating, renaming and deleting projects needs an admin user.
|
|
220
|
+
Renaming makes rulesets and configurations that import one of the project's libraries by the old project name invalid.
|
|
221
|
+
|
|
222
|
+
### Moving resources
|
|
223
|
+
|
|
224
|
+
```console
|
|
225
|
+
dm resources move --project Finance --to Archive # Every resource in Finance
|
|
226
|
+
dm resources move customers orders --type rulesets --to Archive # Rulesets with these exact names, from any project
|
|
227
|
+
dm resources move --search payroll --to HR --check # Only list the matches and what would stop them moving
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Resources move with their files and runs. `--project`, `--type`, `--search` and names combine; pass at least one.
|
|
231
|
+
All of the resources move, or none do. A resource that clashes with the destination (same name, or a file in the way)
|
|
232
|
+
stops the move, and the command exits with the `conflict` code, listing each one. A resource already in the
|
|
233
|
+
destination stays there, and the others move.
|
|
234
|
+
|
|
183
235
|
### In-flight masking
|
|
184
236
|
|
|
185
237
|
The IFM service runs alongside the admin server,
|
|
@@ -260,11 +312,11 @@ The same library can be imported by both database and file discovery configs.
|
|
|
260
312
|
|
|
261
313
|
```console
|
|
262
314
|
dm discover libraries list
|
|
263
|
-
dm discover libraries get <name> [--
|
|
264
|
-
dm discover libraries create --name <n> --
|
|
265
|
-
dm discover libraries delete <name> [--
|
|
266
|
-
dm discover libraries validate -f lib.yaml
|
|
267
|
-
dm discover libraries status <name> [--
|
|
315
|
+
dm discover libraries get <name> [--project org] [--yaml]
|
|
316
|
+
dm discover libraries create --name <n> --project org -f lib.yaml
|
|
317
|
+
dm discover libraries delete <name> [--project org] [--force] # --force if imported by configs
|
|
318
|
+
dm discover libraries validate -f lib.yaml [--project org]
|
|
319
|
+
dm discover libraries status <name> [--project org]
|
|
268
320
|
```
|
|
269
321
|
|
|
270
322
|
### Seeds
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Claude Code
|
|
1
|
+
# Skills for Claude Code and Kiro
|
|
2
2
|
|
|
3
3
|
- **`datamasque-cli/`** —
|
|
4
|
-
teaches
|
|
4
|
+
teaches the agent how to operate a DataMasque instance with `dm`:
|
|
5
5
|
- authenticate,
|
|
6
6
|
- list connections,
|
|
7
7
|
- start runs,
|
|
@@ -17,6 +17,10 @@ joins DataMasque's many-file generated rulesets into one file for editing, then
|
|
|
17
17
|
|
|
18
18
|
## Install
|
|
19
19
|
|
|
20
|
+
All three skills run `dm`. [Install the CLI](../README.md#installation) first.
|
|
21
|
+
|
|
22
|
+
### Claude Code
|
|
23
|
+
|
|
20
24
|
In [Claude Code](https://claude.com/claude-code), add this repo as a plugin marketplace and install the plugins you want:
|
|
21
25
|
|
|
22
26
|
```
|
|
@@ -26,8 +30,20 @@ In [Claude Code](https://claude.com/claude-code), add this repo as a plugin mark
|
|
|
26
30
|
/plugin install ruleset-splitter@datamasque-tools
|
|
27
31
|
```
|
|
28
32
|
|
|
33
|
+
### Kiro
|
|
34
|
+
|
|
35
|
+
Clone this repo.
|
|
36
|
+
In [Kiro](https://kiro.dev/docs/powers/installation/), select **Powers → Add Custom Power → Import power from a folder**.
|
|
37
|
+
Import each plugin folder as a separate power:
|
|
38
|
+
|
|
39
|
+
- `claude-skills/datamasque-cli`
|
|
40
|
+
- `claude-skills/ruleset-builder`
|
|
41
|
+
- `claude-skills/ruleset-splitter`
|
|
42
|
+
|
|
29
43
|
## Uninstall
|
|
30
44
|
|
|
45
|
+
In Claude Code:
|
|
46
|
+
|
|
31
47
|
```
|
|
32
48
|
/plugin uninstall datamasque-cli@datamasque-tools
|
|
33
49
|
/plugin uninstall ruleset-builder@datamasque-tools
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datamasque-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "DataMasque command-line interface integration. Drive DataMasque from Claude Code: list connections, kick off runs, stream logs, download reports.",
|
|
5
5
|
"author": { "name": "DataMasque Ltd" },
|
|
6
6
|
"repository": "https://github.com/datamasque/datamasque-cli",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "datamasque-cli",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"description": "DataMasque command-line interface integration. Drive DataMasque from your agent: list connections, kick off runs, stream logs, download reports.",
|
|
6
|
+
"author": { "name": "DataMasque Ltd" },
|
|
7
|
+
"repository": "https://github.com/datamasque/datamasque-cli",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"keywords": ["datamasque", "data-masking", "cli"]
|
|
10
|
+
}
|
|
@@ -54,12 +54,26 @@ Pass repeated `--options key=value` for server-side knobs
|
|
|
54
54
|
|
|
55
55
|
## Idioms and gotchas
|
|
56
56
|
|
|
57
|
-
- **
|
|
58
|
-
|
|
57
|
+
- **Database and file rulesets.** A `database` and a `file` ruleset can
|
|
58
|
+
share a name, so `customers` can exist as both. `dm run start` reads the
|
|
59
59
|
source connection's type and picks the matching ruleset automatically.
|
|
60
60
|
For `get` / `create` / `delete`, pass `--type database|file` only when
|
|
61
61
|
two rows share the name and you need to disambiguate.
|
|
62
62
|
|
|
63
|
+
- **Projects.** Every resource belongs to one project, and names are unique
|
|
64
|
+
per project (per project and type for rulesets and discovery configs). Lists show each resource's project, and `--project <name>`
|
|
65
|
+
narrows a list to one project. A create with no `--project` updates the
|
|
66
|
+
resource of that name in the one project that has it (same type, for
|
|
67
|
+
rulesets and discovery configs). Otherwise a create or upload with no
|
|
68
|
+
`--project` goes into the instance's only project, and fails with
|
|
69
|
+
`ambiguous` when there are several. A get or delete fails with `ambiguous` when the name
|
|
70
|
+
exists in two projects; pass `--project` to pick one.
|
|
71
|
+
`dm projects` creates, renames and deletes projects (delete needs `--to`, the
|
|
72
|
+
project that takes its resources). `dm resources move --to <project>` moves
|
|
73
|
+
resources selected by `--project`, `--type`, `--search` or exact names; it
|
|
74
|
+
moves nothing and exits `conflict` when any of them clashes with the
|
|
75
|
+
destination. Add `--check` to only preview.
|
|
76
|
+
|
|
63
77
|
- **File masking needs a destination.** Database masking is in-place;
|
|
64
78
|
file masking writes through to a destination connection and fails
|
|
65
79
|
with `invalid_input` without `--destination`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruleset-builder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Convert auto-generated DataMasque rulesets into production-ready form. Validate and iterate.",
|
|
5
5
|
"author": { "name": "DataMasque Ltd" },
|
|
6
6
|
"repository": "https://github.com/datamasque/datamasque-cli",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "ruleset-builder",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"description": "Convert auto-generated DataMasque rulesets into production-ready form. Validate and iterate.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "DataMasque Ltd"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/datamasque/datamasque-cli",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"datamasque",
|
|
13
|
+
"ruleset",
|
|
14
|
+
"yaml"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -14,13 +14,13 @@ Transform auto-generated DataMasque rulesets into production-ready rulesets with
|
|
|
14
14
|
|
|
15
15
|
FK cascade is automatic: mask the parent PK with `imitate_unique` (or `imitate_uuid` / `imitate_nz_ird`) and the engine replicates the rule onto every FK column referencing it. **Do NOT add explicit rules for FK columns.** Avoid `from_unique_imitate` and `mask_unique_key` (both deprecated). Never skip IDs.
|
|
16
16
|
|
|
17
|
-
5-step process (1–5).
|
|
17
|
+
5-step process (1–5). Track all 5 with the host's task tool (`TaskCreate` in Claude Code, the todo list in Kiro CLI). If the host has no task tool, keep a checklist in chat. Report after each step before proceeding. The prompt must include business domain and application type — ask if missing.
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
## Step 1: Report versions
|
|
22
22
|
|
|
23
|
-
Report the Ruleset Builder version
|
|
23
|
+
Report the Ruleset Builder version and `dm version` so the operator can correlate output with releases. Read the Ruleset Builder version from `../../.claude-plugin/plugin.json` or `../../plugin.json`, relative to this skill's directory. If neither file exists, report the version as unknown.
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -29,12 +29,12 @@ Report the Ruleset Builder version (from `plugin.json`) and `dm version` so the
|
|
|
29
29
|
Canonical mask reference:
|
|
30
30
|
<https://portal.datamasque.com/portal/documentation/latest/masking-functions-overview.html>
|
|
31
31
|
|
|
32
|
-
Read all of these before any other work:
|
|
32
|
+
Read all of these, relative to this skill's directory, before any other work:
|
|
33
33
|
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
references/fk-cascade.md
|
|
35
|
+
references/mask-definitions-guide.md
|
|
36
|
+
references/hash-columns-guide.md
|
|
37
|
+
references/ruleset-yaml-reference.md
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
---
|
|
@@ -97,7 +97,7 @@ masks:
|
|
|
97
97
|
|
|
98
98
|
### Output format
|
|
99
99
|
|
|
100
|
-
`Global/RuleLib` below is a placeholder for `<
|
|
100
|
+
`Global/RuleLib` below is a placeholder for `<project>/<library_name>` — substitute the operator's real values, and create the library with `dm libraries create` before running the ruleset.
|
|
101
101
|
|
|
102
102
|
```yaml
|
|
103
103
|
version: '1.0'
|
|
@@ -8,10 +8,10 @@ Define masking logic once, reuse it everywhere.
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
dm libraries list # List all libraries
|
|
11
|
-
dm libraries get <name> [--
|
|
12
|
-
dm libraries create --name <name> --file lib.yml [--
|
|
13
|
-
dm libraries delete <name> [--
|
|
14
|
-
dm libraries usage <name> [--
|
|
11
|
+
dm libraries get <name> [--project <p>] [--yaml] # Show details or YAML
|
|
12
|
+
dm libraries create --name <name> --file lib.yml [--project <p>]
|
|
13
|
+
dm libraries delete <name> [--project <p>] [--force]
|
|
14
|
+
dm libraries usage <name> [--project <p>] # Which rulesets use it
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Library Structure
|
|
@@ -78,8 +78,8 @@ other:
|
|
|
78
78
|
Rulesets reference library content using `$ref`:
|
|
79
79
|
|
|
80
80
|
```
|
|
81
|
-
$ref: "<
|
|
82
|
-
$ref: "<library_name>#<section>/<key>" #
|
|
81
|
+
$ref: "<project>/<library_name>#<section>/<key>"
|
|
82
|
+
$ref: "<library_name>#<section>/<key>" # The ruleset's own project
|
|
83
83
|
$ref: "<lib>#<section>/<key>/<nested_key>" # Nested access
|
|
84
84
|
$ref: "<lib>#<section>/0" # Array index
|
|
85
85
|
```
|
|
@@ -187,12 +187,12 @@ See `ruleset-libraries-guide.md` for full details.
|
|
|
187
187
|
|
|
188
188
|
```yaml
|
|
189
189
|
imports:
|
|
190
|
-
-
|
|
190
|
+
- project/library_name
|
|
191
191
|
|
|
192
192
|
tasks:
|
|
193
193
|
- type: mask_table
|
|
194
194
|
table: users
|
|
195
195
|
key: id
|
|
196
196
|
rules:
|
|
197
|
-
- $ref: "
|
|
197
|
+
- $ref: "project/library_name#database_rules/email_rule"
|
|
198
198
|
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "ruleset-splitter",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Consolidate multi-file DataMasque rulesets for editing, then re-split them back out.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "DataMasque Ltd"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/datamasque/datamasque-cli",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"datamasque",
|
|
13
|
+
"ruleset",
|
|
14
|
+
"yaml"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "datamasque-cli"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.7.0"
|
|
4
4
|
description = "Official command-line interface for the DataMasque data-masking platform."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "DataMasque Ltd" },
|
|
@@ -13,7 +13,7 @@ dependencies = [
|
|
|
13
13
|
"typer>=0.16.0,<1",
|
|
14
14
|
"rich>=13.8",
|
|
15
15
|
"tomli-w>=1.0.0,<2",
|
|
16
|
-
"datamasque-python>=1.
|
|
16
|
+
"datamasque-python>=1.6.0,<2",
|
|
17
17
|
"pydantic>=2.5,<3",
|
|
18
18
|
]
|
|
19
19
|
classifiers = [
|
|
@@ -16,6 +16,7 @@ from datamasque.client.models.ifm import DataMasqueIfmInstanceConfig
|
|
|
16
16
|
|
|
17
17
|
from datamasque_cli.config import Config, Profile, load_config
|
|
18
18
|
from datamasque_cli.errors import ErrorCode, abort
|
|
19
|
+
from datamasque_cli.projects import filter_by_project, require_single_or_abort, resolve_optional_project
|
|
19
20
|
|
|
20
21
|
ENV_URL = "DATAMASQUE_URL"
|
|
21
22
|
ENV_USERNAME = "DATAMASQUE_USERNAME"
|
|
@@ -215,10 +216,24 @@ def get_ifm_client(profile_name: str | None = None) -> DataMasqueIfmClient:
|
|
|
215
216
|
return client
|
|
216
217
|
|
|
217
218
|
|
|
218
|
-
def resolve_connection(client: DataMasqueClient, name_or_id: str) -> ConnectionConfig:
|
|
219
|
-
"""
|
|
219
|
+
def resolve_connection(client: DataMasqueClient, name_or_id: str, project: str | None = None) -> ConnectionConfig:
|
|
220
|
+
"""
|
|
221
|
+
Resolve a connection by name, in the project `--project` names if given, else by ID.
|
|
222
|
+
|
|
223
|
+
Aborts when nothing matches, or when the name matches connections in more than one project.
|
|
224
|
+
"""
|
|
220
225
|
connections = client.list_connections()
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
by_name = filter_by_project(
|
|
227
|
+
[c for c in connections if c.name == name_or_id], resolve_optional_project(client, project)
|
|
228
|
+
)
|
|
229
|
+
if not by_name:
|
|
230
|
+
by_id = next((c for c in connections if str(c.id) == name_or_id), None)
|
|
231
|
+
if by_id is not None:
|
|
232
|
+
return by_id
|
|
233
|
+
return require_single_or_abort(
|
|
234
|
+
client,
|
|
235
|
+
by_name,
|
|
236
|
+
f"Connection '{name_or_id}'",
|
|
237
|
+
describe=lambda c: f"id={c.id}",
|
|
238
|
+
hint="Pass --project, or the connection's id, to disambiguate.",
|
|
239
|
+
)
|