@cat-factory/integrations 0.147.0 → 0.149.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/documents/DocumentConnectionService.d.ts +41 -4
- package/dist/modules/documents/DocumentConnectionService.d.ts.map +1 -1
- package/dist/modules/documents/DocumentConnectionService.js +56 -19
- package/dist/modules/documents/DocumentConnectionService.js.map +1 -1
- package/dist/modules/documents/DocumentImportService.d.ts +48 -1
- package/dist/modules/documents/DocumentImportService.d.ts.map +1 -1
- package/dist/modules/documents/DocumentImportService.js +154 -1
- package/dist/modules/documents/DocumentImportService.js.map +1 -1
- package/dist/modules/documents/FigmaProvider.d.ts +29 -1
- package/dist/modules/documents/FigmaProvider.d.ts.map +1 -1
- package/dist/modules/documents/FigmaProvider.js +143 -3
- package/dist/modules/documents/FigmaProvider.js.map +1 -1
- package/dist/modules/documents/LinkedDocumentRefreshService.d.ts +14 -5
- package/dist/modules/documents/LinkedDocumentRefreshService.d.ts.map +1 -1
- package/dist/modules/documents/LinkedDocumentRefreshService.js +39 -22
- package/dist/modules/documents/LinkedDocumentRefreshService.js.map +1 -1
- package/dist/modules/documents/documentConnectionStore.d.ts +19 -0
- package/dist/modules/documents/documentConnectionStore.d.ts.map +1 -0
- package/dist/modules/documents/documentConnectionStore.js +17 -0
- package/dist/modules/documents/documentConnectionStore.js.map +1 -0
- package/dist/modules/documents/figma.logic.d.ts +43 -1
- package/dist/modules/documents/figma.logic.d.ts.map +1 -1
- package/dist/modules/documents/figma.logic.js +70 -0
- package/dist/modules/documents/figma.logic.js.map +1 -1
- package/dist/modules/documents/http.d.ts +12 -3
- package/dist/modules/documents/http.d.ts.map +1 -1
- package/dist/modules/documents/http.js +17 -4
- package/dist/modules/documents/http.js.map +1 -1
- package/dist/modules/github/GitHubInstallationService.d.ts +8 -1
- package/dist/modules/github/GitHubInstallationService.d.ts.map +1 -1
- package/dist/modules/github/GitHubInstallationService.js +4 -3
- package/dist/modules/github/GitHubInstallationService.js.map +1 -1
- package/dist/modules/shared/sealedConnectionStore.d.ts +100 -0
- package/dist/modules/shared/sealedConnectionStore.d.ts.map +1 -0
- package/dist/modules/shared/sealedConnectionStore.js +118 -0
- package/dist/modules/shared/sealedConnectionStore.js.map +1 -0
- package/dist/modules/tasks/BugHuntService.d.ts +2 -2
- package/dist/modules/tasks/BugHuntService.d.ts.map +1 -1
- package/dist/modules/tasks/BugHuntService.js +1 -1
- package/dist/modules/tasks/BugHuntService.js.map +1 -1
- package/dist/modules/tasks/BugIntakeService.d.ts +2 -2
- package/dist/modules/tasks/BugIntakeService.d.ts.map +1 -1
- package/dist/modules/tasks/BugIntakeService.js +1 -1
- package/dist/modules/tasks/BugIntakeService.js.map +1 -1
- package/dist/modules/tasks/TaskConnectionService.d.ts +43 -4
- package/dist/modules/tasks/TaskConnectionService.d.ts.map +1 -1
- package/dist/modules/tasks/TaskConnectionService.js +122 -22
- package/dist/modules/tasks/TaskConnectionService.js.map +1 -1
- package/dist/modules/tasks/TrackerWebhookService.d.ts +2 -2
- package/dist/modules/tasks/TrackerWebhookService.d.ts.map +1 -1
- package/dist/modules/tasks/TrackerWebhookService.js +1 -1
- package/dist/modules/tasks/TrackerWebhookService.js.map +1 -1
- package/dist/modules/tasks/taskConnectionStore.d.ts +18 -0
- package/dist/modules/tasks/taskConnectionStore.d.ts.map +1 -0
- package/dist/modules/tasks/taskConnectionStore.js +17 -0
- package/dist/modules/tasks/taskConnectionStore.js.map +1 -0
- package/dist/modules/vcs/VcsPatConnectionService.d.ts +9 -1
- package/dist/modules/vcs/VcsPatConnectionService.d.ts.map +1 -1
- package/dist/modules/vcs/VcsPatConnectionService.js +4 -3
- package/dist/modules/vcs/VcsPatConnectionService.js.map +1 -1
- package/dist/modules/writeback/IssueWritebackService.d.ts +7 -2
- package/dist/modules/writeback/IssueWritebackService.d.ts.map +1 -1
- package/dist/modules/writeback/IssueWritebackService.js +31 -11
- package/dist/modules/writeback/IssueWritebackService.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Clock } from '@cat-factory/kernel';
|
|
2
2
|
import type { GitHubClient } from '@cat-factory/kernel';
|
|
3
3
|
import type { GitHubInstallation, GitHubInstallationRepository } from '@cat-factory/kernel';
|
|
4
|
-
import type { GitHubConnection, GitHubInstallationOption } from '@cat-factory/kernel';
|
|
4
|
+
import type { GitHubConnection, GitHubInstallationOption, VcsWebUrls } from '@cat-factory/kernel';
|
|
5
5
|
import type { WorkspaceRepository } from '@cat-factory/kernel';
|
|
6
6
|
export interface GitHubInstallationServiceDependencies {
|
|
7
7
|
githubClient: GitHubClient;
|
|
@@ -20,6 +20,13 @@ export interface GitHubInstallationServiceDependencies {
|
|
|
20
20
|
* `.github/workflows/*` would be rejected. Absent (or throwing) → false.
|
|
21
21
|
*/
|
|
22
22
|
workflowsGranted?: (installation: GitHubInstallation) => Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* The browser-facing host of each provider's configured instance, so a connection states where
|
|
25
|
+
* its repositories can be opened. Keyed by provider because this service reads back rows every
|
|
26
|
+
* connect path wrote, local mode's GitLab-provider one included. Absent (or absent for the
|
|
27
|
+
* row's provider) ⇒ the connection reports a null host and its readers withhold the link.
|
|
28
|
+
*/
|
|
29
|
+
webUrls?: VcsWebUrls;
|
|
23
30
|
}
|
|
24
31
|
export declare class GitHubInstallationService {
|
|
25
32
|
private readonly deps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubInstallationService.d.ts","sourceRoot":"","sources":["../../../src/modules/github/GitHubInstallationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAA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AIG;YACW,YAAY;IAS1B;;;;;;;;OAQG;IACG,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAyBzF;IAED;;;;;;;OAOG;IACG,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAK1E;IAED,oEAAoE;IAC9D,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CASzE;IAED,gFAAgF;IAC1E,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAM1E;IAED,mEAAmE;IAC7D,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOnD;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConflictError } from '@cat-factory/kernel';
|
|
2
2
|
import { requireWorkspace } from '@cat-factory/kernel';
|
|
3
|
-
function toConnection(installation, canCreateRepos, canManageWorkflows) {
|
|
3
|
+
function toConnection(installation, canCreateRepos, canManageWorkflows, webUrls) {
|
|
4
4
|
return {
|
|
5
5
|
installationId: installation.installationId,
|
|
6
6
|
accountLogin: installation.accountLogin,
|
|
@@ -17,6 +17,7 @@ function toConnection(installation, canCreateRepos, canManageWorkflows) {
|
|
|
17
17
|
// the grant-access link until it reconnects — stale internal state re-created, not a
|
|
18
18
|
// compatibility shim.
|
|
19
19
|
method: installation.appId !== null ? 'app' : 'pat',
|
|
20
|
+
webUrl: webUrls[installation.provider] ?? null,
|
|
20
21
|
canCreateRepos,
|
|
21
22
|
canManageWorkflows,
|
|
22
23
|
};
|
|
@@ -69,7 +70,7 @@ export class GitHubInstallationService {
|
|
|
69
70
|
deletedAt: null,
|
|
70
71
|
};
|
|
71
72
|
await this.deps.githubInstallationRepository.upsert(installation);
|
|
72
|
-
return toConnection(installation, this.canCreate(installation), await this.canWorkflows(installation));
|
|
73
|
+
return toConnection(installation, this.canCreate(installation), await this.canWorkflows(installation), this.deps.webUrls ?? {});
|
|
73
74
|
}
|
|
74
75
|
/** Whether the privileged App tier can create repos for this installation (ADR 0005). */
|
|
75
76
|
canCreate(installation) {
|
|
@@ -143,7 +144,7 @@ export class GitHubInstallationService {
|
|
|
143
144
|
const installation = await this.deps.githubInstallationRepository.getByWorkspace(workspaceId);
|
|
144
145
|
if (!installation || installation.deletedAt)
|
|
145
146
|
return null;
|
|
146
|
-
return toConnection(installation, this.canCreate(installation), await this.canWorkflows(installation));
|
|
147
|
+
return toConnection(installation, this.canCreate(installation), await this.canWorkflows(installation), this.deps.webUrls ?? {});
|
|
147
148
|
}
|
|
148
149
|
/** Resolve the live installation for a workspace, or throw if not connected. */
|
|
149
150
|
async requireInstallation(workspaceId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubInstallationService.js","sourceRoot":"","sources":["../../../src/modules/github/GitHubInstallationService.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"GitHubInstallationService.js","sourceRoot":"","sources":["../../../src/modules/github/GitHubInstallationService.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAqCtD,SAAS,YAAY,CACnB,YAAgC,EAChC,cAAuB,EACvB,kBAA2B,EAC3B,OAAmB;IAEnB,OAAO;QACL,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,YAAY,EAAE,YAAY,CAAC,YAAY;QACvC,UAAU,EAAE,YAAY,CAAC,UAAU;QACnC,WAAW,EAAE,YAAY,CAAC,SAAS;QACnC,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,wFAAwF;QACxF,sFAAsF;Q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I,CAAC,YAAY,IAAI,YAAY,CAAC,SAAS;YAAE,OAAM;QACnD,MAAM,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,UAAU,CACrD,YAAY,CAAC,cAAc,EAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CACtB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { OrgSecretCipher, OrgSecretSourceOfArity, SealedConnectionOpenResult } from '@cat-factory/kernel';
|
|
2
|
+
import { UnavailableError } from '@cat-factory/kernel';
|
|
3
|
+
/** The stored row, generic over the integration's source vocabulary. */
|
|
4
|
+
export interface SealedConnectionRow<Kind extends string> {
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
source: Kind;
|
|
7
|
+
credentialsCipher: string;
|
|
8
|
+
label: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
deletedAt: number | null;
|
|
11
|
+
}
|
|
12
|
+
/** The same row with its bag opened. */
|
|
13
|
+
export interface OpenedConnection<Kind extends string> {
|
|
14
|
+
workspaceId: string;
|
|
15
|
+
source: Kind;
|
|
16
|
+
credentials: Record<string, string>;
|
|
17
|
+
label: string;
|
|
18
|
+
createdAt: number;
|
|
19
|
+
deletedAt: number | null;
|
|
20
|
+
}
|
|
21
|
+
/** The non-secret half, which `listSummaries` answers without opening anything. */
|
|
22
|
+
export interface ConnectionSummary<Kind extends string> {
|
|
23
|
+
workspaceId: string;
|
|
24
|
+
source: Kind;
|
|
25
|
+
label: string;
|
|
26
|
+
createdAt: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What one named source's open produced (kernel's shared vocabulary, specialised here).
|
|
30
|
+
*
|
|
31
|
+
* `listBySources` answers PER SOURCE rather than rejecting as a batch, because the sources in one
|
|
32
|
+
* call are independent facts about independent vendors: a corrupt Linear envelope says nothing
|
|
33
|
+
* about the workspace's Jira connection, and a single rejection made every caller report the
|
|
34
|
+
* healthy ones as broken too (a block's whole reply-channel map, a run's whole document corpus).
|
|
35
|
+
* The point read {@link SealedConnectionStore.getByWorkspace} still THROWS, which is the honest
|
|
36
|
+
* disposition where the caller asked about exactly one source and there is nothing else to answer.
|
|
37
|
+
*/
|
|
38
|
+
export type OpenedConnectionResult<Kind extends string> = SealedConnectionOpenResult<Kind, OpenedConnection<Kind>>;
|
|
39
|
+
/** The persistence port both integrations expose for their sealed connection rows. */
|
|
40
|
+
export interface SealedConnectionRepository<Kind extends string> {
|
|
41
|
+
getByWorkspace(workspaceId: string, source: Kind): Promise<SealedConnectionRow<Kind> | null>;
|
|
42
|
+
listByWorkspace(workspaceId: string): Promise<SealedConnectionRow<Kind>[]>;
|
|
43
|
+
upsert(record: SealedConnectionRow<Kind>): Promise<void>;
|
|
44
|
+
softDelete(workspaceId: string, source: Kind, at: number): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
export interface SealedConnectionStore<Kind extends string> {
|
|
47
|
+
getByWorkspace(workspaceId: string, source: Kind): Promise<OpenedConnection<Kind> | null>;
|
|
48
|
+
listBySources(workspaceId: string, sources: readonly Kind[]): Promise<OpenedConnectionResult<Kind>[]>;
|
|
49
|
+
listSummaries(workspaceId: string): Promise<ConnectionSummary<Kind>[]>;
|
|
50
|
+
upsert(record: OpenedConnection<Kind>): Promise<void>;
|
|
51
|
+
softDelete(workspaceId: string, source: Kind, at: number): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export interface SealedConnectionStoreDependencies<Kind extends string> {
|
|
54
|
+
repository: SealedConnectionRepository<Kind>;
|
|
55
|
+
/**
|
|
56
|
+
* The deployment's cipher for this integration's HKDF domain, composed with a mothership
|
|
57
|
+
* delegate where one is wired (`createOrgSecretCipher`). With no delegate this is the local
|
|
58
|
+
* key, byte-for-byte the prior behaviour.
|
|
59
|
+
*/
|
|
60
|
+
orgSecrets: OrgSecretCipher;
|
|
61
|
+
/**
|
|
62
|
+
* Which `ORG_SECRET_SOURCES` member addresses these rows on a mothership.
|
|
63
|
+
*
|
|
64
|
+
* Constrained to the ARITY-1 sources rather than the whole vocabulary, because every row this
|
|
65
|
+
* store serves is addressed `(workspaceId, source)` and this generic factory never names a
|
|
66
|
+
* member it could be checked against. That constraint is what lets {@link orgSecretRef} verify
|
|
67
|
+
* the key below at build time: the earlier `OrgSecretSource` accepted a ref carrying no key at
|
|
68
|
+
* all, which every hosted deployment tolerates (the cipher is local and the ref inert) and a
|
|
69
|
+
* mothership-mode node refuses with a 422 on every open of every connection.
|
|
70
|
+
*/
|
|
71
|
+
secretSource: OrgSecretSourceOfArity<1>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A stored connection row exists but its sealed bag could not be opened.
|
|
75
|
+
*
|
|
76
|
+
* A `DomainError` rather than a bare `Error` so a controller answers 503 with a machine-readable
|
|
77
|
+
* reason instead of a 500: the SPA maps the reason to copy that names the two real remedies (fix
|
|
78
|
+
* the deployment's reach to its key, or re-connect the source), where a 500 names nothing. 503
|
|
79
|
+
* rather than 409 because the two causes are indistinguishable from here on purpose — the
|
|
80
|
+
* mothership collapses "no such row", "out of scope" and "nothing sealed there" into one uniform
|
|
81
|
+
* 404 — and claiming a definite state we cannot see would be the same guess this seam removes.
|
|
82
|
+
*/
|
|
83
|
+
export declare class ConnectionCredentialsUnreadableError extends UnavailableError {
|
|
84
|
+
readonly source: string;
|
|
85
|
+
constructor(source: string, options?: {
|
|
86
|
+
cause?: unknown;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Build the opening view of a sealed connection repository.
|
|
91
|
+
*
|
|
92
|
+
* A bag that cannot be opened THROWS, and that is a change from the repositories this replaces,
|
|
93
|
+
* which answered a failed decrypt with an empty bag so "the import path fails closed". An empty
|
|
94
|
+
* bag is indistinguishable from a connection saved with no credentials, so every caller had to
|
|
95
|
+
* re-derive the difference from whatever the provider said next: the refusal arrived as a vendor
|
|
96
|
+
* 401. Throwing is what lets one caller report `credentials_unreadable` and another report the
|
|
97
|
+
* source as unreachable, which are two different fixes.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createSealedConnectionStore<Kind extends string>(deps: SealedConnectionStoreDependencies<Kind>): SealedConnectionStore<Kind>;
|
|
100
|
+
//# sourceMappingURL=sealedConnectionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealedConnectionStore.d.ts","sourceRoot":"","sources":["../../../src/modules/shared/sealedConnectionStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,gBAAgB,EAAgB,MAAM,qBAAqB,CAAA;AAkBpE,wEAAwE;AACxE,MAAM,WAAW,mBAAmB,CAAC,IAAI,SAAS,MAAM;IACtD,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,IAAI,CAAA;IACZ,iBAAiB,EAAE,MAAM,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB,CAAC,IAAI,SAAS,MAAM;IACnD,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,IAAI,CAAA;IACZ,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,mFAAmF;AACnF,MAAM,WAAW,iBAAiB,CAAC,IAAI,SAAS,MAAM;IACpD,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,IAAI,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,CAAC,IAAI,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MAAM,WAAW,iCAAiC,CAAC,IAAI,SAAS,MAAM;IACpE,UAAU,EAAE,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAC5C;;;;OAIG;IACH,UAAU,EAAE,eAAe,CAAA;IAC3B;;;;;;;;;OASG;IACH,YAAY,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAA;CACxC;AAED;;;;;;;;;GASG;AACH,qBAAa,oCAAqC,SAAQ,gBAAgB;IAEtE,QAAQ,CAAC,MAAM,EAAE,MAAM;IADzB,YACW,MAAM,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAS9B;CACF;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,SAAS,MAAM,EAC7D,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,GAC5C,qBAAqB,CAAC,IAAI,CAAC,CA4E7B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { UnavailableError, orgSecretRef } from '@cat-factory/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* A stored connection row exists but its sealed bag could not be opened.
|
|
4
|
+
*
|
|
5
|
+
* A `DomainError` rather than a bare `Error` so a controller answers 503 with a machine-readable
|
|
6
|
+
* reason instead of a 500: the SPA maps the reason to copy that names the two real remedies (fix
|
|
7
|
+
* the deployment's reach to its key, or re-connect the source), where a 500 names nothing. 503
|
|
8
|
+
* rather than 409 because the two causes are indistinguishable from here on purpose — the
|
|
9
|
+
* mothership collapses "no such row", "out of scope" and "nothing sealed there" into one uniform
|
|
10
|
+
* 404 — and claiming a definite state we cannot see would be the same guess this seam removes.
|
|
11
|
+
*/
|
|
12
|
+
export class ConnectionCredentialsUnreadableError extends UnavailableError {
|
|
13
|
+
source;
|
|
14
|
+
constructor(source, options) {
|
|
15
|
+
super(`The stored ${source} connection credentials could not be read`, 'connection_credentials_unreadable', { source });
|
|
16
|
+
this.source = source;
|
|
17
|
+
this.name = 'ConnectionCredentialsUnreadableError';
|
|
18
|
+
if (options && 'cause' in options)
|
|
19
|
+
this.cause = options.cause;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Build the opening view of a sealed connection repository.
|
|
24
|
+
*
|
|
25
|
+
* A bag that cannot be opened THROWS, and that is a change from the repositories this replaces,
|
|
26
|
+
* which answered a failed decrypt with an empty bag so "the import path fails closed". An empty
|
|
27
|
+
* bag is indistinguishable from a connection saved with no credentials, so every caller had to
|
|
28
|
+
* re-derive the difference from whatever the provider said next: the refusal arrived as a vendor
|
|
29
|
+
* 401. Throwing is what lets one caller report `credentials_unreadable` and another report the
|
|
30
|
+
* source as unreachable, which are two different fixes.
|
|
31
|
+
*/
|
|
32
|
+
export function createSealedConnectionStore(deps) {
|
|
33
|
+
const { repository, orgSecrets, secretSource } = deps;
|
|
34
|
+
const open = async (row) => {
|
|
35
|
+
let plaintext;
|
|
36
|
+
try {
|
|
37
|
+
// The row's OWN identity, not just its workspace: these rows are keyed `(workspace, source)`
|
|
38
|
+
// and a mothership re-reads the authoritative row from the key it is handed. Built through
|
|
39
|
+
// `orgSecretRef` so the arity is the compiler's problem rather than a table in another
|
|
40
|
+
// package that this call site cannot see.
|
|
41
|
+
plaintext = await orgSecrets.decryptFor(orgSecretRef(secretSource, row.workspaceId, row.source), row.credentialsCipher);
|
|
42
|
+
}
|
|
43
|
+
catch (cause) {
|
|
44
|
+
// Re-bound rather than propagated raw: a decrypt/transport failure here routinely quotes the
|
|
45
|
+
// request URL or the value it choked on, and only the typed refusal carries the source a
|
|
46
|
+
// caller has to attribute the gap to.
|
|
47
|
+
throw new ConnectionCredentialsUnreadableError(row.source, { cause });
|
|
48
|
+
}
|
|
49
|
+
const { credentialsCipher: _sealed, ...rest } = row;
|
|
50
|
+
return { ...rest, credentials: parseCredentials(plaintext, row.source) };
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
async getByWorkspace(workspaceId, source) {
|
|
54
|
+
const row = await repository.getByWorkspace(workspaceId, source);
|
|
55
|
+
return row ? open(row) : null;
|
|
56
|
+
},
|
|
57
|
+
async listBySources(workspaceId, sources) {
|
|
58
|
+
if (sources.length === 0)
|
|
59
|
+
return [];
|
|
60
|
+
const wanted = new Set(sources);
|
|
61
|
+
// ONE stored-row read, then an open per source the caller named — never per stored row.
|
|
62
|
+
// A workspace's shelf legitimately holds sources a given corpus says nothing about, and on
|
|
63
|
+
// a mothership-mode node each open is a round trip.
|
|
64
|
+
const rows = (await repository.listByWorkspace(workspaceId)).filter((row) => wanted.has(row.source));
|
|
65
|
+
// Settled per row, never `Promise.all`: one unopenable bag is one source's fact, and letting
|
|
66
|
+
// it reject the batch is what made a single corrupt row read to every caller as though the
|
|
67
|
+
// workspace had no working connection at all.
|
|
68
|
+
return Promise.all(rows.map(async (row) => {
|
|
69
|
+
try {
|
|
70
|
+
return { source: row.source, status: 'opened', connection: await open(row) };
|
|
71
|
+
}
|
|
72
|
+
catch (cause) {
|
|
73
|
+
return { source: row.source, status: 'unreadable', cause };
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
},
|
|
77
|
+
async listSummaries(workspaceId) {
|
|
78
|
+
const rows = await repository.listByWorkspace(workspaceId);
|
|
79
|
+
return rows.map(({ workspaceId: ws, source, label, createdAt }) => ({
|
|
80
|
+
workspaceId: ws,
|
|
81
|
+
source,
|
|
82
|
+
label,
|
|
83
|
+
createdAt,
|
|
84
|
+
}));
|
|
85
|
+
},
|
|
86
|
+
async upsert(record) {
|
|
87
|
+
const { credentials, ...rest } = record;
|
|
88
|
+
const credentialsCipher = await orgSecrets.encryptFor({ source: secretSource, workspaceId: record.workspaceId }, JSON.stringify(credentials));
|
|
89
|
+
await repository.upsert({ ...rest, credentialsCipher });
|
|
90
|
+
},
|
|
91
|
+
softDelete(workspaceId, source, at) {
|
|
92
|
+
return repository.softDelete(workspaceId, source, at);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The opened plaintext as a credential bag.
|
|
98
|
+
*
|
|
99
|
+
* A bag that decrypted but does not parse is a corrupt row rather than an absent credential, so
|
|
100
|
+
* it throws for the same reason a failed decrypt does: the empty object it used to become read
|
|
101
|
+
* downstream as "connected, with nothing in it".
|
|
102
|
+
*/
|
|
103
|
+
function parseCredentials(plaintext, source) {
|
|
104
|
+
let parsed;
|
|
105
|
+
try {
|
|
106
|
+
parsed = JSON.parse(plaintext);
|
|
107
|
+
}
|
|
108
|
+
catch (cause) {
|
|
109
|
+
throw new ConnectionCredentialsUnreadableError(source, { cause });
|
|
110
|
+
}
|
|
111
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
112
|
+
throw new ConnectionCredentialsUnreadableError(source, {
|
|
113
|
+
cause: new Error('the opened value is not a credential bag'),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return parsed;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=sealedConnectionStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealedConnectionStore.js","sourceRoot":"","sources":["../../../src/modules/shared/sealedConnectionStore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAqGpE;;;;;;;;;GASG;AACH,MAAM,OAAO,oCAAqC,SAAQ,gBAAgB;IAE7D,MAAM;IADjB,YACW,MAAc,EACvB,OAA6B;QAE7B,KAAK,CACH,cAAc,MAAM,2CAA2C,EAC/D,mCAAmC,EACnC,EAAE,MAAM,EAAE,CACX,CAAA;sBAPQ,MAAM;QAQf,IAAI,CAAC,IAAI,GAAG,sCAAsC,CAAA;QAClD,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IAC/D,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CACzC,IAA6C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M,CAAC,WAAW,EAAE,EACzD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAC5B,CAAA;YACD,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAA;QACzD,CAAC;QAED,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE;YAChC,OAAO,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;QACvD,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,SAAiB,EAAE,MAAc;IACzD,IAAI,MAAe,CAAA;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,oCAAoC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IACnE,CAAC;IACD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,oCAAoC,CAAC,MAAM,EAAE;YACrD,KAAK,EAAE,IAAI,KAAK,CAAC,0CAA0C,CAAC;SAC7D,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,MAAgC,CAAA;AACzC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BlockEditAuthority } from '@cat-factory/contracts';
|
|
2
|
-
import type { BugHuntAssessor, BugHuntResult, RunBugHuntInput,
|
|
2
|
+
import type { BugHuntAssessor, BugHuntResult, RunBugHuntInput, TaskConnectionStore, TaskRepository, TaskSourceKind, TaskSourceRegistry, TrackerBoard } from '@cat-factory/kernel';
|
|
3
3
|
import type { TaskImportService } from './TaskImportService.js';
|
|
4
4
|
import type { TaskFromIssue, TaskLinkService } from './TaskLinkService.js';
|
|
5
5
|
export interface BugHuntServiceDependencies {
|
|
6
6
|
taskSourceRegistry: TaskSourceRegistry;
|
|
7
|
-
|
|
7
|
+
taskConnectionStore: TaskConnectionStore;
|
|
8
8
|
taskRepository: TaskRepository;
|
|
9
9
|
importService: TaskImportService;
|
|
10
10
|
linkService: TaskLinkService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugHuntService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAIV,eAAe,EAEf,aAAa,EAEb,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"BugHuntService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAIV,eAAe,EAEf,aAAa,EAEb,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,YAAY,EACb,MAAM,qBAAqB,CAAA;AAQ5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAkB1E,MAAM,WAAW,0BAA0B;IACzC,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,cAAc,EAAE,cAAc,CAAA;IAC9B,aAAa,EAAE,iBAAiB,CAAA;IAChC,WAAW,EAAE,eAAe,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACzD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAA;AAKrC,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,0BAA0B,EAAI;IAEjE;;;;OAIG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAarF;IAED;;;;;;;;OAQG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,aAAa,CAAC,CA0CxB;IAED;;;;;;;;;;;;OAYG;IACG,KAAK,CAAC,KAAK,EAAE;QACjB,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,cAAc,CAAA;QACtB,UAAU,EAAE,MAAM,CAAA;QAClB,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,kBAAkB,CAAA;QAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,OAAO,CAAC,aAAa,CAAC,CAezB;IAED;;;;OAIG;YACW,IAAI;IAgDlB,gGAAgG;YAClF,cAAc;CAO7B"}
|
|
@@ -159,7 +159,7 @@ export class BugHuntService {
|
|
|
159
159
|
}
|
|
160
160
|
/** Resolve a source's stored credentials, or an empty bag for a credentialless one (GitHub). */
|
|
161
161
|
async credentialsFor(workspaceId, source) {
|
|
162
|
-
const connection = await this.deps.
|
|
162
|
+
const connection = await this.deps.taskConnectionStore.getByWorkspace(workspaceId, source);
|
|
163
163
|
return connection?.credentials ?? {};
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugHuntService.js","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa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AE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;QACzE,CAAC;QACD,IAAI,CAAC;YACH,kFAAkF;YAClF,yFAAyF;YACzF,iEAAiE;YACjE,EAAE;YACF,wFAAwF;YACxF,kFAAkF;YAClF,yFAAyF;YACzF,iEAAiE;YACjE,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;gBAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;YACzE,CAAC;YACD,uFAAuF;YACvF,mFAAmF;YACnF,mEAAmE;YACnE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;gBAChD,WAAW;gBACX,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC;aAC3C,CAAC,CAAA;YACF,OAAO;gBACL,MAAM,EAAE,iBAAiB,CAAC,UAAU,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;gBACrE,cAAc,EAAE,QAAQ;gBACxB,KAAK;aACN,CAAA;QACH,CAAC;QAAC,MAAM,CAAC;YACP,uFAAuF;YACvF,uFAAuF;YACvF,uFAAuF;YACvF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;QACpE,CAAC;IACH,CAAC;IAED,gGAAgG;IACxF,KAAK,CAAC,cAAc,CAC1B,WAAmB,EACnB,MAAsB;QAEtB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"BugHuntService.js","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAA;AA8C5B;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ACtB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,eAAe;CACxB,CAAA;AAED;;;;;;GAMG;AACH,SAAS,aAAa,CAAC,MAAsB,EAAE,KAAa;IAC1D,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAA+B,CAEjD,CAAA;IACb,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AACpD,CAAC;AAED,uFAAuF;AACvF,SAAS,cAAc,CAAC,SAAuB;IAC7C,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE;QAC3C,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE;KACxD,CAAA;AACH,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { PipelineScheduleRepository,
|
|
1
|
+
import type { PipelineScheduleRepository, TaskConnectionStore, TaskRepository, TaskSourceKind, TaskSourceRegistry } from '@cat-factory/kernel';
|
|
2
2
|
import type { TaskImportService } from './TaskImportService.js';
|
|
3
3
|
import type { TaskLinkService } from './TaskLinkService.js';
|
|
4
4
|
export interface BugIntakeServiceDependencies {
|
|
5
5
|
pipelineScheduleRepository: PipelineScheduleRepository;
|
|
6
6
|
taskSourceRegistry: TaskSourceRegistry;
|
|
7
|
-
|
|
7
|
+
taskConnectionStore: TaskConnectionStore;
|
|
8
8
|
importService: TaskImportService;
|
|
9
9
|
linkService: TaskLinkService;
|
|
10
10
|
taskRepository: TaskRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugIntakeService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/BugIntakeService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"BugIntakeService.d.ts","sourceR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@@ -58,7 +58,7 @@ export class BugIntakeService {
|
|
|
58
58
|
};
|
|
59
59
|
let hit;
|
|
60
60
|
try {
|
|
61
|
-
const credentials = (await this.deps.
|
|
61
|
+
const credentials = (await this.deps.taskConnectionStore.getByWorkspace(workspaceId, config.source))
|
|
62
62
|
?.credentials ?? {};
|
|
63
63
|
const hits = await provider.searchIssues(credentials, query, workspaceId);
|
|
64
64
|
hit = hits[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugIntakeService.js","sourceRoot":"","sources":["../../../src/modules/tasks/BugIntakeService.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAGrD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAgD3E,uFAAuF;AACvF,MAAM,YAAY,GAAG,CAAC,CAAA;AACtB,kFAAkF;AAClF,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAEhC,MAAM,OAAO,gBAAgB;IACE,IAAI;IAAjC,YAA6B,IAAkC;oBAAlC,IAAI;IAAiC,CAAC;IAEnE;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAAC,WAAmB,EAAE,OAAe;QACrD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;QAC5F,MAAM,MAAM,GAAG,QAAQ,EAAE,WAAW,CAAA;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,iDAAiD,EAAE,CAAA;QACrF,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAChE,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC;YAC5B,OAAO;gBACL,MAAM,EAAE,IAAI;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AG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9E,OAAO,EAAE,aAAa,GAAG,CAAC,UAAU,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,IAAI;aACrE;SACF,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Clock } from '@cat-factory/kernel';
|
|
2
|
-
import type { TaskConnectionRecord,
|
|
1
|
+
import type { Clock, Logger } from '@cat-factory/kernel';
|
|
2
|
+
import type { TaskConnectionRecord, TaskConnectionStore } from '@cat-factory/kernel';
|
|
3
3
|
import type { TaskSourceSettingsRepository } from '@cat-factory/kernel';
|
|
4
4
|
import type { GitHubInstallationRepository } from '@cat-factory/kernel';
|
|
5
5
|
import type { TaskSourceProvider, TaskSourceRegistry } from '@cat-factory/kernel';
|
|
@@ -8,7 +8,7 @@ import type { WorkspaceRepository } from '@cat-factory/kernel';
|
|
|
8
8
|
import type { LinearOAuthSecret } from '@cat-factory/contracts';
|
|
9
9
|
import type { LinearTeam } from './linear.logic.js';
|
|
10
10
|
export interface TaskConnectionServiceDependencies {
|
|
11
|
-
|
|
11
|
+
taskConnectionStore: TaskConnectionStore;
|
|
12
12
|
/** Per-workspace on/off toggle for each source (absent row ⇒ enabled). */
|
|
13
13
|
taskSourceSettingsRepository: TaskSourceSettingsRepository;
|
|
14
14
|
registry: TaskSourceRegistry;
|
|
@@ -30,9 +30,16 @@ export interface TaskConnectionServiceDependencies {
|
|
|
30
30
|
* onboarding isn't offered (the manual personal-API-key path still works).
|
|
31
31
|
*/
|
|
32
32
|
resolveLinearOAuth?: (accountKey: string) => Promise<LinearOAuthSecret | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Where the paths that DEGRADE report: a connection whose sealed bag would not open, on the
|
|
35
|
+
* three surfaces that must keep answering anyway (re-connect, the setup check, the webhook
|
|
36
|
+
* panel). Absent ⇒ `noopLogger`, so the service stays unit-testable standalone.
|
|
37
|
+
*/
|
|
38
|
+
logger?: Logger;
|
|
33
39
|
}
|
|
34
40
|
export declare class TaskConnectionService {
|
|
35
41
|
private readonly deps;
|
|
42
|
+
private readonly log;
|
|
36
43
|
constructor(deps: TaskConnectionServiceDependencies);
|
|
37
44
|
/**
|
|
38
45
|
* Every configured source with the workspace's live state for it (drives the
|
|
@@ -103,10 +110,22 @@ export declare class TaskConnectionService {
|
|
|
103
110
|
private resolveAccountKey;
|
|
104
111
|
/** Build + upsert a connection record (shared by the manual connect + OAuth paths). */
|
|
105
112
|
private store;
|
|
113
|
+
/**
|
|
114
|
+
* The existing connection for a re-connect, or null when there is none to carry anything from.
|
|
115
|
+
*
|
|
116
|
+
* An unopenable bag answers null rather than throwing, and is REPORTED: the platform-owned
|
|
117
|
+
* webhook secret inside it cannot be carried across, so the connection lands with none and
|
|
118
|
+
* `getWebhookState` reports `configured: false` — the operator's own panel states the loss and
|
|
119
|
+
* offers the mint that repairs it. Losing it loudly is strictly better than the alternative this
|
|
120
|
+
* replaced, which was refusing the re-connect and leaving the row unopenable forever.
|
|
121
|
+
*/
|
|
122
|
+
private openForReconnect;
|
|
106
123
|
/** The workspace's current connection for a source, or null if not connected. */
|
|
107
124
|
getConnection(workspaceId: string, source: TaskSourceKind): Promise<TaskConnection | null>;
|
|
108
125
|
/** Every live connection the workspace holds, across sources. */
|
|
109
126
|
listConnections(workspaceId: string): Promise<TaskConnection[]>;
|
|
127
|
+
/** The stored connection's non-secret half, opening nothing. */
|
|
128
|
+
private summaryFor;
|
|
110
129
|
/** Resolve the live connection (with credentials) or throw if not connected. */
|
|
111
130
|
requireConnection(workspaceId: string, source: TaskSourceKind): Promise<TaskConnectionRecord>;
|
|
112
131
|
/**
|
|
@@ -124,7 +143,15 @@ export declare class TaskConnectionService {
|
|
|
124
143
|
* receiver, reading the inbound secret.
|
|
125
144
|
*/
|
|
126
145
|
getConnectionRecord(workspaceId: string, source: TaskSourceKind): Promise<TaskConnectionRecord | null>;
|
|
127
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* The connection's inbound-webhook state, safe to read back at any time (never the secret).
|
|
148
|
+
*
|
|
149
|
+
* DEGRADES rather than refuses when the bag will not open: this is the read-only panel an
|
|
150
|
+
* operator opens to find out what is wrong, so failing it replaces an answer with a 503 about
|
|
151
|
+
* the very thing they came to look at. The gap travels as `credentialsReadable: false`, which
|
|
152
|
+
* is what keeps the reported `configured: false` from reading as "no secret has been minted" —
|
|
153
|
+
* the state that would have them mint one over a bag still holding the live secret.
|
|
154
|
+
*/
|
|
128
155
|
getWebhookState(workspaceId: string, source: TaskSourceKind): Promise<TaskSourceWebhookState>;
|
|
129
156
|
/**
|
|
130
157
|
* Mint (or ROTATE) the connection's inbound-webhook secret, returning it exactly once.
|
|
@@ -153,6 +180,13 @@ export declare class TaskConnectionService {
|
|
|
153
180
|
* Clear the inbound-webhook secret, so deliveries stop being accepted (they 503 at the receiver,
|
|
154
181
|
* which is the honest answer: the operator turned this off). The connection itself is untouched
|
|
155
182
|
* — polling intake and imports keep working exactly as before.
|
|
183
|
+
*
|
|
184
|
+
* This one must OPEN the bag, and rightly REFUSES when it cannot: clearing is a rewrite of the
|
|
185
|
+
* bag minus one key, so proceeding blind would replace the workspace's vendor credentials with
|
|
186
|
+
* an empty object and take polling intake and imports down with the webhook. The refusal is the
|
|
187
|
+
* store's typed 503 (`connection_credentials_unreadable`), which names the remedy — and the
|
|
188
|
+
* operator's actual goal is already met either way, since a receiver that cannot open the bag
|
|
189
|
+
* cannot verify a delivery against it.
|
|
156
190
|
*/
|
|
157
191
|
clearWebhookSecret(workspaceId: string, source: TaskSourceKind): Promise<void>;
|
|
158
192
|
/** Disconnect a workspace from a source (tombstones the binding). */
|
|
@@ -165,6 +199,11 @@ export interface TaskSourceWebhookState {
|
|
|
165
199
|
configured: boolean;
|
|
166
200
|
deliveryPath: string;
|
|
167
201
|
replyAllow: string;
|
|
202
|
+
/**
|
|
203
|
+
* Whether the sealed bag could be opened to answer this. `false` ⇒ `configured` and `replyAllow`
|
|
204
|
+
* are their safe defaults rather than observed facts (see `taskSourceWebhookSchema`).
|
|
205
|
+
*/
|
|
206
|
+
credentialsReadable: boolean;
|
|
168
207
|
}
|
|
169
208
|
/**
|
|
170
209
|
* Where a tracker should POST its deliveries, relative to the deployment's public base URL.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskConnectionService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/TaskConnectionService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"TaskConnectionService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/TaskConnectionService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,KAAK,EAAE,4BAA4B,EAAe,MAAM,qBAAqB,CAAA;AACpF,OAAO,KAAK,EAAmB,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAS5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAYnD,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,0EAA0E;IAC1E,4BAA4B,EAAE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