@yadsh/dsh-qa-integrations 0.5.0 → 0.6.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 +431 -18
- package/compatibility.json +1 -1
- package/lib/broker.js +456 -9
- package/lib/broker.js.map +1 -1
- package/lib/client/bitrix24.js +2 -1
- package/lib/client/bitrix24.js.map +1 -1
- package/lib/client/card.js +8 -1
- package/lib/client/card.js.map +1 -1
- package/lib/client/confluence.js +3 -2
- package/lib/client/confluence.js.map +1 -1
- package/lib/client/gitlab.js +40 -4
- package/lib/client/gitlab.js.map +1 -1
- package/lib/client/index.js +13 -11
- package/lib/client/index.js.map +1 -1
- package/lib/client/integrations.js +39 -2
- package/lib/client/integrations.js.map +1 -1
- package/lib/client/jira.js +3 -2
- package/lib/client/jira.js.map +1 -1
- package/lib/client/provider-card.js +138 -4
- package/lib/client/provider-card.js.map +1 -1
- package/lib/client/styles.js +8 -5
- package/lib/client/styles.js.map +1 -1
- package/lib/client/teamcity.js +31 -4
- package/lib/client/teamcity.js.map +1 -1
- package/lib/client/testit.js +65 -0
- package/lib/client/testit.js.map +1 -0
- package/lib/client/weblate.js +70 -0
- package/lib/client/weblate.js.map +1 -0
- package/lib/client.js +2600 -480
- package/lib/client.js.map +1 -1
- package/lib/coerce.js +16 -7
- package/lib/coerce.js.map +1 -1
- package/lib/config.js +12 -0
- package/lib/config.js.map +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.js +274 -28
- package/lib/index.js.map +1 -1
- package/lib/providers/bitrix24/catalog.js +13 -0
- package/lib/providers/bitrix24/catalog.js.map +1 -1
- package/lib/providers/bitrix24/config.js +3 -0
- package/lib/providers/bitrix24/config.js.map +1 -1
- package/lib/providers/bitrix24/credential-help.js +24 -0
- package/lib/providers/bitrix24/credential-help.js.map +1 -0
- package/lib/providers/bitrix24/index.js +9 -0
- package/lib/providers/bitrix24/index.js.map +1 -1
- package/lib/providers/bitrix24/operations.js +60 -1
- package/lib/providers/bitrix24/operations.js.map +1 -1
- package/lib/providers/bitrix24/tools.js +95 -3
- package/lib/providers/bitrix24/tools.js.map +1 -1
- package/lib/providers/confluence/credential-help.js +29 -0
- package/lib/providers/confluence/credential-help.js.map +1 -0
- package/lib/providers/confluence/index.js +9 -0
- package/lib/providers/confluence/index.js.map +1 -1
- package/lib/providers/gitlab/catalog.js +108 -15
- package/lib/providers/gitlab/catalog.js.map +1 -1
- package/lib/providers/gitlab/config.js +11 -3
- package/lib/providers/gitlab/config.js.map +1 -1
- package/lib/providers/gitlab/credential-help.js +33 -0
- package/lib/providers/gitlab/credential-help.js.map +1 -0
- package/lib/providers/gitlab/index.js +337 -6
- package/lib/providers/gitlab/index.js.map +1 -1
- package/lib/providers/jira/credential-help.js +31 -0
- package/lib/providers/jira/credential-help.js.map +1 -0
- package/lib/providers/jira/index.js +9 -0
- package/lib/providers/jira/index.js.map +1 -1
- package/lib/providers/registry.js +4 -0
- package/lib/providers/registry.js.map +1 -1
- package/lib/providers/shared/credential-help.js +29 -0
- package/lib/providers/shared/credential-help.js.map +1 -0
- package/lib/providers/shared/service-boundary.js +44 -0
- package/lib/providers/shared/service-boundary.js.map +1 -0
- package/lib/providers/teamcity/catalog.js +56 -2
- package/lib/providers/teamcity/catalog.js.map +1 -1
- package/lib/providers/teamcity/credential-help.js +25 -0
- package/lib/providers/teamcity/credential-help.js.map +1 -0
- package/lib/providers/teamcity/index.js +254 -2
- package/lib/providers/teamcity/index.js.map +1 -1
- package/lib/providers/testit/attachments.js +131 -0
- package/lib/providers/testit/attachments.js.map +1 -0
- package/lib/providers/testit/catalog.js +225 -0
- package/lib/providers/testit/catalog.js.map +1 -0
- package/lib/providers/testit/config.js +175 -0
- package/lib/providers/testit/config.js.map +1 -0
- package/lib/providers/testit/credential-help.js +29 -0
- package/lib/providers/testit/credential-help.js.map +1 -0
- package/lib/providers/testit/index.js +184 -0
- package/lib/providers/testit/index.js.map +1 -0
- package/lib/providers/testit/operations.js +1070 -0
- package/lib/providers/testit/operations.js.map +1 -0
- package/lib/providers/testit/tools.js +717 -0
- package/lib/providers/testit/tools.js.map +1 -0
- package/lib/providers/testit/transport.js +158 -0
- package/lib/providers/testit/transport.js.map +1 -0
- package/lib/providers/weblate/catalog.js +185 -0
- package/lib/providers/weblate/catalog.js.map +1 -0
- package/lib/providers/weblate/config.js +147 -0
- package/lib/providers/weblate/config.js.map +1 -0
- package/lib/providers/weblate/credential-help.js +26 -0
- package/lib/providers/weblate/credential-help.js.map +1 -0
- package/lib/providers/weblate/index.js +181 -0
- package/lib/providers/weblate/index.js.map +1 -0
- package/lib/providers/weblate/operations.js +703 -0
- package/lib/providers/weblate/operations.js.map +1 -0
- package/lib/providers/weblate/query.js +80 -0
- package/lib/providers/weblate/query.js.map +1 -0
- package/lib/providers/weblate/tools.js +408 -0
- package/lib/providers/weblate/tools.js.map +1 -0
- package/lib/providers/weblate/transport.js +179 -0
- package/lib/providers/weblate/transport.js.map +1 -0
- package/lib/repository.js +197 -13
- package/lib/repository.js.map +1 -1
- package/lib/service-credentials/config.js +179 -0
- package/lib/service-credentials/config.js.map +1 -0
- package/lib/service-credentials/policy.js +92 -0
- package/lib/service-credentials/policy.js.map +1 -0
- package/lib/service-credentials/registry.js +142 -0
- package/lib/service-credentials/registry.js.map +1 -0
- package/lib/service-credentials/state.js +30 -0
- package/lib/service-credentials/state.js.map +1 -0
- package/lib/service-credentials/types.js +20 -0
- package/lib/service-credentials/types.js.map +1 -0
- package/lib/tools.js +27 -2
- package/lib/tools.js.map +1 -1
- package/lib/typert.host.js +1187 -39
- package/lib/typert.remote-client.d.ts +37 -5
- package/lib/typert.remote-client.js +1057 -33
- package/lib/types/broker.d.ts +70 -4
- package/lib/types/client/bitrix24.d.ts +1 -1
- package/lib/types/client/card.d.ts +3 -1
- package/lib/types/client/confluence.d.ts +2 -2
- package/lib/types/client/gitlab.d.ts +15 -2
- package/lib/types/client/index.d.ts +3 -2
- package/lib/types/client/integrations.d.ts +11 -2
- package/lib/types/client/jira.d.ts +2 -2
- package/lib/types/client/provider-card.d.ts +50 -8
- package/lib/types/client/styles.d.ts +4 -3
- package/lib/types/client/teamcity.d.ts +15 -2
- package/lib/types/client/testit.d.ts +15 -0
- package/lib/types/client/weblate.d.ts +15 -0
- package/lib/types/coerce.d.ts +2 -2
- package/lib/types/config.d.ts +21 -0
- package/lib/types/errors.d.ts +9 -1
- package/lib/types/index.d.ts +108 -11
- package/lib/types/providers/bitrix24/catalog.d.ts +1 -1
- package/lib/types/providers/bitrix24/config.d.ts +11 -1
- package/lib/types/providers/bitrix24/credential-help.d.ts +8 -0
- package/lib/types/providers/bitrix24/index.d.ts +5 -0
- package/lib/types/providers/bitrix24/tools.d.ts +4 -0
- package/lib/types/providers/confluence/credential-help.d.ts +9 -0
- package/lib/types/providers/confluence/index.d.ts +5 -0
- package/lib/types/providers/contract.d.ts +62 -1
- package/lib/types/providers/gitlab/catalog.d.ts +20 -5
- package/lib/types/providers/gitlab/config.d.ts +14 -3
- package/lib/types/providers/gitlab/credential-help.d.ts +9 -0
- package/lib/types/providers/gitlab/index.d.ts +51 -1
- package/lib/types/providers/jira/credential-help.d.ts +8 -0
- package/lib/types/providers/jira/index.d.ts +5 -0
- package/lib/types/providers/registry.d.ts +2 -0
- package/lib/types/providers/shared/credential-help.d.ts +17 -0
- package/lib/types/providers/shared/service-boundary.d.ts +25 -0
- package/lib/types/providers/teamcity/catalog.d.ts +18 -2
- package/lib/types/providers/teamcity/credential-help.d.ts +8 -0
- package/lib/types/providers/teamcity/index.d.ts +53 -2
- package/lib/types/providers/testit/attachments.d.ts +20 -0
- package/lib/types/providers/testit/catalog.d.ts +75 -0
- package/lib/types/providers/testit/config.d.ts +61 -0
- package/lib/types/providers/testit/credential-help.d.ts +8 -0
- package/lib/types/providers/testit/index.d.ts +60 -0
- package/lib/types/providers/testit/operations.d.ts +95 -0
- package/lib/types/providers/testit/tools.d.ts +15 -0
- package/lib/types/providers/testit/transport.d.ts +67 -0
- package/lib/types/providers/weblate/catalog.d.ts +43 -0
- package/lib/types/providers/weblate/config.d.ts +57 -0
- package/lib/types/providers/weblate/credential-help.d.ts +9 -0
- package/lib/types/providers/weblate/index.d.ts +50 -0
- package/lib/types/providers/weblate/operations.d.ts +77 -0
- package/lib/types/providers/weblate/query.d.ts +37 -0
- package/lib/types/providers/weblate/tools.d.ts +15 -0
- package/lib/types/providers/weblate/transport.d.ts +60 -0
- package/lib/types/repository.d.ts +38 -3
- package/lib/types/service-credentials/config.d.ts +73 -0
- package/lib/types/service-credentials/policy.d.ts +44 -0
- package/lib/types/service-credentials/registry.d.ts +43 -0
- package/lib/types/service-credentials/state.d.ts +14 -0
- package/lib/types/service-credentials/types.d.ts +97 -0
- package/lib/types/tools.d.ts +10 -1
- package/lib/types/types.d.ts +114 -10
- package/package.json +7 -7
- package/lib/shared/settings.js +0 -19
- package/lib/shared/settings.js.map +0 -1
- package/lib/types/shared/settings.d.ts +0 -19
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
/**
|
|
3
|
+
* One Weblate deployment the operator allows. A user never types a host: the
|
|
4
|
+
* connect form only picks from this list, so the broker cannot be pointed at an
|
|
5
|
+
* arbitrary origin (the specification's SSRF rule). Weblate is usually
|
|
6
|
+
* self-hosted, which is exactly why "did the operator declare this address?"
|
|
7
|
+
* replaces "is this address public?".
|
|
8
|
+
*/
|
|
9
|
+
export interface WeblateInstance {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** Canonical `<origin><path>`, without a trailing slash. */
|
|
13
|
+
readonly baseUrl: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Deployment switches for the Weblate provider. Every read capability is on by
|
|
17
|
+
* default: the switches bound what this deployment is willing to expose at all,
|
|
18
|
+
* while Weblate's own project and team permissions decide what the connected
|
|
19
|
+
* token may actually read. The provider can only narrow, never widen.
|
|
20
|
+
*/
|
|
21
|
+
export interface WeblateFlags {
|
|
22
|
+
readonly enabled: boolean;
|
|
23
|
+
/** Development escape hatch; production instances must answer over HTTPS. */
|
|
24
|
+
readonly allowInsecureHttp: boolean;
|
|
25
|
+
readonly instances: readonly WeblateInstance[];
|
|
26
|
+
readonly identityRead: boolean;
|
|
27
|
+
readonly projectsRead: boolean;
|
|
28
|
+
readonly componentsRead: boolean;
|
|
29
|
+
readonly translationsRead: boolean;
|
|
30
|
+
readonly unitsRead: boolean;
|
|
31
|
+
readonly checksRead: boolean;
|
|
32
|
+
readonly commentsRead: boolean;
|
|
33
|
+
readonly suggestionsRead: boolean;
|
|
34
|
+
readonly changesRead: boolean;
|
|
35
|
+
readonly statisticsRead: boolean;
|
|
36
|
+
readonly screenshotsRead: boolean;
|
|
37
|
+
/** Character cap for one source or target string handed to the model. */
|
|
38
|
+
readonly maxTextChars: number;
|
|
39
|
+
/**
|
|
40
|
+
* Rows per page this deployment hands the model, whatever Weblate allows: the
|
|
41
|
+
* provider's own default is 20 and this is the ceiling.
|
|
42
|
+
*/
|
|
43
|
+
readonly maxPageSize: number;
|
|
44
|
+
/** Extra attempts for a rate-limited or transient read; writes never retry. */
|
|
45
|
+
readonly retries: number;
|
|
46
|
+
}
|
|
47
|
+
export declare const WEBLATE_DEFAULTS: WeblateFlags;
|
|
48
|
+
/**
|
|
49
|
+
* Config slice of this provider, as it appears under `weblate:` in YAML. The
|
|
50
|
+
* instance list is validated and canonicalized by `resolveWeblateConfig`, which
|
|
51
|
+
* is where a deployment typo fails loudly.
|
|
52
|
+
*/
|
|
53
|
+
export declare const weblateConfigSchema: z<Partial<WeblateFlags>>;
|
|
54
|
+
export declare function resolveWeblateConfig(input?: Partial<WeblateFlags>): WeblateFlags;
|
|
55
|
+
/** The configured instance a stored credential names, or a fail-closed error. */
|
|
56
|
+
export declare function weblateInstance(flags: WeblateFlags, instanceId: string): WeblateInstance | undefined;
|
|
57
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
|
+
/**
|
|
3
|
+
* Weblate issues the token inside the instance the user works with, so the
|
|
4
|
+
* declared help explains where in the instance it lives and what the two token
|
|
5
|
+
* prefixes mean; the address itself belongs to the deployment and is replaced
|
|
6
|
+
* through `credentialHelp.weblate`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const WEBLATE_CREDENTIAL_HELP: CredentialHelp;
|
|
9
|
+
//# sourceMappingURL=credential-help.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
|
+
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
3
|
+
import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
4
|
+
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
5
|
+
export { credentialFromPlaintext, credentialInstance, resultsOf, type WeblateCredential, } from "./transport.js";
|
|
6
|
+
export type WeblateTokenKind = "personal" | "project" | "unknown";
|
|
7
|
+
/**
|
|
8
|
+
* Which of Weblate's token shapes a value looks like. Weblate decides what a
|
|
9
|
+
* token may do, so this only ever reaches the user as a label.
|
|
10
|
+
*/
|
|
11
|
+
export declare function tokenKind(token: string): WeblateTokenKind;
|
|
12
|
+
/**
|
|
13
|
+
* Weblate provider: operator-configured instances over a Weblate API token.
|
|
14
|
+
*
|
|
15
|
+
* Localization state is read-only here. Weblate's search grammar is composed
|
|
16
|
+
* from validated filters rather than accepted from the model, upstream URLs are
|
|
17
|
+
* echoed only when they point at the configured instance and never followed, and
|
|
18
|
+
* every answer that carries upstream-authored text is marked as untrusted
|
|
19
|
+
* content.
|
|
20
|
+
*/
|
|
21
|
+
export declare class WeblateProvider implements IntegrationProvider {
|
|
22
|
+
private readonly config;
|
|
23
|
+
readonly id = "weblate";
|
|
24
|
+
readonly displayName = "Weblate";
|
|
25
|
+
/** What this deployment allows; Weblate's own permissions still apply. */
|
|
26
|
+
readonly capabilities: readonly IntegrationCapability[];
|
|
27
|
+
readonly capabilityInfo: Readonly<Record<IntegrationCapability, IntegrationCapabilityInfo>>;
|
|
28
|
+
/** Where the settings card says this provider's credential comes from. */
|
|
29
|
+
readonly credentialHelp: CredentialHelp | null;
|
|
30
|
+
/** Overrides the deployment got wrong; reported once at startup, never fatal. */
|
|
31
|
+
readonly credentialHelpProblems: readonly string[];
|
|
32
|
+
private readonly transport;
|
|
33
|
+
constructor(config: ResolvedQaIntegrationsConfig, fetcher?: typeof fetch);
|
|
34
|
+
/**
|
|
35
|
+
* Keep only the token, tagged with the instance it was minted for. The
|
|
36
|
+
* instance comes from the connect form and from operator config, never from a
|
|
37
|
+
* tool argument, which is what keeps the broker from dialling any host the
|
|
38
|
+
* caller names.
|
|
39
|
+
*/
|
|
40
|
+
parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
|
|
41
|
+
readonly credential: string;
|
|
42
|
+
readonly portal: string;
|
|
43
|
+
};
|
|
44
|
+
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
45
|
+
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
46
|
+
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
47
|
+
private resolveInstance;
|
|
48
|
+
}
|
|
49
|
+
export default WeblateProvider;
|
|
50
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { WeblateFlags } from "./config.js";
|
|
2
|
+
import { type WeblateQuery } from "./transport.js";
|
|
3
|
+
/** Rows per page when the agent does not ask for more. */
|
|
4
|
+
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
5
|
+
/** Characters of one source/target string in a list answer. */
|
|
6
|
+
export declare const SUMMARY_TEXT_CHARS = 200;
|
|
7
|
+
/**
|
|
8
|
+
* A component reference: one slug, or a category path in front of it. Every
|
|
9
|
+
* segment is validated and encoded on its own, so the separator that joins them
|
|
10
|
+
* is the provider's and never a character the caller smuggled in.
|
|
11
|
+
*/
|
|
12
|
+
export declare function componentRef(value: unknown, field?: string): string;
|
|
13
|
+
export declare function projectRef(value: unknown, field?: string): string;
|
|
14
|
+
export declare function languageRef(value: unknown, field?: string): string;
|
|
15
|
+
export interface OperationContext {
|
|
16
|
+
readonly flags: WeblateFlags;
|
|
17
|
+
/** Canonical address of the instance this call is dialled at. */
|
|
18
|
+
readonly origin: string;
|
|
19
|
+
}
|
|
20
|
+
export interface WeblateRequest {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly query: WeblateQuery;
|
|
23
|
+
/** Present for the operations that answer with one page of a collection. */
|
|
24
|
+
readonly page?: {
|
|
25
|
+
readonly page: number;
|
|
26
|
+
readonly perPage: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export type WeblateOperationHandler = (input: Readonly<Record<string, unknown>>, context: OperationContext) => WeblateRequest;
|
|
30
|
+
export declare const WEBLATE_HANDLERS: Readonly<Record<string, WeblateOperationHandler>>;
|
|
31
|
+
/**
|
|
32
|
+
* Upstream URLs are echoed only when they point at the configured instance, and
|
|
33
|
+
* never followed: the provider answers with the address, it does not dial it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function sameOriginUrl(value: unknown, origin: string): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Which project, component and language a unit belongs to, read out of the
|
|
38
|
+
* translation URL Weblate itself put in the answer. A category path keeps its
|
|
39
|
+
* place, so a component inside a category is reported and re-usable as the
|
|
40
|
+
* `component` argument of another call.
|
|
41
|
+
*/
|
|
42
|
+
export declare function translationRef(value: unknown, origin: string): Record<string, unknown> | undefined;
|
|
43
|
+
export declare function unitState(value: unknown): string;
|
|
44
|
+
/**
|
|
45
|
+
* The Weblate account a `GET /api/users/` answer belongs to. An unprivileged
|
|
46
|
+
* token sees only itself, which is how the connected account is identified; a
|
|
47
|
+
* token that may list users answers with many rows, and then the account is
|
|
48
|
+
* reported as unknown rather than guessed from the first row.
|
|
49
|
+
*/
|
|
50
|
+
export declare function accountFromUsers(data: unknown): {
|
|
51
|
+
readonly account: Record<string, unknown> | null;
|
|
52
|
+
readonly resolved: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The name of the account as the Settings card shows it. An unresolved account
|
|
56
|
+
* falls back to whatever the caller names instead of a name picked at random.
|
|
57
|
+
*/
|
|
58
|
+
export declare function accountNameFrom(data: unknown, fallback: string): string;
|
|
59
|
+
/** External id the broker stores for this connection, when it is known. */
|
|
60
|
+
export declare function accountIdFrom(data: unknown): string;
|
|
61
|
+
export interface WeblateProjectionContext {
|
|
62
|
+
readonly flags: WeblateFlags;
|
|
63
|
+
readonly origin: string;
|
|
64
|
+
/** Character budget for one string in this answer. */
|
|
65
|
+
readonly textLimit: number;
|
|
66
|
+
}
|
|
67
|
+
export type WeblateProjection = (data: unknown, context: WeblateProjectionContext) => unknown;
|
|
68
|
+
export declare const WEBLATE_PROJECTIONS: Readonly<Record<string, WeblateProjection>>;
|
|
69
|
+
/**
|
|
70
|
+
* Operations whose answer carries upstream-authored localization text. The
|
|
71
|
+
* marker is what tells a reader of the raw JSON that the strings inside were
|
|
72
|
+
* written by people on the far side and are data to them, never instructions.
|
|
73
|
+
*/
|
|
74
|
+
export declare const WEBLATE_UNTRUSTED_OPERATIONS: readonly string[];
|
|
75
|
+
/** Character budget of one string in the answer of this operation. */
|
|
76
|
+
export declare function textLimitFor(operation: string, requested: unknown, flags: WeblateFlags): number;
|
|
77
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Values of Weblate's `is:` lookup this provider exposes. `needs-editing` and
|
|
3
|
+
* `fuzzy` are synonyms upstream, and `untranslated` is Weblate's own definition
|
|
4
|
+
* (everything below "translated"), which therefore includes the strings marked
|
|
5
|
+
* for editing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const UNIT_STATE_FILTERS: readonly ["untranslated", "needs-editing", "translated", "approved", "read-only"];
|
|
8
|
+
export type UnitStateFilter = (typeof UNIT_STATE_FILTERS)[number];
|
|
9
|
+
/** Text fields of a unit the agent may search inside. */
|
|
10
|
+
export declare const UNIT_TEXT_FIELDS: readonly ["source", "target", "context", "note"];
|
|
11
|
+
export type UnitTextField = (typeof UNIT_TEXT_FIELDS)[number];
|
|
12
|
+
/** `has:` lookups this provider exposes; all are upstream-documented. */
|
|
13
|
+
export declare const FAILING_CHECK_CLAUSE = "has:check";
|
|
14
|
+
export declare const SUGGESTION_CLAUSE = "has:suggestion";
|
|
15
|
+
export declare const COMMENT_CLAUSE = "has:comment";
|
|
16
|
+
/**
|
|
17
|
+
* One grammar value, always double-quoted with `\` and `"` escaped: the parser
|
|
18
|
+
* accepts quoted strings for every field this provider uses, and a bare word
|
|
19
|
+
* may not contain a space. Line breaks are refused rather than escaped, because
|
|
20
|
+
* the grammar's whitespace escapes would silently turn them into something else.
|
|
21
|
+
*/
|
|
22
|
+
export declare function quoteQueryValue(value: string): string;
|
|
23
|
+
/** Exact match on a field whose value the agent named: a project, component or language. */
|
|
24
|
+
export declare function exactClause(field: "project" | "component" | "language", value: string): string;
|
|
25
|
+
/** Substring match inside one of the unit's own texts. */
|
|
26
|
+
export declare function textClause(field: UnitTextField, value: string): string;
|
|
27
|
+
/** Weblate's `is:` state lookup, so the vocabulary stays upstream's own. */
|
|
28
|
+
export declare function stateClause(state: UnitStateFilter): string;
|
|
29
|
+
export declare function isUnitStateFilter(value: unknown): value is UnitStateFilter;
|
|
30
|
+
export declare function isUnitTextField(value: unknown): value is UnitTextField;
|
|
31
|
+
/**
|
|
32
|
+
* Clauses joined the way Weblate reads them: `a AND b`, or nothing at all. A
|
|
33
|
+
* filter that is asked for twice is asked for once — the same clause repeated
|
|
34
|
+
* would narrow nothing and would only make the audit line harder to read.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildUnitQuery(clauses: readonly string[]): string;
|
|
37
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
2
|
+
import type { IntegrationBroker } from "../../broker.js";
|
|
3
|
+
import type { IntegrationPrincipal } from "../../types.js";
|
|
4
|
+
export declare const WEBLATE_TOOL_NAMES: readonly ["weblate_connection_get", "weblate_projects_list", "weblate_project_get", "weblate_project_statistics_get", "weblate_components_list", "weblate_component_get", "weblate_component_statistics_get", "weblate_translations_list", "weblate_translation_get", "weblate_translation_statistics_get", "weblate_units_search", "weblate_units_find", "weblate_unit_get", "weblate_unit_comments_list", "weblate_unit_suggestions_list", "weblate_failing_units_list", "weblate_changes_list", "weblate_screenshots_list", "weblate_screenshot_get"];
|
|
5
|
+
/**
|
|
6
|
+
* Every tool reports what the *connected* Weblate account may read, never a
|
|
7
|
+
* caller-supplied identity: the account comes from the stored integration of the
|
|
8
|
+
* QA user who owns the DSH session, and the tool schemas carry no user,
|
|
9
|
+
* credential or instance selector.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createWeblateTools(options: {
|
|
12
|
+
readonly broker: IntegrationBroker;
|
|
13
|
+
readonly principalForSession: (sessionId: string) => IntegrationPrincipal | undefined;
|
|
14
|
+
}): readonly ToolDefinition[];
|
|
15
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
2
|
+
import { type WeblateFlags, type WeblateInstance } from "./config.js";
|
|
3
|
+
/**
|
|
4
|
+
* Encrypted credential payload of one Weblate connection: which configured
|
|
5
|
+
* instance the token belongs to, and the token itself. The base URL is not
|
|
6
|
+
* stored — it is re-resolved from operator config on every call, so removing or
|
|
7
|
+
* repointing an instance takes effect at once instead of at the next connect.
|
|
8
|
+
*/
|
|
9
|
+
export interface WeblateCredential {
|
|
10
|
+
readonly instanceId: string;
|
|
11
|
+
readonly token: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function credentialFromPlaintext(plaintext: string): WeblateCredential;
|
|
14
|
+
/**
|
|
15
|
+
* The configured instance a credential belongs to. A credential minted for an
|
|
16
|
+
* instance the operator has since removed fails closed: it never falls back to
|
|
17
|
+
* another instance, however permissive that one is.
|
|
18
|
+
*/
|
|
19
|
+
export declare function credentialInstance(flags: WeblateFlags, credential: WeblateCredential): WeblateInstance;
|
|
20
|
+
export interface WeblateQuery {
|
|
21
|
+
readonly [key: string]: string | number | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One page of a Weblate collection. Weblate paginates in the body
|
|
25
|
+
* (`count`/`next`/`previous`/`results`), not in headers, and its `next` is an
|
|
26
|
+
* absolute URL: only the page number is read out of it, and only when it points
|
|
27
|
+
* at the configured instance, so a hostile or misconfigured upstream cannot move
|
|
28
|
+
* a follow-up request to another origin.
|
|
29
|
+
*/
|
|
30
|
+
export interface WeblatePage {
|
|
31
|
+
readonly page: number;
|
|
32
|
+
readonly perPage: number;
|
|
33
|
+
readonly nextPage?: number;
|
|
34
|
+
readonly total?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface WeblateJsonResponse<T> {
|
|
37
|
+
readonly data: T;
|
|
38
|
+
readonly page?: WeblatePage;
|
|
39
|
+
}
|
|
40
|
+
/** The `results` array of a paginated answer, or an empty list. */
|
|
41
|
+
export declare function resultsOf(value: unknown): readonly unknown[];
|
|
42
|
+
/**
|
|
43
|
+
* HTTP boundary of the provider: one documented Weblate REST call, bounded in
|
|
44
|
+
* time and size, with upstream failures folded into safe domain errors and
|
|
45
|
+
* bounded retries for the transient ones.
|
|
46
|
+
*/
|
|
47
|
+
export declare class WeblateTransport {
|
|
48
|
+
private readonly config;
|
|
49
|
+
private readonly flags;
|
|
50
|
+
private readonly fetcher;
|
|
51
|
+
constructor(config: ResolvedQaIntegrationsConfig, flags: WeblateFlags, fetcher?: typeof fetch);
|
|
52
|
+
getJson<T>(instance: WeblateInstance, token: string, path: string, query?: WeblateQuery, requested?: {
|
|
53
|
+
readonly page: number;
|
|
54
|
+
readonly perPage: number;
|
|
55
|
+
}): Promise<WeblateJsonResponse<T>>;
|
|
56
|
+
private url;
|
|
57
|
+
private request;
|
|
58
|
+
private failure;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EncryptedSecretRecord, IntegrationAuditEntry, IntegrationCapability, IntegrationFile, IntegrationPolicyMode, IntegrationPrincipal, IntegrationProviderId, StoredIntegration } from "./types.js";
|
|
1
|
+
import type { CredentialSource, EncryptedSecretRecord, IntegrationAuditEntry, IntegrationCapability, IntegrationFile, IntegrationPolicyMode, IntegrationPrincipal, IntegrationProviderId, IntegrationServiceBoundary, StoredIntegration } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Durable plugin-owned store, as tables. Every lookup starts from principal +
|
|
4
4
|
* provider, which is the pair the unique index covers, so a lookup reads the
|
|
@@ -24,16 +24,51 @@ export declare class IntegrationRepository {
|
|
|
24
24
|
connect(options: {
|
|
25
25
|
principal: IntegrationPrincipal;
|
|
26
26
|
provider: IntegrationProviderId;
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The personal credential, or null when this connection is created in
|
|
29
|
+
* service mode. A connection that runs on the managed credential keeps any
|
|
30
|
+
* personal credential it already had, inactive: it is never a fallback, but
|
|
31
|
+
* the user can switch back without minting a new token.
|
|
32
|
+
*/
|
|
33
|
+
secret: EncryptedSecretRecord | null;
|
|
28
34
|
tenantId: string;
|
|
29
35
|
externalUserId: string;
|
|
30
36
|
displayName: string;
|
|
31
37
|
capabilities: readonly IntegrationCapability[];
|
|
38
|
+
credentialSource?: CredentialSource;
|
|
39
|
+
serviceProfileId?: string | null;
|
|
32
40
|
}): StoredIntegration;
|
|
33
41
|
updateValidation(principal: IntegrationPrincipal, provider: IntegrationProviderId, success: boolean, errorCode: string | null, capabilities?: readonly IntegrationCapability[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* Move a binding between credential sources without touching upstream. The
|
|
44
|
+
* binding revision is bumped, so everything derived from the previous identity
|
|
45
|
+
* — caches, cursors, prepared actions — is stale from this moment on; the
|
|
46
|
+
* personal credential, if there is one, stays stored but unused.
|
|
47
|
+
*/
|
|
48
|
+
setCredentialSource(options: {
|
|
49
|
+
principal: IntegrationPrincipal;
|
|
50
|
+
provider: IntegrationProviderId;
|
|
51
|
+
source: CredentialSource;
|
|
52
|
+
serviceProfileId: string | null;
|
|
53
|
+
capabilities: readonly IntegrationCapability[];
|
|
54
|
+
tenantId: string;
|
|
55
|
+
externalUserId: string;
|
|
56
|
+
displayName: string;
|
|
57
|
+
}): StoredIntegration | undefined;
|
|
58
|
+
/** Store what this binding narrows the profile's allowlist to. */
|
|
59
|
+
setServiceSelection(principal: IntegrationPrincipal, provider: IntegrationProviderId, selection: IntegrationServiceBoundary | null): void;
|
|
60
|
+
/** Record which profile revision the binding was last resolved against. */
|
|
61
|
+
setServicePolicyRevision(principal: IntegrationPrincipal, provider: IntegrationProviderId, revision: string): void;
|
|
34
62
|
setPolicy(principal: IntegrationPrincipal, provider: IntegrationProviderId, operation: IntegrationCapability, mode: IntegrationPolicyMode): void;
|
|
35
63
|
disconnect(principal: IntegrationPrincipal, provider: IntegrationProviderId): boolean;
|
|
36
|
-
audit(entry: Omit<IntegrationAuditEntry, "id" | "createdAt">): void;
|
|
64
|
+
audit(entry: Omit<IntegrationAuditEntry, "id" | "createdAt" | "credentialSource" | "serviceProfileId"> & Partial<Pick<IntegrationAuditEntry, "credentialSource" | "serviceProfileId">>): void;
|
|
65
|
+
/**
|
|
66
|
+
* Widen stored capability lists whose ids a provider has since split, copying
|
|
67
|
+
* each legacy policy onto every id that replaced it. A provider-agnostic
|
|
68
|
+
* repair driven by the composition root: it is idempotent, so running it on
|
|
69
|
+
* every start costs one scan and changes nothing once applied.
|
|
70
|
+
*/
|
|
71
|
+
expandCapabilities(renames: Readonly<Record<string, readonly string[]>>): void;
|
|
37
72
|
/**
|
|
38
73
|
* Import a pre-SQLite `qa-integrations.json` exactly once, then rename it
|
|
39
74
|
* aside. A database that already holds a connection is never overwritten by
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
/**
|
|
3
|
+
* One deployment-managed credential, as it appears under
|
|
4
|
+
* `managedServiceCredentials.profiles[]` in YAML. Everything here is operator
|
|
5
|
+
* input, so a typo fails loudly at load: a silently dropped profile would leave
|
|
6
|
+
* users with a provider they cannot use through the managed path and no
|
|
7
|
+
* explanation.
|
|
8
|
+
*/
|
|
9
|
+
export interface ManagedServiceCredentialProfileInput {
|
|
10
|
+
readonly id?: string;
|
|
11
|
+
readonly provider?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Operator-facing instance id of the provider slice this credential belongs
|
|
14
|
+
* to — the same id the connect form offers, such as a GitLab `instances[].id`.
|
|
15
|
+
*/
|
|
16
|
+
readonly instance?: string;
|
|
17
|
+
/** Safe alias shown to users, e.g. "QA GitLab Read-only". */
|
|
18
|
+
readonly label?: string;
|
|
19
|
+
/** Set to false to retire a profile without deleting its configuration. */
|
|
20
|
+
readonly enabled?: boolean;
|
|
21
|
+
readonly credential?: {
|
|
22
|
+
readonly type?: string;
|
|
23
|
+
readonly secretFile?: string;
|
|
24
|
+
readonly secretEnv?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Administrator-defined resource boundary; at least one kind is required. */
|
|
27
|
+
readonly resources?: Readonly<Record<string, readonly (string | number)[] | undefined>>;
|
|
28
|
+
/** Administrator narrowing of the service ceiling. Only `deny` is accepted. */
|
|
29
|
+
readonly policy?: Readonly<Record<string, string | undefined>>;
|
|
30
|
+
}
|
|
31
|
+
export interface ManagedServiceCredentialsInput {
|
|
32
|
+
readonly enabled?: boolean;
|
|
33
|
+
/** Whether a new connection starts in service mode when a profile exists. */
|
|
34
|
+
readonly defaultForNewConnections?: boolean;
|
|
35
|
+
readonly profiles?: readonly ManagedServiceCredentialProfileInput[];
|
|
36
|
+
}
|
|
37
|
+
export interface ManagedServiceCredentialProfileConfig {
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly provider: string;
|
|
40
|
+
readonly instance: string;
|
|
41
|
+
readonly label: string;
|
|
42
|
+
readonly enabled: boolean;
|
|
43
|
+
readonly authType: string;
|
|
44
|
+
readonly secretRef: string;
|
|
45
|
+
readonly resources: Readonly<Record<string, readonly string[]>>;
|
|
46
|
+
readonly policy: Readonly<Record<string, "deny">>;
|
|
47
|
+
}
|
|
48
|
+
export interface ManagedServiceCredentialsConfig {
|
|
49
|
+
readonly enabled: boolean;
|
|
50
|
+
readonly defaultForNewConnections: boolean;
|
|
51
|
+
readonly profiles: readonly ManagedServiceCredentialProfileConfig[];
|
|
52
|
+
}
|
|
53
|
+
export declare const MANAGED_SERVICE_CREDENTIALS_DEFAULTS: Readonly<{
|
|
54
|
+
enabled: false;
|
|
55
|
+
defaultForNewConnections: true;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Config schema of this slice. Profile entries stay opaque here on purpose:
|
|
59
|
+
* `resolveManagedServiceCredentials` validates them in one place, where it can
|
|
60
|
+
* fail loudly with the profile id in the message instead of an anonymous
|
|
61
|
+
* schema error.
|
|
62
|
+
*/
|
|
63
|
+
export declare const managedServiceCredentialsSchema: z<ManagedServiceCredentialsInput>;
|
|
64
|
+
export declare function resolveManagedServiceCredentials(input?: ManagedServiceCredentialsInput): ManagedServiceCredentialsConfig;
|
|
65
|
+
/**
|
|
66
|
+
* Revision of everything about a profile that policy decisions depend on. A
|
|
67
|
+
* change here means every cache, cursor and pending action that was produced
|
|
68
|
+
* under the previous revision has to be treated as stale.
|
|
69
|
+
*/
|
|
70
|
+
export declare function profilePolicyRevision(profile: ManagedServiceCredentialProfileConfig): string;
|
|
71
|
+
/** Short content digest; used for revisions and never as a secret fingerprint. */
|
|
72
|
+
export declare function digest(value: string | Buffer): string;
|
|
73
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { IntegrationErrorCode } from "../errors.js";
|
|
2
|
+
import type { IntegrationCapability } from "../types.js";
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialProfile, ServiceResourceBoundary } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* The service ceiling: an operation reaches a managed credential only when it
|
|
6
|
+
* is a read, carries no more than normal sensitivity, and was classified as
|
|
7
|
+
* service-safe on purpose. Upstream permissions are never part of this test:
|
|
8
|
+
* a service token that happens to be able to trigger a build still cannot,
|
|
9
|
+
* because the operation is a write.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SERVICE_CEILING: OperationSecurityMetadata;
|
|
12
|
+
export type ServicePolicyDecision = {
|
|
13
|
+
readonly allowed: true;
|
|
14
|
+
} | {
|
|
15
|
+
readonly allowed: false;
|
|
16
|
+
readonly code: IntegrationErrorCode;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
};
|
|
19
|
+
export interface ServiceOperationQuery {
|
|
20
|
+
readonly metadata: OperationSecurityMetadata;
|
|
21
|
+
/** Capability the operation belongs to, when its provider declares one. */
|
|
22
|
+
readonly capability: IntegrationCapability | undefined;
|
|
23
|
+
readonly profile: ServiceCredentialProfile;
|
|
24
|
+
/** Resource kind the operation is scoped to, or undefined when it has none. */
|
|
25
|
+
readonly boundaryKind: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Decide one operation against the service ceiling and the administrator's
|
|
29
|
+
* narrowing of it. The order of the checks is the order of the guarantees: an
|
|
30
|
+
* operation is refused for being a write before it is refused for being
|
|
31
|
+
* sensitive, so a caller can never widen the ceiling by re-classifying an
|
|
32
|
+
* operation as sensitive.
|
|
33
|
+
*/
|
|
34
|
+
export declare function evaluateServiceOperation(query: ServiceOperationQuery): ServicePolicyDecision;
|
|
35
|
+
/** Exact membership of one identifier in one kind of a boundary. */
|
|
36
|
+
export declare function boundaryHas(boundary: ServiceResourceBoundary, kind: string, ref: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Narrow a profile boundary by a user's own selection. A user may only remove:
|
|
39
|
+
* anything not present in the profile boundary is dropped, so a forged
|
|
40
|
+
* selection that named a resource outside the administrator's list can never
|
|
41
|
+
* widen what the deployment allows.
|
|
42
|
+
*/
|
|
43
|
+
export declare function narrowBoundary(boundary: ServiceResourceBoundary, selection: ServiceResourceBoundary | undefined): ServiceResourceBoundary;
|
|
44
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ManagedServiceCredentialProfileConfig, type ManagedServiceCredentialsConfig } from "./config.js";
|
|
2
|
+
import type { ResolvedServiceCredential, ServiceCredentialProfile } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Deployment-owned service credentials. Profiles come from operator
|
|
5
|
+
* configuration, their secrets from a mounted file or the environment, and
|
|
6
|
+
* nothing here is reachable from a user: a user cannot create a profile, change
|
|
7
|
+
* a secret, move an upstream identity or choose a profile by id.
|
|
8
|
+
*
|
|
9
|
+
* Secrets are read lazily and cached by file stamp, so rotating a mounted
|
|
10
|
+
* secret takes effect on the next call without anyone reconnecting and without
|
|
11
|
+
* restarting the host.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ServiceCredentialRegistry {
|
|
14
|
+
private readonly profiles;
|
|
15
|
+
private readonly byPortal;
|
|
16
|
+
private readonly secrets;
|
|
17
|
+
private readonly env;
|
|
18
|
+
constructor(config: ManagedServiceCredentialsConfig, resolvePortal: (provider: string, instance: string) => string | undefined, options?: {
|
|
19
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
20
|
+
});
|
|
21
|
+
/** The profile a binding of this provider and portal resolves to, if any. */
|
|
22
|
+
find(provider: string, portal: string): ServiceCredentialProfile | undefined;
|
|
23
|
+
/** True when this provider/portal can offer service mode at all. */
|
|
24
|
+
available(provider: string, portal: string): boolean;
|
|
25
|
+
list(): readonly ServiceCredentialProfile[];
|
|
26
|
+
/**
|
|
27
|
+
* The secret of one profile plus the revision of its content. Throwing here
|
|
28
|
+
* is the fail-closed path: a profile whose secret is missing, empty or
|
|
29
|
+
* unreadable serves nothing, and the message names the reference, never the
|
|
30
|
+
* value.
|
|
31
|
+
*/
|
|
32
|
+
readSecret(profile: ServiceCredentialProfile): ResolvedServiceCredential;
|
|
33
|
+
/** Drop a cached secret; the next read re-reads it. Used by rotation tests. */
|
|
34
|
+
forget(profileId: string): void;
|
|
35
|
+
private load;
|
|
36
|
+
private loadEnv;
|
|
37
|
+
private loadFile;
|
|
38
|
+
}
|
|
39
|
+
/** Profiles are matched by provider and portal, never by a caller-chosen id. */
|
|
40
|
+
export declare function portalKey(provider: string, portal: string): string;
|
|
41
|
+
/** Config-shape of one profile, re-exported for the config composition root. */
|
|
42
|
+
export type { ManagedServiceCredentialProfileConfig };
|
|
43
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "./types.js";
|
|
2
|
+
import type { CapabilityServiceState } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* How one capability of a provider behaves under the managed credential,
|
|
5
|
+
* derived from the classifications of the operations that make it up. A
|
|
6
|
+
* capability with no classified operation — or one whose provider never listed
|
|
7
|
+
* it — is reported as unavailable, so a client never shows a switch that would
|
|
8
|
+
* do nothing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function operationCapabilityServiceState(operations: Readonly<Record<string, {
|
|
11
|
+
readonly capability: string;
|
|
12
|
+
readonly security: OperationSecurityMetadata;
|
|
13
|
+
}>>, capability: string): CapabilityServiceState;
|
|
14
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { IntegrationProviderId, IntegrationServiceBoundary, ServiceCredentialHealth, ServiceCredentialStatus, SafeExternalIdentity } from "../types.js";
|
|
2
|
+
export type { ServiceCredentialHealth, ServiceCredentialStatus, SafeExternalIdentity, };
|
|
3
|
+
/**
|
|
4
|
+
* Which credential a binding spends on an upstream call. The mode is explicit
|
|
5
|
+
* and exhaustive: there is no `auto`, no `default` and no fallback, because a
|
|
6
|
+
* silent substitution between two upstream identities is exactly the failure
|
|
7
|
+
* this feature exists to prevent.
|
|
8
|
+
*/
|
|
9
|
+
export type CredentialSource = "personal" | "service";
|
|
10
|
+
export declare const CREDENTIAL_SOURCES: readonly CredentialSource[];
|
|
11
|
+
export declare function isCredentialSource(value: unknown): value is CredentialSource;
|
|
12
|
+
/** What an operation does upstream; only `read` can ever be service-reachable. */
|
|
13
|
+
export type OperationEffect = "read" | "write" | "admin";
|
|
14
|
+
/** How much an answer may reveal; sensitive and secret answers stay personal. */
|
|
15
|
+
export type DataSensitivity = "normal" | "sensitive" | "secret";
|
|
16
|
+
/** Whether the deployment's managed credential may reach one operation. */
|
|
17
|
+
export type OperationServiceDecision = "allow" | "deny";
|
|
18
|
+
/**
|
|
19
|
+
* Security classification of one provider operation. The three fields are
|
|
20
|
+
* independent on purpose: a read can still be sensitive (CI job logs), and a
|
|
21
|
+
* normal-sensitivity read can still be outside the service ceiling.
|
|
22
|
+
*/
|
|
23
|
+
export interface OperationSecurityMetadata {
|
|
24
|
+
readonly effect: OperationEffect;
|
|
25
|
+
readonly sensitivity: DataSensitivity;
|
|
26
|
+
readonly serviceCredential: OperationServiceDecision;
|
|
27
|
+
/**
|
|
28
|
+
* Set when the operation either names a resource or reads a collection of
|
|
29
|
+
* them: in service mode the call must then stay inside the profile's
|
|
30
|
+
* administrator-defined resource boundary.
|
|
31
|
+
*/
|
|
32
|
+
readonly requiresResourceBoundary?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Classification of an operation its provider does not classify. Deliberately
|
|
36
|
+
* the most restrictive values in every field, so an operation added by a
|
|
37
|
+
* provider update is unreachable through the managed credential until someone
|
|
38
|
+
* classifies it on purpose. This is a release-blocking invariant.
|
|
39
|
+
*/
|
|
40
|
+
export declare const UNCLASSIFIED_OPERATION: OperationSecurityMetadata;
|
|
41
|
+
/**
|
|
42
|
+
* Resources a managed credential may see. One type, declared with the public
|
|
43
|
+
* contract because it crosses the remote boundary as well.
|
|
44
|
+
*/
|
|
45
|
+
export type ServiceResourceBoundary = IntegrationServiceBoundary;
|
|
46
|
+
/**
|
|
47
|
+
* One administrator-managed credential. It belongs to the deployment, not to a
|
|
48
|
+
* user: a user cannot create one, cannot change its secret, cannot move its
|
|
49
|
+
* upstream identity and cannot pick one by id.
|
|
50
|
+
*/
|
|
51
|
+
export interface ServiceCredentialProfile {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly provider: IntegrationProviderId;
|
|
54
|
+
/** Operator-facing instance id of the provider slice this profile binds to. */
|
|
55
|
+
readonly instance: string;
|
|
56
|
+
/** Portal the bound instance answers on; the value a binding is matched by. */
|
|
57
|
+
readonly portal: string;
|
|
58
|
+
/** Safe alias shown to users; never the secret and never its prefix. */
|
|
59
|
+
readonly label: string;
|
|
60
|
+
readonly authType: string;
|
|
61
|
+
/** Where the secret is read from, as `file:<path>` or `env:<NAME>`. */
|
|
62
|
+
readonly secretRef: string;
|
|
63
|
+
/** Set to false to retire a profile without deleting its configuration. */
|
|
64
|
+
readonly enabled: boolean;
|
|
65
|
+
readonly resources: ServiceResourceBoundary;
|
|
66
|
+
/** Administrator narrowing of the service ceiling; only ever removes. */
|
|
67
|
+
readonly policy: Readonly<Record<string, "deny">>;
|
|
68
|
+
/** Hash of the policy-relevant configuration of this profile. */
|
|
69
|
+
readonly policyRevision: string;
|
|
70
|
+
}
|
|
71
|
+
/** A profile plus the secret an upstream call needs, produced inside the broker. */
|
|
72
|
+
export interface ResolvedServiceCredential {
|
|
73
|
+
readonly profile: ServiceCredentialProfile;
|
|
74
|
+
readonly secret: string;
|
|
75
|
+
/** Content hash of the secret: rotation changes it without reconnecting. */
|
|
76
|
+
readonly credentialRevision: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* What the broker hands a provider after it has resolved and checked the
|
|
80
|
+
* binding. Provider tool arguments do not change, and the model never receives
|
|
81
|
+
* any of these identifiers.
|
|
82
|
+
*/
|
|
83
|
+
export interface ResolvedCredentialContext {
|
|
84
|
+
readonly source: CredentialSource;
|
|
85
|
+
readonly credentialRevision: string;
|
|
86
|
+
readonly personal?: {
|
|
87
|
+
readonly accountId: string;
|
|
88
|
+
readonly externalIdentityId: string;
|
|
89
|
+
};
|
|
90
|
+
readonly service?: {
|
|
91
|
+
readonly profileId: string;
|
|
92
|
+
readonly externalIdentityId: string;
|
|
93
|
+
readonly policyRevision: string;
|
|
94
|
+
readonly resourceBoundary: ServiceResourceBoundary;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|