@lornatang/dsh-atlassian 0.1.12 → 0.1.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.13 - 2026-11-19
4
+
5
+ - Remove a duplicated request-target pre-check left over from the route hardening; malformed URLs still receive the same 400 response.
6
+ - Share one loopback-host predicate between the OAuth callback and the browser helper instead of two copies.
7
+ - Drop the unused OAuth provider logger option, the unused board availability helper and a redundant board options type.
8
+
3
9
  ## 0.1.12 - 2026-11-18
4
10
 
5
11
  - Re-arm the OAuth callback listener when authorization starts, so a callback port that becomes available after a failed bind no longer leaves the published redirect URI pointing at port 0.
package/README.md CHANGED
@@ -34,7 +34,7 @@ dsh plugin --profile <name> add @lornatang/dsh-atlassian
34
34
  dsh plugin --profile <name> remove @lornatang/dsh-atlassian
35
35
  ```
36
36
 
37
- The same release is also attached as an archive on GitHub: `dsh plugin --profile <name> add https://github.com/Lornatang/dsh-atlassian/releases/download/v0.1.12/lornatang-dsh-atlassian-0.1.12.tgz`.
37
+ The same release is also attached as an archive on GitHub: `dsh plugin --profile <name> add https://github.com/Lornatang/dsh-atlassian/releases/download/v0.1.13/lornatang-dsh-atlassian-0.1.13.tgz`.
38
38
 
39
39
  `add` composes the layer into the profile: the profile's `cordis.patch.yml` gains an insert entry with row id `atlassian`, package `@lornatang/dsh-atlassian`, and the five values the shipped patch carries — `mode: cloud`, `serverName: atlassian`, `url: https://mcp.atlassian.com/v1/mcp`, `redirectPort: 3334` and `autoOpenBrowser: true`. The manifest declares `dsh.bundle.patch: ./cordis.patch.yml`, which is the declaration the reconcile step reads; `remove` deletes the entry again. Restart DSH after either command, because the profile composes its rows and its client half only at startup, then open Settings → Atlassian. Releases before 0.1.5 published this package as `@lornatang/dsh-atlassian-bridge`; add the scoped name, remove the old package from the same profile and restart once — the row, its settings and the stored credentials survive.
40
40
 
package/README.zh.md CHANGED
@@ -34,7 +34,7 @@ dsh plugin --profile <name> add @lornatang/dsh-atlassian
34
34
  dsh plugin --profile <name> remove @lornatang/dsh-atlassian
35
35
  ```
36
36
 
37
- 也可以从 GitHub release 附带的压缩包安装同一版本:`dsh plugin --profile <name> add https://github.com/Lornatang/dsh-atlassian/releases/download/v0.1.12/lornatang-dsh-atlassian-0.1.12.tgz`。
37
+ 也可以从 GitHub release 附带的压缩包安装同一版本:`dsh plugin --profile <name> add https://github.com/Lornatang/dsh-atlassian/releases/download/v0.1.13/lornatang-dsh-atlassian-0.1.13.tgz`。
38
38
 
39
39
  `add` 会把本层组合进 profile:profile 的 `cordis.patch.yml` 会增加一条 insert 记录,行 id 为 `atlassian`,包名为 `@lornatang/dsh-atlassian`,并带上随包提供的补丁中的五个值——`mode: cloud`、`serverName: atlassian`、`url: https://mcp.atlassian.com/v1/mcp`、`redirectPort: 3334` 与 `autoOpenBrowser: true`。包的 manifest 声明了 `dsh.bundle.patch: ./cordis.patch.yml`,reconcile 步骤读取的正是这条声明;`remove` 会再次删除该记录。两条命令执行后都要重启 DSH,因为 profile 只在启动时组合自己的行与客户端部分,随后打开 Settings → Atlassian。0.1.5 之前的版本以 `@lornatang/dsh-atlassian-bridge` 发布;添加带作用域的新名称、从同一 profile 删除旧包、重启一次即可——行、其设置与已保存的凭据都会保留。
40
40
 
