@yadsh/dsh-qa-integrations 0.6.0 → 0.7.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/README.md +309 -288
- package/lib/broker.js +12 -0
- package/lib/broker.js.map +1 -1
- package/lib/client/bitrix24.js +66 -5
- package/lib/client/bitrix24.js.map +1 -1
- package/lib/client/confluence.js +97 -129
- package/lib/client/confluence.js.map +1 -1
- package/lib/client/gitlab.js +1 -1
- package/lib/client/gitlab.js.map +1 -1
- package/lib/client/index.js +25 -5
- package/lib/client/index.js.map +1 -1
- package/lib/client/integrations.js +1 -1
- package/lib/client/integrations.js.map +1 -1
- package/lib/client/jira.js +95 -127
- package/lib/client/jira.js.map +1 -1
- package/lib/client/operator-card.js +537 -0
- package/lib/client/operator-card.js.map +1 -0
- package/lib/client/operator-controls.js +232 -0
- package/lib/client/operator-controls.js.map +1 -0
- package/lib/client/styles.js +60 -0
- package/lib/client/styles.js.map +1 -1
- package/lib/client/testit.js +39 -3
- package/lib/client/testit.js.map +1 -1
- package/lib/client/weblate.js +38 -3
- package/lib/client/weblate.js.map +1 -1
- package/lib/client.js +2825 -785
- package/lib/client.js.map +1 -1
- package/lib/index.js +192 -51
- package/lib/index.js.map +1 -1
- package/lib/providers/bitrix24/catalog.js +138 -8
- package/lib/providers/bitrix24/catalog.js.map +1 -1
- package/lib/providers/bitrix24/config.js +85 -14
- package/lib/providers/bitrix24/config.js.map +1 -1
- package/lib/providers/bitrix24/index.js +113 -0
- package/lib/providers/bitrix24/index.js.map +1 -1
- package/lib/providers/confluence/catalog.js +51 -3
- package/lib/providers/confluence/catalog.js.map +1 -1
- package/lib/providers/confluence/index.js +293 -35
- package/lib/providers/confluence/index.js.map +1 -1
- package/lib/providers/confluence/operations.js +1 -1
- package/lib/providers/confluence/operations.js.map +1 -1
- package/lib/providers/jira/catalog.js +73 -3
- package/lib/providers/jira/catalog.js.map +1 -1
- package/lib/providers/jira/index.js +266 -12
- package/lib/providers/jira/index.js.map +1 -1
- package/lib/providers/testit/catalog.js +77 -0
- package/lib/providers/testit/catalog.js.map +1 -1
- package/lib/providers/testit/index.js +277 -3
- package/lib/providers/testit/index.js.map +1 -1
- package/lib/providers/weblate/catalog.js +103 -9
- package/lib/providers/weblate/catalog.js.map +1 -1
- package/lib/providers/weblate/index.js +243 -5
- package/lib/providers/weblate/index.js.map +1 -1
- package/lib/shared/settings.js +14 -0
- package/lib/shared/settings.js.map +1 -0
- package/lib/typert.host.js +148 -56
- package/lib/typert.remote-client.d.ts +13 -11
- package/lib/typert.remote-client.js +89 -50
- package/lib/types/broker.d.ts +11 -3
- package/lib/types/client/bitrix24.d.ts +24 -2
- package/lib/types/client/confluence.d.ts +19 -3
- package/lib/types/client/index.d.ts +7 -6
- package/lib/types/client/integrations.d.ts +2 -2
- package/lib/types/client/jira.d.ts +20 -3
- package/lib/types/client/operator-card.d.ts +22 -0
- package/lib/types/client/operator-controls.d.ts +135 -0
- package/lib/types/client/testit.d.ts +14 -1
- package/lib/types/client/weblate.d.ts +14 -1
- package/lib/types/index.d.ts +81 -13
- package/lib/types/providers/bitrix24/catalog.d.ts +8 -0
- package/lib/types/providers/bitrix24/config.d.ts +14 -23
- package/lib/types/providers/bitrix24/index.d.ts +36 -1
- package/lib/types/providers/confluence/catalog.d.ts +11 -3
- package/lib/types/providers/confluence/index.d.ts +61 -7
- package/lib/types/providers/confluence/operations.d.ts +2 -0
- package/lib/types/providers/jira/catalog.d.ts +13 -0
- package/lib/types/providers/jira/index.d.ts +48 -1
- package/lib/types/providers/testit/catalog.d.ts +12 -0
- package/lib/types/providers/testit/index.d.ts +61 -2
- package/lib/types/providers/weblate/catalog.d.ts +19 -2
- package/lib/types/providers/weblate/index.d.ts +43 -1
- package/lib/types/shared/settings.d.ts +14 -0
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
|
|
1
2
|
import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
|
|
2
3
|
import type { ConfluenceFlags } from "./config.js";
|
|
3
4
|
/**
|
|
@@ -37,12 +38,17 @@ export interface ConfluenceOperationDefinition {
|
|
|
37
38
|
* the two a `nextCursor` belongs to.
|
|
38
39
|
*/
|
|
39
40
|
readonly cursor?: "offset" | "upstream";
|
|
41
|
+
/** What this operation does, how sensitive it is, who may reach it. */
|
|
42
|
+
readonly security: OperationSecurityMetadata;
|
|
40
43
|
}
|
|
44
|
+
/** The resource kind every space-scoped operation of this provider is bounded by. */
|
|
45
|
+
export declare const CONFLUENCE_RESOURCE_KIND = "spaces";
|
|
41
46
|
/**
|
|
42
47
|
* Every model-reachable operation. The provider refuses any operation that is
|
|
43
|
-
* not listed here, so this table — together with `capability`
|
|
44
|
-
* permission surface. Only GET: the catalog carries no operation that
|
|
45
|
-
* change Confluence state, and the confirmation framework does not exist
|
|
48
|
+
* not listed here, so this table — together with `capability` and `security`
|
|
49
|
+
* — is the permission surface. Only GET: the catalog carries no operation that
|
|
50
|
+
* could change Confluence state, and the confirmation framework does not exist
|
|
51
|
+
* yet.
|
|
46
52
|
*
|
|
47
53
|
* The mix of REST versions is deliberate. Confluence Cloud v2 covers pages,
|
|
48
54
|
* comments, attachments, versions and spaces, and that is where the reads go;
|
|
@@ -56,4 +62,6 @@ export declare function enabledCapabilities(flags: ConfluenceFlags): readonly Co
|
|
|
56
62
|
export declare const CONFLUENCE_CAPABILITY_INFO: Readonly<Record<ConfluenceCapability, IntegrationCapabilityInfo>>;
|
|
57
63
|
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
58
64
|
export declare function confluenceOperationCapability(operation: string): IntegrationCapability | undefined;
|
|
65
|
+
/** Security classification of an operation, or undefined when it is unknown. */
|
|
66
|
+
export declare function confluenceOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
59
67
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
2
|
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
|
|
4
|
+
import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
4
5
|
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
5
6
|
export { credentialFromPlaintext, credentialInstance, type ConfluenceCredential, } from "./transport.js";
|
|
7
|
+
/**
|
|
8
|
+
* Whether one space key stays inside the deployment's boundary. The profile's
|
|
9
|
+
* `resources.spaces` lists space keys — the same vocabulary the deployment's
|
|
10
|
+
* own allowlist and the CQL speak — and keys are compared case-insensitively,
|
|
11
|
+
* because operator config, the v2 API and CQL spell the same key in different
|
|
12
|
+
* cases.
|
|
13
|
+
*/
|
|
14
|
+
export declare function spaceInBoundary(boundary: ServiceResourceBoundary, key: string | undefined): boolean;
|
|
6
15
|
/** Confluence provider: operator-configured sites over an Atlassian API token. */
|
|
7
16
|
export declare class ConfluenceProvider implements IntegrationProvider {
|
|
8
17
|
private readonly config;
|
|
@@ -28,20 +37,42 @@ export declare class ConfluenceProvider implements IntegrationProvider {
|
|
|
28
37
|
* from operator config, never from a tool argument, which is what keeps the
|
|
29
38
|
* broker from dialling any host the caller names or authenticating as any
|
|
30
39
|
* account the caller names.
|
|
40
|
+
*
|
|
41
|
+
* A deployment-managed secret cannot travel with a connect form, so it
|
|
42
|
+
* arrives as the Basic pair Atlassian documents (`email:token`). The two
|
|
43
|
+
* forms can never be confused: an API token contains neither `@` nor `:`.
|
|
31
44
|
*/
|
|
32
45
|
parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
|
|
33
46
|
readonly credential: string;
|
|
34
47
|
readonly portal: string;
|
|
35
48
|
};
|
|
36
49
|
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
50
|
+
operationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
51
|
+
/** Every space-scoped read is bounded by the profile's space keys. */
|
|
52
|
+
resourceBoundaryKind(operation: string): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Portal of a configured site. An empty id means "the only site", the same
|
|
55
|
+
* rule `parseCredential` applies, so deployment configuration and the
|
|
56
|
+
* connect form name sites alike.
|
|
57
|
+
*/
|
|
58
|
+
instancePortal(instanceId: string): string | undefined;
|
|
59
|
+
capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
|
|
37
60
|
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
61
|
+
/**
|
|
62
|
+
* Health of a deployment-managed token. The probe reads only the identity
|
|
63
|
+
* endpoint the personal validation reads, so it never changes upstream state;
|
|
64
|
+
* Confluence exposes no token-scope introspection, so the answer is healthy
|
|
65
|
+
* with a warning — the local service ceiling stays the whole local boundary.
|
|
66
|
+
*/
|
|
67
|
+
validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
|
|
38
68
|
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
39
69
|
/** One list read, with its cursor and with the space policy re-applied. */
|
|
40
70
|
private readList;
|
|
41
71
|
/**
|
|
42
72
|
* A page read is answered with the page's space, because that is what the
|
|
43
73
|
* operator allowlist is written in — and a page whose space the policy does
|
|
44
|
-
* not allow is refused here, after the read and before the model sees it.
|
|
74
|
+
* not allow is refused here, after the read and before the model sees it. In
|
|
75
|
+
* service mode the boundary is verified on the same resolved space.
|
|
45
76
|
*/
|
|
46
77
|
private readPage;
|
|
47
78
|
/**
|
|
@@ -55,14 +86,37 @@ export declare class ConfluenceProvider implements IntegrationProvider {
|
|
|
55
86
|
private withReplies;
|
|
56
87
|
/** One space, by id or by the key the listing endpoint resolves. */
|
|
57
88
|
private readSpace;
|
|
89
|
+
/**
|
|
90
|
+
* A service search is narrowed to the boundary before the handler builds the
|
|
91
|
+
* CQL: an offset-paginated search whose out-of-boundary rows were dropped
|
|
92
|
+
* afterwards would answer pages that shrink and cursors that lose their
|
|
93
|
+
* place. A space the caller names outside the boundary is refused rather
|
|
94
|
+
* than dropped, and the filter in `readList` stays as the second lock.
|
|
95
|
+
*/
|
|
96
|
+
private boundedSearchInput;
|
|
97
|
+
/**
|
|
98
|
+
* The bounded space listing. A service profile names the spaces it covers,
|
|
99
|
+
* so the listing is built from that list instead of from whatever the shared
|
|
100
|
+
* account can reach; a space the service token cannot see is reported as
|
|
101
|
+
* unavailable rather than silently dropped. The answer does not page: its
|
|
102
|
+
* size is the boundary the administrator defined, not upstream's.
|
|
103
|
+
*/
|
|
104
|
+
private listBoundedSpaces;
|
|
58
105
|
/** The fields a space contributes to a page answer, plus its policy key. */
|
|
59
106
|
private readSpaceFields;
|
|
60
107
|
/**
|
|
61
|
-
* The space of a page the call is about.
|
|
62
|
-
*
|
|
63
|
-
*
|
|
108
|
+
* The space of a page the call is about. Asked for whenever a policy needs
|
|
109
|
+
* it: the deployment allowlist, or — in service mode — the boundary, which is
|
|
110
|
+
* always there. Without either there is no policy to enforce, and the extra
|
|
111
|
+
* reads would be spent for nothing.
|
|
112
|
+
*/
|
|
113
|
+
private assertPageReachable;
|
|
114
|
+
/**
|
|
115
|
+
* Both space policies of one read, in the order a refusal should name them:
|
|
116
|
+
* the deployment allowlist first, the service boundary — when the call runs
|
|
117
|
+
* on the managed credential — second.
|
|
64
118
|
*/
|
|
65
|
-
private
|
|
119
|
+
private assertSpaceReachable;
|
|
66
120
|
/**
|
|
67
121
|
* A space outside the operator allowlist is refused as a policy decision, not
|
|
68
122
|
* as a Confluence permission: the account may well be allowed to read it, and
|
|
@@ -70,7 +124,7 @@ export declare class ConfluenceProvider implements IntegrationProvider {
|
|
|
70
124
|
*/
|
|
71
125
|
private assertSpaceAllowed;
|
|
72
126
|
/** The space of one search row, as the projection resolved it. */
|
|
73
|
-
private
|
|
127
|
+
private itemSpaceReachable;
|
|
74
128
|
private projectionContext;
|
|
75
129
|
private resolveInstance;
|
|
76
130
|
}
|
|
@@ -8,6 +8,8 @@ export declare function numericId(value: unknown, field: string): string;
|
|
|
8
8
|
export declare function spaceRef(value: unknown, field?: string): string;
|
|
9
9
|
/** Whether a space reference is the numeric id v2 wants in a path. */
|
|
10
10
|
export declare function isNumericSpace(value: string): boolean;
|
|
11
|
+
/** Space keys the model named, upper-cased the way CQL and the policy spell them. */
|
|
12
|
+
export declare function spaceKeys(value: unknown, field: string): string[];
|
|
11
13
|
/**
|
|
12
14
|
* Rows per answer. A `limit` above the deployment cap is clamped rather than
|
|
13
15
|
* refused: the answer says how many rows it carries, so the model can page on
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
|
|
1
2
|
import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
|
|
2
3
|
import type { JiraFlags } from "./config.js";
|
|
3
4
|
/**
|
|
@@ -38,7 +39,17 @@ export interface JiraOperationDefinition {
|
|
|
38
39
|
readonly method: "GET";
|
|
39
40
|
/** Set when the operation answers with one page of a collection. */
|
|
40
41
|
readonly list?: boolean;
|
|
42
|
+
/** What this operation does, how sensitive it is, who may reach it. */
|
|
43
|
+
readonly security: OperationSecurityMetadata;
|
|
41
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The resource kind every project-scoped operation of this provider is bounded
|
|
47
|
+
* by. The entries of a `projects` boundary are Jira project keys — the form
|
|
48
|
+
* every operation addresses a project by (`projects.get` takes a key, an issue
|
|
49
|
+
* key embeds its project's key). A listed numeric project id is honoured where
|
|
50
|
+
* Jira reports one, in a filtered search; a key is what an operator lists.
|
|
51
|
+
*/
|
|
52
|
+
export declare const JIRA_RESOURCE_KIND = "projects";
|
|
42
53
|
/**
|
|
43
54
|
* Every model-reachable operation. The provider refuses any operation that is
|
|
44
55
|
* not listed here, so this table — together with `capability` — is the
|
|
@@ -71,4 +82,6 @@ export declare function enabledCapabilities(flags: JiraFlags): readonly JiraCapa
|
|
|
71
82
|
export declare const JIRA_CAPABILITY_INFO: Readonly<Record<JiraCapability, IntegrationCapabilityInfo>>;
|
|
72
83
|
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
73
84
|
export declare function jiraOperationCapability(operation: string): IntegrationCapability | undefined;
|
|
85
|
+
/** Security classification of an operation, or undefined when it is unknown. */
|
|
86
|
+
export declare function jiraOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
74
87
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
2
|
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
|
|
4
|
+
import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
4
5
|
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
5
6
|
export { credentialFromPlaintext, credentialSite, type JiraCredential, } from "./transport.js";
|
|
6
7
|
/**
|
|
@@ -28,14 +29,52 @@ export declare class JiraProvider implements IntegrationProvider {
|
|
|
28
29
|
* Both non-secret choices come from the connect form and from operator config,
|
|
29
30
|
* never from a tool argument, which is what keeps the broker from dialling any
|
|
30
31
|
* host the caller names.
|
|
32
|
+
*
|
|
33
|
+
* The same method turns a deployment-managed secret into this credential
|
|
34
|
+
* shape. That secret is the whole Basic pair (`email:token`), because Jira
|
|
35
|
+
* cannot spend the token without the account and the pair must not be split
|
|
36
|
+
* across two records; the form path instead supplies the e-mail separately,
|
|
37
|
+
* and keeps refusing a pasted pair.
|
|
31
38
|
*/
|
|
32
39
|
parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
|
|
33
40
|
readonly credential: string;
|
|
34
41
|
readonly portal: string;
|
|
35
42
|
};
|
|
36
43
|
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
44
|
+
operationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
45
|
+
/** Every project-scoped read names its project through a key or an issue key. */
|
|
46
|
+
resourceBoundaryKind(operation: string): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Portal of a configured site. An empty id means "the only site", the same
|
|
49
|
+
* rule `parseCredential` applies, so deployment configuration and the connect
|
|
50
|
+
* form name sites alike.
|
|
51
|
+
*/
|
|
52
|
+
instancePortal(instanceId: string): string | undefined;
|
|
53
|
+
capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Health of a deployment-managed token. The probe reads only the identity
|
|
56
|
+
* endpoint the personal validation reads, so it never changes upstream state;
|
|
57
|
+
* Jira reports no granted scopes for an API token, so the answer is healthy
|
|
58
|
+
* with a warning — the local service ceiling stays the whole local boundary.
|
|
59
|
+
*/
|
|
60
|
+
validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
|
|
37
61
|
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
38
62
|
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
63
|
+
/**
|
|
64
|
+
* Hold one call inside the deployment's boundary. A single-resource read
|
|
65
|
+
* names its project — a project key, or the key an issue key embeds — and
|
|
66
|
+
* must stay inside it, or nothing is read. A search names none by default, so
|
|
67
|
+
* it is not refused here but answered with the hits filtered to the boundary
|
|
68
|
+
* instead.
|
|
69
|
+
*/
|
|
70
|
+
private assertInsideBoundary;
|
|
71
|
+
/**
|
|
72
|
+
* Fail closed on an issue an issue-security level closes off. The service
|
|
73
|
+
* identity may be allowed to see it upstream, so the check is made here,
|
|
74
|
+
* before anything about it is returned, and it answers the same not-found a
|
|
75
|
+
* personal caller would see for an issue they cannot.
|
|
76
|
+
*/
|
|
77
|
+
private assertIssueNotRestricted;
|
|
39
78
|
/**
|
|
40
79
|
* Replace a custom field's alias with the instance id the operator mapped it
|
|
41
80
|
* to. The mapping lives in the deployment's config on purpose: which of an
|
|
@@ -80,5 +119,13 @@ export declare class JiraProvider implements IntegrationProvider {
|
|
|
80
119
|
private requireCloud;
|
|
81
120
|
private resolveSite;
|
|
82
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Whether one caller-named project stays inside the deployment's boundary. The
|
|
124
|
+
* boundary lists project keys, and a Jira project key compares case-insensitively
|
|
125
|
+
* upstream while an operator may type it in any case, so the match normalizes
|
|
126
|
+
* the case; a listed numeric id matches exactly. A project key that is not
|
|
127
|
+
* listed never widens into its issues: `PROJ` does not cover `PROJX`.
|
|
128
|
+
*/
|
|
129
|
+
export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
|
|
83
130
|
export default JiraProvider;
|
|
84
131
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
|
|
1
2
|
import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
|
|
2
3
|
import type { TestitFlags } from "./config.js";
|
|
3
4
|
/**
|
|
@@ -47,7 +48,11 @@ export interface TestitOperationDefinition {
|
|
|
47
48
|
* the provider reads it through its bounded text path instead.
|
|
48
49
|
*/
|
|
49
50
|
readonly stream?: boolean;
|
|
51
|
+
/** What this operation does, how sensitive it is, who may reach it. */
|
|
52
|
+
readonly security: OperationSecurityMetadata;
|
|
50
53
|
}
|
|
54
|
+
/** The resource kind every project-scoped operation of this provider is bounded by. */
|
|
55
|
+
export declare const TESTIT_RESOURCE_KIND = "projects";
|
|
51
56
|
/**
|
|
52
57
|
* Every model-reachable operation. The provider refuses any operation that is
|
|
53
58
|
* not listed here, so this table — together with `capability` — is the
|
|
@@ -64,6 +69,11 @@ export interface TestitOperationDefinition {
|
|
|
64
69
|
* endpoints Test IT marks deprecated: they are kept because they are the only
|
|
65
70
|
* GET reads of those collections, and a version that drops them answers
|
|
66
71
|
* `ResourceNotFound`, which the model sees as an honest "not available here".
|
|
72
|
+
*
|
|
73
|
+
* The catalog carries no operation that could change Test IT state — no test-case
|
|
74
|
+
* edits, comments, run lifecycle or attachment uploads; those wait for the
|
|
75
|
+
* confirmation framework the specification requires for them. What a managed
|
|
76
|
+
* credential reaches is decided per operation by `security`.
|
|
67
77
|
*/
|
|
68
78
|
export declare const TESTIT_OPERATIONS: Readonly<Record<string, TestitOperationDefinition>>;
|
|
69
79
|
/** Capabilities this deployment allows, in catalog order. */
|
|
@@ -72,4 +82,6 @@ export declare function enabledCapabilities(flags: TestitFlags): readonly Testit
|
|
|
72
82
|
export declare const TESTIT_CAPABILITY_INFO: Readonly<Record<TestitCapability, IntegrationCapabilityInfo>>;
|
|
73
83
|
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
74
84
|
export declare function testitOperationCapability(operation: string): IntegrationCapability | undefined;
|
|
85
|
+
/** Security classification of an operation, or undefined when it is unknown. */
|
|
86
|
+
export declare function testitOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
75
87
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
2
|
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
|
|
4
|
+
import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
4
5
|
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
5
6
|
export { credentialFromPlaintext, credentialInstance, type TestitCredential, } from "./transport.js";
|
|
7
|
+
/**
|
|
8
|
+
* Whether one caller-named project stays inside the deployment's boundary.
|
|
9
|
+
* Test IT addresses projects by their id and offers no hierarchy a boundary
|
|
10
|
+
* entry could cover, so the match is the exact identifier the profile lists.
|
|
11
|
+
*/
|
|
12
|
+
export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
|
|
6
13
|
/**
|
|
7
14
|
* Test IT provider: one Test IT installation per QA user, connected with that
|
|
8
|
-
* user's own API token
|
|
15
|
+
* user's own API token, or with the deployment's managed read-only credential
|
|
16
|
+
* when the user's binding asks for it.
|
|
9
17
|
*
|
|
10
18
|
* The installation is operator configuration — the connect form only picks from
|
|
11
19
|
* the configured list — so the broker cannot be pointed at a host of the
|
|
@@ -36,6 +44,16 @@ export declare class TestitProvider implements IntegrationProvider {
|
|
|
36
44
|
readonly portal: string;
|
|
37
45
|
};
|
|
38
46
|
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
47
|
+
operationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
48
|
+
/** Every project-scoped read is bounded by the profile's project list. */
|
|
49
|
+
resourceBoundaryKind(operation: string): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Portal of a configured installation. An empty id means "the only
|
|
52
|
+
* installation", the same rule `parseCredential` applies, so deployment
|
|
53
|
+
* configuration and the connect form name installations alike.
|
|
54
|
+
*/
|
|
55
|
+
instancePortal(instanceId: string): string | undefined;
|
|
56
|
+
capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
|
|
39
57
|
/**
|
|
40
58
|
* The documented first validation call is the project list: an authorized
|
|
41
59
|
* answer proves the address and the token at once, and an empty project list
|
|
@@ -44,7 +62,48 @@ export declare class TestitProvider implements IntegrationProvider {
|
|
|
44
62
|
* reports what the probe proved and nothing more.
|
|
45
63
|
*/
|
|
46
64
|
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
65
|
+
/**
|
|
66
|
+
* Health of the deployment's managed token. Test IT reports neither the
|
|
67
|
+
* scopes of a token nor its owner, so the probe is the same read the personal
|
|
68
|
+
* validation makes — it never changes upstream state — and the answer says
|
|
69
|
+
* what was and was not learned instead of implying an audit it did not
|
|
70
|
+
* perform.
|
|
71
|
+
*/
|
|
72
|
+
validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
|
|
47
73
|
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* Hold one call inside the deployment's boundary. A call addressed by a
|
|
76
|
+
* project must name one the boundary lists; an id-addressed read resolves
|
|
77
|
+
* the project its object lives in first, and only then is answered. The
|
|
78
|
+
* project listing needs no check here: it is built from the allowlist
|
|
79
|
+
* itself, not from whatever the shared account can reach.
|
|
80
|
+
*/
|
|
81
|
+
private assertInsideBoundary;
|
|
82
|
+
/**
|
|
83
|
+
* Hold a fetched answer inside the boundary before it is returned. The
|
|
84
|
+
* object read names its project — directly, or through the run a test
|
|
85
|
+
* result belongs to — and a resource outside the boundary is discarded
|
|
86
|
+
* whole: upstream saw the read, the model never does.
|
|
87
|
+
*/
|
|
88
|
+
private assertAnswerInside;
|
|
89
|
+
/** Refuse unless the resolved project is one the boundary lists. */
|
|
90
|
+
private assertProject;
|
|
91
|
+
/**
|
|
92
|
+
* One companion read used to locate the project an id-addressed answer
|
|
93
|
+
* belongs to. It goes through the catalog handler of the operation it
|
|
94
|
+
* mirrors, so the id is validated exactly like a direct call's.
|
|
95
|
+
*/
|
|
96
|
+
private readFor;
|
|
97
|
+
/** The project of the object one companion read answers. */
|
|
98
|
+
private projectThrough;
|
|
99
|
+
/**
|
|
100
|
+
* The bounded project listing: a service profile names the projects it
|
|
101
|
+
* covers, so the answer is fetched from that list instead of from whatever
|
|
102
|
+
* the shared account can reach. A project the service token cannot see is
|
|
103
|
+
* reported as unavailable rather than silently dropped, which is what tells
|
|
104
|
+
* the operator their boundary and their token disagree.
|
|
105
|
+
*/
|
|
106
|
+
private listBoundedProjects;
|
|
48
107
|
/**
|
|
49
108
|
* One attachment, read as text. Test IT describes the file — its name and its
|
|
50
109
|
* size — before a byte is requested, and this provider trusts that description
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
|
|
1
2
|
import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
|
|
2
3
|
import type { WeblateFlags } from "./config.js";
|
|
3
4
|
/**
|
|
@@ -25,13 +26,27 @@ export interface WeblateOperationDefinition {
|
|
|
25
26
|
readonly path: string;
|
|
26
27
|
/** Set when the operation answers with one page of a collection. */
|
|
27
28
|
readonly list?: boolean;
|
|
29
|
+
/** What this operation does, how sensitive it is, who may reach it. */
|
|
30
|
+
readonly security: OperationSecurityMetadata;
|
|
28
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The resource kind every project-scoped operation of this provider is bounded
|
|
34
|
+
* by. A boundary entry is a project slug exactly as the operations address one,
|
|
35
|
+
* so a boundary entry and a tool argument are compared as strings.
|
|
36
|
+
*/
|
|
37
|
+
export declare const WEBLATE_RESOURCE_KIND = "projects";
|
|
29
38
|
/**
|
|
30
39
|
* Every model-reachable operation. The provider refuses any operation that is
|
|
31
|
-
* not listed here, so this table — together with `capability`
|
|
32
|
-
* permission surface. Only GET: localization writes (suggestions, comments,
|
|
40
|
+
* not listed here, so this table — together with `capability` and `security` —
|
|
41
|
+
* is the permission surface. Only GET: localization writes (suggestions, comments,
|
|
33
42
|
* translations, approvals) and the repository, file and autotranslate
|
|
34
43
|
* operations stay out until the confirmation framework exists.
|
|
44
|
+
*
|
|
45
|
+
* No operation of this catalog carries a secret or another person's raw output —
|
|
46
|
+
* there is no repository status or commit text here, and the localization text
|
|
47
|
+
* every read returns is bounded by the deployment's character cap and marked as
|
|
48
|
+
* untrusted content — so none of them is classified sensitive; a shared
|
|
49
|
+
* read-only account answers every one of them inside a project boundary.
|
|
35
50
|
*/
|
|
36
51
|
export declare const WEBLATE_OPERATIONS: Readonly<Record<string, WeblateOperationDefinition>>;
|
|
37
52
|
/** Capabilities this deployment allows, in catalog order. */
|
|
@@ -40,4 +55,6 @@ export declare function enabledCapabilities(flags: WeblateFlags): readonly Webla
|
|
|
40
55
|
export declare const WEBLATE_CAPABILITY_INFO: Readonly<Record<WeblateCapability, IntegrationCapabilityInfo>>;
|
|
41
56
|
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
42
57
|
export declare function weblateOperationCapability(operation: string): IntegrationCapability | undefined;
|
|
58
|
+
/** Security classification of an operation, or undefined when it is unknown. */
|
|
59
|
+
export declare function weblateOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
43
60
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
2
|
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialHealth } from "../../service-credentials/types.js";
|
|
4
|
+
import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
4
5
|
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
5
6
|
export { credentialFromPlaintext, credentialInstance, resultsOf, type WeblateCredential, } from "./transport.js";
|
|
6
7
|
export type WeblateTokenKind = "personal" | "project" | "unknown";
|
|
@@ -42,8 +43,49 @@ export declare class WeblateProvider implements IntegrationProvider {
|
|
|
42
43
|
readonly portal: string;
|
|
43
44
|
};
|
|
44
45
|
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
46
|
+
operationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
47
|
+
/** Every project-scoped read is held inside the profile's project boundary. */
|
|
48
|
+
resourceBoundaryKind(operation: string): string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Portal of a configured instance. An empty id means "the only instance", the
|
|
51
|
+
* same rule `parseCredential` applies, so deployment configuration and the
|
|
52
|
+
* connect form name instances alike.
|
|
53
|
+
*/
|
|
54
|
+
instancePortal(instanceId: string): string | undefined;
|
|
55
|
+
capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
|
|
45
56
|
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
57
|
+
/**
|
|
58
|
+
* Health of a deployment-managed token. The probe is the one read personal
|
|
59
|
+
* validation makes, so it cannot change upstream state; Weblate exposes no
|
|
60
|
+
* token-scope introspection, so there is nothing wider than read-only to
|
|
61
|
+
* detect here — the local service ceiling stays the only bound on what the
|
|
62
|
+
* credential may do, and the warning says so.
|
|
63
|
+
*/
|
|
64
|
+
validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
|
|
46
65
|
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* Hold one call inside the deployment's boundary. A service-safe operation
|
|
68
|
+
* either names its project in the arguments — a missing slug is refused, which
|
|
69
|
+
* is what keeps the global unit searches from answering with the shared
|
|
70
|
+
* account's whole view — or is addressed by the id of a string or a
|
|
71
|
+
* screenshot, which is resolved to its project upstream first.
|
|
72
|
+
*/
|
|
73
|
+
private assertInsideBoundary;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve one id-addressed read to the project it answers for. The probe is
|
|
76
|
+
* the same read the operation itself makes — Weblate has no cheaper "which
|
|
77
|
+
* project is this id" endpoint — and the probed answer is discarded unless
|
|
78
|
+
* the project is inside the boundary, so a foreign id reveals nothing.
|
|
79
|
+
*/
|
|
80
|
+
private projectOfAddressedResource;
|
|
81
|
+
/**
|
|
82
|
+
* The bounded project listing. A service profile names the projects it covers,
|
|
83
|
+
* so the answer is built from that list instead of from whatever the shared
|
|
84
|
+
* account can reach; a project the service token cannot see is reported as
|
|
85
|
+
* unavailable rather than silently dropped. The whole allowlist is the answer
|
|
86
|
+
* — its size is bounded by the administrator, not by a cursor.
|
|
87
|
+
*/
|
|
88
|
+
private listBoundedProjects;
|
|
47
89
|
private resolveInstance;
|
|
48
90
|
}
|
|
49
91
|
export default WeblateProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity shared by the Host plugin and its operator card.
|
|
3
|
+
*
|
|
4
|
+
* This module must stay dependency-free: the card bundle inlines it, and a
|
|
5
|
+
* browser build must not pull the Host config surface (schemastery) into the
|
|
6
|
+
* page just to learn the namespace name.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Settings namespace the plugin owns and its operator card binds to. The
|
|
10
|
+
* namespace carries the deployment configuration the card edits; the profile
|
|
11
|
+
* composition row stays the base layer an override reverts to.
|
|
12
|
+
*/
|
|
13
|
+
export declare const QA_INTEGRATIONS_SETTINGS_NAMESPACE = "qa-integrations";
|
|
14
|
+
//# sourceMappingURL=settings.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yadsh/dsh-qa-integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Principal-scoped, encrypted user integrations for DSH QA Surface",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"zod": "^4.4.3",
|
|
90
90
|
"@yadsh/dsh-plugin-kit": "^0.3.0",
|
|
91
91
|
"@yadsh/dsh-plugin-log": "^0.4.0",
|
|
92
|
-
"@yadsh/dsh-qa-surface": "^0.
|
|
92
|
+
"@yadsh/dsh-qa-surface": "^0.10.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"typescript": "^7.0.2",
|
|
124
124
|
"vitest": "^4.1.11",
|
|
125
125
|
"@yadsh/dsh-config": "^0.0.0",
|
|
126
|
-
"@yadsh/dsh-
|
|
127
|
-
"@yadsh/dsh-
|
|
126
|
+
"@yadsh/dsh-test-kit": "^0.1.0",
|
|
127
|
+
"@yadsh/dsh-plugin-scripts": "^0.0.0"
|
|
128
128
|
},
|
|
129
129
|
"publishConfig": {
|
|
130
130
|
"access": "public",
|