@theholocron/holocron-plugin-1password 5.0.0-alpha.327 → 5.0.0-alpha.329
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 +7 -7
- package/dist/index.mjs +9 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -126,13 +126,13 @@ holocron.
|
|
|
126
126
|
|
|
127
127
|
## What's implemented
|
|
128
128
|
|
|
129
|
-
| Method | What it does
|
|
130
|
-
| ----------------------------- |
|
|
131
|
-
| `read(reference)` | `op read <reference>` — resolves `op://Vault/Item/field`. `--no-newline`.
|
|
132
|
-
| `write(reference, v)` | Probe + `op item edit` if exists, else `op item create --category=API Credential`.
|
|
133
|
-
| `list()` | `op item list --vault=<vault> --format=json` — names of items in the vault.
|
|
134
|
-
| `readSecret(name)` | Reads one variable of the Environment named by the `environment` option, through the same `op environment secret list`; refuses without that option. Lets a caller (the `comlink deliver` probe) ask for a secret by its bare name.
|
|
135
|
-
| `readEnvironment(name or id)` | `op environment secret list <name or id> --reveal --format=dotenv` — parses the variables into a record. `op environment read` takes only an id, so this reads through `secret list`, which takes either.
|
|
129
|
+
| Method | What it does |
|
|
130
|
+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
131
|
+
| `read(reference)` | `op read <reference>` — resolves `op://Vault/Item/field`. `--no-newline`. |
|
|
132
|
+
| `write(reference, v)` | Probe + `op item edit` if exists, else `op item create --category=API Credential`. |
|
|
133
|
+
| `list()` | `op item list --vault=<vault> --format=json` — names of items in the vault. |
|
|
134
|
+
| `readSecret(name)` | Reads one variable of the Environment named by the `environment` option, through the same `op environment secret list`; refuses without that option. Lets a caller (the `comlink deliver` probe) ask for a secret by its bare name. |
|
|
135
|
+
| `readEnvironment(name or id)` | `op environment secret list <name or id> --reveal --format=dotenv` — parses the variables into a record (a multi-line PEM key, which `op` prints unquoted, is read whole). `op environment read` takes only an id, so this reads through `secret list`, which takes either. |
|
|
136
136
|
|
|
137
137
|
Plugin-level exports (not capability methods, per the auth-bootstrap
|
|
138
138
|
convention):
|
package/dist/index.mjs
CHANGED
|
@@ -37,8 +37,9 @@ function verifyOpInstalled(input = {}) {
|
|
|
37
37
|
*
|
|
38
38
|
* Blank lines and `# comment` lines are skipped, as is a line with no `=`. A leading `export ` is dropped. A value
|
|
39
39
|
* in double quotes has `\n`, `\r`, `\t`, `\"` and `\\` unescaped and may run over several lines; a value in single
|
|
40
|
-
* quotes is taken as written;
|
|
41
|
-
* because a
|
|
40
|
+
* quotes is taken as written; an unquoted value that opens a PEM block (`-----BEGIN …-----`) runs to its `-----END …-----`
|
|
41
|
+
* line, because `op` prints a multi-line key that way; anything else is the rest of the line, trimmed. Inline `#`
|
|
42
|
+
* comments are not stripped, because a token may contain one.
|
|
42
43
|
*/
|
|
43
44
|
function parseDotenv(text) {
|
|
44
45
|
const out = {};
|
|
@@ -61,6 +62,12 @@ function parseDotenv(text) {
|
|
|
61
62
|
out[key] = value.slice(1, -1);
|
|
62
63
|
continue;
|
|
63
64
|
}
|
|
65
|
+
if (/^-----BEGIN [^-]+-----/.test(value)) {
|
|
66
|
+
let block = value;
|
|
67
|
+
while (!/-----END [^-]+-----\s*$/.test(block) && i + 1 < lines.length) block += `\n${lines[++i].trim()}`;
|
|
68
|
+
out[key] = block;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
64
71
|
out[key] = value;
|
|
65
72
|
}
|
|
66
73
|
return out;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-1password",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.329",
|
|
4
4
|
"description": "Holocron plugin for 1Password. Implements the vault capability via shell-out to the `op` CLI (https://developer.1password.com/docs/cli).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"1password",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"tsx": "4.23.15",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
42
|
"vitest": "^5.0.5",
|
|
43
|
+
"@theholocron/cli": "5.0.0-alpha.329",
|
|
44
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.8",
|
|
43
45
|
"@theholocron/tsconfig": "^8.9.0-alpha.8",
|
|
44
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.8",
|
|
45
46
|
"@theholocron/vitest-config": "^8.9.0-alpha.8",
|
|
46
|
-
"@theholocron/
|
|
47
|
-
"@theholocron/cli": "5.0.0-alpha.327"
|
|
47
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.8"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
50
|
+
"@theholocron/cli": "5.0.0-alpha.329"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22"
|