@klok-integration/cli 0.7.285 → 0.7.297

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.
@@ -838,6 +838,34 @@ The above copyright notice and this permission notice shall be included in all c
838
838
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
839
839
  ```
840
840
 
841
+ ## jose@6.2.12
842
+
843
+ Licence: MIT — https://github.com/panva/jose
844
+
845
+ ```
846
+ The MIT License (MIT)
847
+
848
+ Copyright (c) 2018 Filip Skokan
849
+
850
+ Permission is hereby granted, free of charge, to any person obtaining a copy
851
+ of this software and associated documentation files (the "Software"), to deal
852
+ in the Software without restriction, including without limitation the rights
853
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
854
+ copies of the Software, and to permit persons to whom the Software is
855
+ furnished to do so, subject to the following conditions:
856
+
857
+ The above copyright notice and this permission notice shall be included in all
858
+ copies or substantial portions of the Software.
859
+
860
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
861
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
862
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
863
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
864
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
865
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
866
+ SOFTWARE.
867
+ ```
868
+
841
869
  ## json-schema-traverse@1.0.0
842
870
 
843
871
  Licence: MIT — https://github.com/epoberezkin/json-schema-traverse#readme
@@ -1,9 +1,9 @@
1
1
  ## This repository: integration project
2
2
 
3
- A Klok integration on the Quarkus extension 2.0: one Camel route per class, each extending a framework pattern
4
- (`KlokOnrampRoute`, `KlokProcessingRoute`, `KlokOfframpRoute`, their `Sync` variants, `KlokRestApi` and
5
- `KlokRestApiHandlerRoute`, `KlokAsyncTaskWorkerRoute`, `KlokCustomRoute`) and implementing the capabilities it
6
- needs. Read `klok docs read klok-framework-klok-quarkus-extension` before writing a route.
3
+ A Klok integration on the Quarkus extension 2.0: one Camel route per class (the exceptions are in the platform
4
+ rules), each extending a framework pattern (`KlokOnrampRoute`, `KlokProcessingRoute`, `KlokOfframpRoute`, their
5
+ `Sync` variants, `KlokRestApi` and `KlokRestApiHandlerRoute`, `KlokAsyncTaskWorkerRoute`, `KlokCustomRoute`,
6
+ `KlokRuntimeInstanceRoute`) and implementing the capabilities it needs. Read `klok docs read klok-framework-klok-quarkus-extension` before writing a route.
7
7
 
8
8
  ### Commands
9
9
 
@@ -14,7 +14,7 @@ it as the source does.
14
14
  | DLQ | Dead letter queue: `<topic>_DLQ`, where a message goes after its retries are exhausted |
15
15
  | Tenant | An organisation on the platform, and its security boundary; every topic, ODL object and GitLab group belongs to one tenant |
16
16
  | Domain | A business area inside a tenant. `common` is shared by the tenant's domains, `public` is open to anyone |
17
- | Route, route id | One Camel route per Java class. Its id is `<TENANTSHORT><NNN><LEG><seq>_<Description>`, for example `KLK007T1_PublishKlokStandard`; the class name is the id |
17
+ | Route, route id | One Camel route per Java class (except a `KlokRestApi`, one per operation, and a `KlokRuntimeInstanceRoute`, one per instance `<RouteId>#<instanceKey>`). Its id is `<TENANTSHORT><NNN><LEG><seq>_<Description>`, for example `KLK007T1_PublishKlokStandard`; the class name is the id |
18
18
  | Leg | The letter in a route id: I ingress (onramp, brings data in), P processing, E egress (offramp, delivers data out), A API, S sub route, T timer |
19
19
  | Tenant short name | `TENANTSHORT`, three upper case letters that start every solution and route id of a tenant: the first three consonants of the tenant's name (`KLK` for klok, `DGR` for degerfors), decided by the platform |
