@elinpf/dsh-ops-access-prometheus 0.3.0 → 0.4.0

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
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import z from '@deepseek-ai/schemastery';
18
18
  import { z as zod } from 'zod';
19
- import { expandHome, registerAccessProvider } from '@elinpf/dsh-ops-access';
19
+ import { expandHome, hasSingleLineBody, registerAccessProvider } from '@elinpf/dsh-ops-access';
20
20
  // ── Plugin identity ───────────────────────────────────────────────────────────
21
21
  export const name = 'ops-access-prometheus';
22
22
  export const inject = [];
@@ -48,8 +48,7 @@ export const provider = {
48
48
  validateContent(field, content) {
49
49
  if (field !== 'token')
50
50
  return null;
51
- const body = content.endsWith('\n') ? content.slice(0, -1) : content;
52
- if (body.includes('\n') || body.includes('\r')) {
51
+ if (!hasSingleLineBody(content)) {
53
52
  return 'a bearer token must be a single line — it is sent verbatim in the Authorization header';
54
53
  }
55
54
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elinpf/dsh-ops-access-prometheus",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Ops access provider for Prometheus — validates prometheus registry entries (server URL + optional bearer-token file) and expands the token path.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -39,14 +39,14 @@
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.1",
41
41
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
42
- "@elinpf/dsh-ops-access": "^0.3.0"
42
+ "@elinpf/dsh-ops-access": "^0.4.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@deepseek-ai/cordis": "4.0.1",
46
46
  "typescript": "^5.4.0",
47
47
  "vitest": "^4.1.11",
48
48
  "@types/node": "^22.0.0",
49
- "@elinpf/dsh-ops-access": "0.3.0"
49
+ "@elinpf/dsh-ops-access": "0.4.0"
50
50
  },
51
51
  "license": "MIT",
52
52
  "publishConfig": {