@elinpf/dsh-ops-access-ssh 0.3.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/lib/index.js +2 -3
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -24,7 +24,7 @@
24
24
  */
25
25
  import z from '@deepseek-ai/schemastery';
26
26
  import { z as zod } from 'zod';
27
- import { expandHome, registerAccessProvider } from '@elinpf/dsh-ops-access';
27
+ import { expandHome, hasSingleLineBody, registerAccessProvider } from '@elinpf/dsh-ops-access';
28
28
  import { execFile } from 'node:child_process';
29
29
  import { mkdtemp, rm, writeFile } from 'node:fs/promises';
30
30
  import { tmpdir } from 'node:os';
@@ -109,8 +109,7 @@ function validateContent(keygenTimeoutMs) {
109
109
  if (field === 'key')
110
110
  return validateKeyContent(content, keygenTimeoutMs);
111
111
  if (field === 'password') {
112
- const body = content.endsWith('\n') ? content.slice(0, -1) : content;
113
- if (body.includes('\n') || body.includes('\r')) {
112
+ if (!hasSingleLineBody(content)) {
114
113
  return 'a password must be a single line — sshpass -f reads only the first line of the file';
115
114
  }
116
115
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elinpf/dsh-ops-access-ssh",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Ops access provider for SSH — validates ssh registry entries and expands key paths.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.1",
41
- "@elinpf/dsh-ops-access": "^0.3.0"
41
+ "@elinpf/dsh-ops-access": "^0.4.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/cordis": "4.0.1",
45
45
  "@types/node": "^22.0.0",
46
46
  "typescript": "^5.4.0",
47
47
  "vitest": "^4.1.11",
48
- "@elinpf/dsh-ops-access": "0.3.0"
48
+ "@elinpf/dsh-ops-access": "0.4.1"
49
49
  },
50
50
  "license": "MIT",
51
51
  "publishConfig": {