20
20
  | Solution | The business flow a set of routes implements; its id is the route id's prefix, for example `KLK007`. The id is allocated once, by a merge request in the tenant's `integration-solutions` registry, and never reused; a solution is reserved, active or retired |
@@ -30,6 +30,9 @@ documentation or the dependency catalog can give you.
30
30
 
31
31
  * One Camel route per Java class. The route id is the class name, the configuration prefix and the solution key:
32
32
  `<TENANTSHORT><NNN><LEG><seq>_<Description>` (`KLK002I1_OdlScheduledQuery`, `ACM001E1_FortnoxInvoiceOfframp`).
33
+ Two exceptions: a `KlokRestApi` gives one Camel route per operation. A `KlokRuntimeInstanceRoute<S>` runs one
34
+ route class as several Camel routes `<RouteId>#<instanceKey>`, started by `KlokRouteInstanceManager`; its route
35
+ id, configuration and documentation stay the class's, and the instance key is the log field `klok.route-instance`.
33
36
  * `TENANTSHORT`: the tenant's short name, three upper case letters: the first three consonants of the tenant
34
37
  slug (`klok` KLK, `degerfors` DGR, `konvoj` KNV), decided by the platform and recorded as `shortname` in
35
38
  tenants.yml of `klok/environment/klok-environment-setup`. `NNN`: the solution number, three digits; 900–999
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: klok-cli
3
- description: Which klok command does what on the Klok platform (klok-cli, `@klok/cli`), with the full reference of every command and option in reference.md. Use before running a klok command you have not run in this task, when a task needs the local workspace current (`klok sync pull`), a list of the documentation (`klok docs list`), an answer about the integration landscape (`klok agent ask`), or a check of the solution registry, the deployed fleet, the catalog, a CI job, a deploy manifest, a pin, a bead or a datamodel.
3
+ description: Which klok command does what on the Klok platform (klok-cli, `@klok/cli`), with the full reference of every command and option in reference.md. Use before running a klok command you have not run in this task, when a task needs the local workspace current (`klok sync pull`), a list of the documentation (`klok docs list`), an answer about the integration landscape (`klok agent ask`), or a check of the solution registry, the deployed fleet, the catalog, a CI job, a deploy manifest, a pin, a bead or a datamodel, or a file transfer flow's sealed secrets and its write to the ODL.
4
4
  ---
5
5
 
6
6
  # The klok command line