package/lib/board.js CHANGED
@@ -31,7 +31,6 @@ export class JiraBoard {
31
31
  #resource;
32
32
  #pending;
33
33
  constructor(bridge) { this.#bridge = bridge; }
34
- available() { return !!this.#bridge.rawNameMatching(/searchJiraIssuesUsingJql/i); }
35
34
  get site() { return this.#resource?.epoch === (this.#bridge.epoch?.() ?? 0) ? this.#resource.site : undefined; }
36
35
  async #call(pattern, args, timeoutMs) {
37
36
  const name = this.#bridge.rawNameMatching(pattern);
package/lib/bridge.js CHANGED
@@ -184,7 +184,7 @@ export class AtlassianBridge {
184
184
  throw new Error('atlassian: refresh is already in progress');
185
185
  };
186
186
  this.#provider = new AtlassianOAuthProvider({
187
- store: options.store, redirectUri: () => this.#callback.redirectUri, allowLoopbackHttp: network.allowLoopbackHttp, logger: host.logger,
187
+ store: options.store, redirectUri: () => this.#callback.redirectUri, allowLoopbackHttp: network.allowLoopbackHttp,
188
188
  onAuthorizationUrl: (url) => {
189
189
  if (!active())
190
190
  return;
@@ -328,7 +328,7 @@ export class AtlassianBridge {
328
328
  check();
329
329
  this.#setStatus('connecting');
330
330
  this.#error = undefined;
331
- const client = new Client({ name: 'dsh-atlassian', version: '0.1.12' });
331
+ const client = new Client({ name: 'dsh-atlassian', version: '0.1.13' });
332
332
  // Releasing the session lease here would race the SDK's saveTokens; an
333
333
  // exchange that is still in flight is released by its own finally block.
334
334
  client.onerror = () => { const operation = this.#operation.getStore(); if (operation?.exchangePending)
package/lib/oauth.js CHANGED
@@ -75,17 +75,18 @@ function limitCloudResponse(response, allowEvents) {
75
75
  });
76
76
  return limited;
77
77
  }
78
- function isLoopback(url) {
79
- return ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname);
78
+ /** Loopback hosts may use plain HTTP for local MCP and OAuth endpoints. */
79
+ export function isLoopbackHost(hostname) {
80
+ return ['localhost', '127.0.0.1', '[::1]'].includes(hostname);
80
81
  }
81
82
  export function secureUrl(url, allowLoopbackHttp) {
82
- if (url.username || url.password || (url.protocol !== 'https:' && !(allowLoopbackHttp && url.protocol === 'http:' && isLoopback(url)))) {
83
+ if (url.username || url.password || (url.protocol !== 'https:' && !(allowLoopbackHttp && url.protocol === 'http:' && isLoopbackHost(url.hostname)))) {
83
84
  throw new Error('Cloud and OAuth endpoints must use HTTPS without embedded credentials');
84
85
  }
85
86
  }
86
87
  /** Restrict every discovered OAuth and MCP endpoint, including redirect targets. */
87
88
  export function createCloudFetch(serverUrl) {
88
- const allowLoopbackHttp = serverUrl.protocol === 'http:' && isLoopback(serverUrl);
89
+ const allowLoopbackHttp = serverUrl.protocol === 'http:' && isLoopbackHost(serverUrl.hostname);
89
90
  secureUrl(serverUrl, allowLoopbackHttp);
90
91
  return {
91
92
  allowLoopbackHttp,
package/lib/open-url.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { spawn } from 'node:child_process';
2
+ import { isLoopbackHost } from './oauth.js';
2
3
  /** Open a browser without invoking a shell. */
3
4
  export function openInBrowser(value) {
4
5
  let url;
@@ -8,7 +9,7 @@ export function openInBrowser(value) {
8
9
  catch {
9
10
  return Promise.resolve(false);
10
11
  }
11
- if (url.protocol !== 'https:' && !(url.protocol === 'http:' && ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname))) {
12
+ if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLoopbackHost(url.hostname))) {
12
13
  return Promise.resolve(false);
13
14
  }
14
15
  const command = process.platform === 'win32' ? 'rundll32.exe' : process.platform === 'darwin' ? 'open' : 'xdg-open';
package/lib/routes.js CHANGED
@@ -50,25 +50,6 @@ function required(input, key) {
50
50
  }
51
51
  export function registerRoutes(web, bridge, board, options, fence, connection) {
52
52
  return web.register({ kind: 'prefix', path: ROUTE_PREFIX, handler: async (req, res) => {
53
- if (!fence) {
54
- respond(res, 503, { ok: false, error: 'DSH connection service is unavailable' });
55
- return;
56
- }
57
- const rejection = fence.requestRejection(req);
58
- if (rejection !== undefined) {
59
- res.writeHead(rejection).end();
60
- return;
61
- }
62
- let url;
63
- try {
64
- url = new URL(req.url ?? '/', 'http://localhost');
65
- }
66
- catch {
67
- respond(res, 400, { ok: false, code: 'bad-request', error: 'Invalid request URL' });
68
- return;
69
- }
70
- const action = url.pathname.slice(ROUTE_PREFIX.length).replace(/^\//, '');
71
- const method = req.method ?? 'GET';
72
53
  try {
73
54
  if (!fence) {
74
55
  respond(res, 503, { ok: false, error: 'DSH connection service is unavailable' });
@@ -84,7 +65,7 @@ export function registerRoutes(web, bridge, board, options, fence, connection) {
84
65
  url = new URL(req.url ?? '/', 'http://localhost');
85
66
  }
86
67
  catch {
87
- respond(res, 400, { ok: false, error: 'invalid request target' });
68
+ respond(res, 400, { ok: false, error: 'Invalid request URL' });
88
69
  return;
89
70
  }
90
71
  const action = url.pathname.slice(ROUTE_PREFIX.length).replace(/^\//, '');
@@ -63,7 +63,6 @@ export declare class BoardError extends Error {
63
63
  export declare class JiraBoard {
64
64
  #private;
65
65
  constructor(bridge: ToolBridge);
66
- available(): boolean;
67
66
  get site(): string | undefined;
68
67
  cloudId(): Promise<string>;
69
68
  load(query: BoardQuery): Promise<BoardPayload>;
@@ -13,6 +13,8 @@ export interface AuthorizationCallback {
13
13
  }
14
14
  export declare class RedirectRegistrationChanged extends Error {
15
15
  }
16
+ /** Loopback hosts may use plain HTTP for local MCP and OAuth endpoints. */
17
+ export declare function isLoopbackHost(hostname: string): boolean;
16
18
  export declare function secureUrl(url: URL, allowLoopbackHttp: boolean): void;
17
19
  /** Restrict every discovered OAuth and MCP endpoint, including redirect targets. */
18
20
  export declare function createCloudFetch(serverUrl: URL): {
@@ -35,7 +37,6 @@ export declare class AtlassianOAuthProvider implements OAuthClientProvider {
35
37
  redirectUri: () => string;
36
38
  onAuthorizationUrl: (url: string) => void;
37
39
  allowLoopbackHttp: boolean;
38
- logger: Logger;
39
40
  active?: () => boolean;
40
41
  tokenRead?: (tokens: OAuthTokens | undefined) => void;
41
42
  refreshExpected?: () => OAuthTokens | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { IncomingMessage, ServerResponse } from 'node:http';
2
2
  import type { BridgeSnapshot } from './bridge.js';
3
+ import type { BoardConfig } from './config.js';
3
4
  import { type JiraBoard, type ToolBridge } from './board.js';
4
5
  export declare const ROUTE_PREFIX = "/plugins/atlassian";
5
6
  export interface RouteRegistrar {
@@ -12,12 +13,6 @@ export interface RouteRegistrar {
12
13
  export interface RequestFence {
13
14
  requestRejection(req: IncomingMessage): number | undefined;
14
15
  }
15
- export interface BoardRouteOptions {
16
- jql: string;
17
- limit: number;
18
- timeoutMs: number;
19
- promptTemplate: string;
20
- }
21
16
  export interface EditableConnection {
22
17
  snapshot(): {
23
18
  jiraUrl: string;
@@ -36,4 +31,4 @@ export interface PluginBridge extends ToolBridge {
36
31
  start(): Promise<void>;
37
32
  dispose(): Promise<void>;
38
33
  }
39
- export declare function registerRoutes(web: RouteRegistrar, bridge: PluginBridge, board: JiraBoard, options: BoardRouteOptions, fence: RequestFence | undefined, connection?: EditableConnection): () => void;
34
+ export declare function registerRoutes(web: RouteRegistrar, bridge: PluginBridge, board: JiraBoard, options: BoardConfig, fence: RequestFence | undefined, connection?: EditableConnection): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lornatang/dsh-atlassian",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Connect Atlassian Cloud or self-hosted Jira and Confluence to DeepSeek Harness with tools and a Jira board.",
5
5
  "keywords": [
6
6
  "deepseek-harness",