@@ -34,6 +34,7 @@ CLI version, generated from the program itself; when it is missing (an installer
34
34
  | the repository, root element and namespace a datamodel's class and name give | `klok datamodel names` |
35
35
  | an XSD checked the way the datamodel pipeline checks it | `klok datamodel validate` |
36
36
  | this repository's `klok-docs/` checked before the merge request | `klok docs build`, `klok docs verify` |
37
+ | a sealing key for a tenant's klok-file-transfer, a secret sealed for a file flow, or flows written to the ODL from Git | `klok file-transfer keygen`, `seal`, `apply --dry-run` (then without) |
37
38
 
38
39
  ## The workspace
39
40
 
@@ -56,6 +57,18 @@ followed to the new one, and stderr says `<old-id> moved to <new-id>`: use the n
56
57
  solution registry, the integration context and the documentation you may read, and answers with links; it is the
57
58
  quickest way to find which project, leg or topic handles something.
58
59
 
60
+ ## File transfer (KLK017)
61
+
62
+ A file flow (`KlokFileFlowV1`) lives in the tenant's ODL, and its passwords, private keys and passphrases only as
63
+ sealed values that the tenant's klok-file-transfer instance alone can open, for one flow and one field. `klok
64
+ file-transfer seal --flow <id> --field <path>` reads the secret from stdin and prints the sealed value; the person who
65
+ holds the secret runs it, never an agent, and a secret never goes into a command line, a file or a message. `klok
66
+ file-transfer apply <dir>` writes the flow files of a repository to the ODL with `managedBy: git:<repo>@<sha>`: it
67
+ refuses a plain secret, checks every flow against the released datamodel and writes nothing until all are valid; run
68
+ it with `--dry-run` first. `klok file-transfer keygen` writes a new private key to a file and prints the `vault kv
69
+ patch` command: a person writes Vault, an agent hands the command over. The operator guide is klok-file-transfer's
70
+ *Usage* and *Operations* pages (`klok docs read klok-integration-klok-file-transfer`).
71
+
59
72
  ## klok.dev
60
73
 
61
74
  The CLI is meant to do everything klok.dev does, as the person, but only part of the portal has its command yet
@@ -119,7 +119,7 @@ Print one effective configuration value; secrets show as **** unless --reveal
119
119
  klok config set [options] <key> [value]
120
120
  ```
121
121
 
122
- Set a value. Keys: agentUrl, tenant, klokDevUrl, keycloakIssuer, keycloakClientId, protocol, domain, gitUrl, workspace, klokerBasePath, klokerUrl, klokerModel, summaryLanguage, klokApiKey. Leave out the value of a secret (klokApiKey) to type it at a prompt that shows * for each character, or pipe it in, so it stays off the screen and out of the shell history
122
+ Set a value. Keys: agentUrl, tenant, klokDevUrl, keycloakIssuer, keycloakClientId, protocol, domain, gitUrl, workspace, klokerBasePath, klokerUrl, klokerModel, summaryLanguage, klokApiKey, odlUrl. Leave out the value of a secret (klokApiKey) to type it at a prompt that shows * for each character, or pipe it in, so it stays off the screen and out of the shell history
123
123
 
124
124
  | Argument | Description |
125
125
  |---|---|
@@ -232,7 +232,7 @@ List tasks in the tenant
232
232
  | Option | Description |
233
233
  |---|---|
234
234
  | `--status <status>` | submitted \| working \| input-required \| completed \| failed \| canceled |
235
- | `--type <taskType>` | landscape-question \| impact-analysis \| integration-plan \| erp-change-plan \| issue-creation \| bead-creation \| project-scaffold \| datamodel-proposal \| repo-index \| bead-implementation |
235
+ | `--type <taskType>` | landscape-question \| impact-analysis \| integration-plan \| erp-change-plan \| issue-creation \| bead-creation \| project-scaffold \| datamodel-proposal \| repo-index \| bead-implementation \| build-check \| datamodel-upgrade \| pipeline-fix \| merge-conflict |
236
236
  | `--limit <n>` | Maximum number of tasks (default: `50`) |
237
237
 
238
238
  ### klok agent open
@@ -768,6 +768,95 @@ Build the znai project and upload it under this project’s doc id. When klok-do
768
768
  | `-n, --dry-run` | Resolve what would be published and build it with znai, upload nothing; for a retired project, say what would be unpublished |
769
769
  | `--no-build` | With --dry-run: only resolve the plan, do not run znai |
770
770
 
771
+ ## klok file-transfer
772
+
773
+ ```
774
+ klok file-transfer [options] [command]
775
+ ```
776
+
777
+ KLK017 File Transfer: sealing keys, sealed secrets, and flows written to the ODL from Git
778
+
779
+ ### klok file-transfer keygen
780
+
781
+ ```
782
+ klok file-transfer keygen [options]
783
+ ```
784
+
785
+ Make a new sealing key pair (RSA 3072, private JWK) for a tenant's klok-file-transfer instance
786
+
787
+ | Option | Description |
788
+ |---|---|
789
+ | `--out <file>` | Write a new JWK set holding only this key to <file> (mode 0600; never overwritten) |
790
+ | `--add-to <file>` | Append the key to the JWK set in <file>, the set as Vault holds it (rotation) |
791
+ | `--kid <kid>` | Key id, default klk-ft-<yyyy-mm> |
792
+
793
+ ```
794
+ The private key never goes to a log: without --out or --add-to it is printed on stdout only, and only on a terminal.
795
+ klok-cli never writes Vault. It prints the vault kv patch command for a person to run with the file, which then
796
+ holds the whole set: the old keys stay, so what was sealed with them still opens, and the last key is CURRENT.
797
+
798
+ klok file-transfer keygen --tenant klok --out sealing-keys.json # the first key
799
+ klok file-transfer keygen --tenant klok --add-to sealing-keys.json # rotation, see klok-file-transfer's Operations page
800
+ ```
801
+
802
+ ### klok file-transfer seal
803
+
804
+ ```
805
+ klok file-transfer seal [options]
806
+ ```
807
+
808
+ Seal a password, private key or passphrase for one field of one flow; prints the KlokSealedValueV1 JSON
809
+
810
+ | Option | Description |
811
+ |---|---|
812
+ | `--flow <id>` | The flow id the value belongs to |
813
+ | `--field <path>` | source.endpoint.<f> or destinations.<name>.endpoint.<f>; <f> is password, privateKey or passphrase |
814
+ | `--key <file>` | Seal offline with this public JWK (or the last key of a JWK set) instead of the ODL's CURRENT key |
815
+ | `--kid <kid>` | Seal with this key instead of the CURRENT one |
816
+ | `--set-by <who>` | Who set the value (setBy), default the logged in user |
817
+ | `--token <token>` | GitLab token to find the tenant's ODL in tenants.yml (default: KLOK_GIT_APIKEY, GITLAB_TOKEN, config klokApiKey) |
818
+
819
+ ```
820
+ The value is read from stdin: typed without echo on a terminal, or piped (a private key file). It is never an
821
+ argument, never printed and never logged. The output goes into the flow JSON at the field's place:
822
+
823
+ klok file-transfer seal --tenant klok --flow payroll-to-bank --field destinations.bank.endpoint.password
824
+ klok file-transfer seal --tenant klok --flow payroll-to-bank --field source.endpoint.privateKey < ~/keys/payroll_ed25519
825
+
826
+ A sealed value opens only in the tenant's klok-file-transfer instance, only for this flow and this field. Renaming the
827
+ flow or the destination means sealing again.
828
+ ```
829
+
830
+ ### klok file-transfer apply
831
+
832
+ ```
833
+ klok file-transfer apply [options] <dir|file>
834
+ ```
835
+
836
+ Write the KlokFileFlowV1 files of a directory (or one file) to the tenant's ODL, managed by Git
837
+
838
+ | Argument | Description |
839
+ |---|---|
840
+ | `<dir|file>` | A folder of *.json flow files (searched recursively) or one flow file |
841
+
842
+ | Option | Description |
843
+ |---|---|
844
+ | `--dry-run` | Check everything and show what would be created or changed; write nothing |
845
+ | `--schema <file>` | KlokFileFlowV1.avsc to validate against instead of the released datamodel |
846
+ | `--token <token>` | GitLab token to read tenants.yml and the datamodel's package (default: KLOK_GIT_APIKEY, GITLAB_TOKEN, config klokApiKey, CI_JOB_TOKEN) |
847
+
848
+ ```
849
+ Every file holds one flow; its "id" is the object id. Before anything is written, every flow is checked against
850
+ the released datamodel klok-file-transfer-v1, and every password, privateKey and passphrase must be a sealed value
851
+ that the tenant's instance opens for that flow and field: a plain password is refused. Each flow is written with
852
+ managedBy git:<repo>@<sha> (the CI project and commit, or the checkout's origin and HEAD), so the files must be
853
+ committed. A flow changed in the ODL since it was read is not overwritten. Flows that are not in the files are
854
+ left alone: apply never deletes.
855
+
856
+ klok file-transfer apply --tenant klok flows/ --dry-run
857
+ klok file-transfer apply --tenant klok flows/
858
+ ```
859
+
771
860
  ## klok fleet
772
861
 
773
862
  ```