@blogic-cz/agent-tools 0.18.1 → 1.0.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 +23 -6
- package/dist/az-tool/config.d.ts +60 -12
- package/dist/az-tool/config.d.ts.map +1 -1
- package/dist/az-tool/errors.d.ts +10 -1
- package/dist/az-tool/errors.d.ts.map +1 -1
- package/dist/az-tool/profile.d.ts +16 -0
- package/dist/az-tool/profile.d.ts.map +1 -0
- package/dist/az-tool/security.d.ts +20 -3
- package/dist/az-tool/security.d.ts.map +1 -1
- package/dist/az-tool/service.d.ts +9 -4
- package/dist/az-tool/service.d.ts.map +1 -1
- package/dist/az-tool/types.d.ts +10 -60
- package/dist/az-tool/types.d.ts.map +1 -1
- package/dist/{az-tool → azdo-tool}/build.d.ts +9 -9
- package/dist/azdo-tool/build.d.ts.map +1 -0
- package/dist/azdo-tool/config.d.ts +13 -0
- package/dist/azdo-tool/config.d.ts.map +1 -0
- package/dist/azdo-tool/errors.d.ts +43 -0
- package/dist/azdo-tool/errors.d.ts.map +1 -0
- package/dist/azdo-tool/extract-option-value.d.ts.map +1 -0
- package/dist/azdo-tool/index.d.ts +3 -0
- package/dist/azdo-tool/index.d.ts.map +1 -0
- package/dist/azdo-tool/security.d.ts +4 -0
- package/dist/azdo-tool/security.d.ts.map +1 -0
- package/dist/azdo-tool/service.d.ts +15 -0
- package/dist/azdo-tool/service.d.ts.map +1 -0
- package/dist/azdo-tool/transformers.d.ts.map +1 -0
- package/dist/azdo-tool/types.d.ts +64 -0
- package/dist/azdo-tool/types.d.ts.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/types.d.ts +18 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/credential-guard/index.d.ts.map +1 -1
- package/dist/shared/azure-credentials.d.ts +20 -0
- package/dist/shared/azure-credentials.d.ts.map +1 -0
- package/dist/shared/binary-preflight.d.ts +1 -1
- package/package.json +8 -2
- package/schemas/agent-tools.schema.json +42 -1
- package/src/az-tool/config.ts +135 -25
- package/src/az-tool/errors.ts +14 -1
- package/src/az-tool/index.ts +67 -134
- package/src/az-tool/profile.ts +48 -0
- package/src/az-tool/security.ts +248 -89
- package/src/az-tool/service.ts +137 -242
- package/src/az-tool/types.ts +11 -64
- package/src/{az-tool → azdo-tool}/build.ts +11 -11
- package/src/azdo-tool/config.ts +33 -0
- package/src/azdo-tool/errors.ts +41 -0
- package/src/azdo-tool/index.ts +222 -0
- package/src/azdo-tool/security.ts +157 -0
- package/src/azdo-tool/service.ts +322 -0
- package/src/azdo-tool/types.ts +67 -0
- package/src/config/index.ts +1 -0
- package/src/config/loader.ts +10 -1
- package/src/config/types.ts +19 -1
- package/src/credential-guard/index.ts +7 -2
- package/src/shared/azure-credentials.ts +50 -0
- package/src/shared/binary-preflight.ts +1 -1
- package/dist/az-tool/build.d.ts.map +0 -1
- package/dist/az-tool/extract-option-value.d.ts.map +0 -1
- package/dist/az-tool/transformers.d.ts.map +0 -1
- /package/dist/{az-tool → azdo-tool}/extract-option-value.d.ts +0 -0
- /package/dist/{az-tool → azdo-tool}/transformers.d.ts +0 -0
- /package/src/{az-tool → azdo-tool}/extract-option-value.ts +0 -0
- /package/src/{az-tool → azdo-tool}/transformers.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/azdo-tool/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,E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E,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AgentToolsConfig, AzureConfig, K8sConfig, DbEnvConfig, DbAllowedMutationTargets, DbMutationOperation, DatabaseConfig, ObservabilityConfig, ObservabilityEnvTarget, LogsConfig, AuditConfig, CliToolOverride, CredentialGuardConfig, GitHubPrTitlePolicy, GitHubRepoConfig, } from "./types";
|
|
1
|
+
export type { AgentToolsConfig, AzureConfig, AzurePlatformConfig, K8sConfig, DbEnvConfig, DbAllowedMutationTargets, DbMutationOperation, DatabaseConfig, ObservabilityConfig, ObservabilityEnvTarget, LogsConfig, AuditConfig, CliToolOverride, CredentialGuardConfig, GitHubPrTitlePolicy, GitHubRepoConfig, } from "./types";
|
|
2
2
|
export { DbMutationOperationSchema } from "./types";
|
|
3
3
|
export { ConfigService, ConfigServiceLayer, getToolConfig, getDefaultEnvironment, getGitHubConfig, resolveGitHubRepoTarget, loadConfig, } from "./loader";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,WAAW,EACX,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,UAAU,GACX,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,UAAU,GACX,MAAM,UAAU,CAAC"}
|
package/dist/config/loader.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare class ConfigLoadError extends ConfigLoadError_base<{
|
|
|
13
13
|
}> {
|
|
14
14
|
}
|
|
15
15
|
export declare const ConfigServiceLayer: Layer.Layer<ConfigService, ConfigLoadError, never>;
|
|
16
|
-
type ProfiledSection = keyof Pick<AgentToolsConfig, "azure" | "kubernetes" | "database" | "observability" | "logs">;
|
|
16
|
+
type ProfiledSection = keyof Pick<AgentToolsConfig, "azure" | "azurePlatform" | "kubernetes" | "database" | "observability" | "logs">;
|
|
17
17
|
export declare function getToolConfig<T>(config: AgentToolsConfig | undefined, section: ProfiledSection, profile?: string): T | undefined;
|
|
18
18
|
export declare function getDefaultEnvironment(config: AgentToolsConfig | undefined): string | undefined;
|
|
19
19
|
export declare function getGitHubConfig(config: AgentToolsConfig | undefined, profile?: string): GitHubRepoConfig | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAgB,KAAK,EAAU,MAAM,QAAQ,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAgB,KAAK,EAAU,MAAM,QAAQ,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsOlE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,EACf,UAAU,GAAE,MAA4B,GACvC,gBAAgB,CAmClB;AAmFD,wBAAsB,UAAU,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAcxE;;AAED,qBAAa,aAAc,SAAQ,kBAElC;CAAG;;;;AAEJ,qBAAa,eAAgB,SAAQ,qBAAoC;IACvE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;CAAG;AAEL,eAAO,MAAM,kBAAkB,oDAM9B,CAAC;AAEF,KAAK,eAAe,GAAG,MAAM,IAAI,CAC/B,gBAAgB,EAChB,OAAO,GAAG,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,GAAG,MAAM,CACjF,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAC7B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,OAAO,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,MAAM,GACf,CAAC,GAAG,SAAS,CAkCf;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE9F;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,OAAO,CAAC,EAAE,MAAM,GACf,gBAAgB,GAAG,SAAS,CAc9B;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,MAAM,GAAG,SAAS,CAqBpB"}
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
/** Azure DevOps profile
|
|
2
|
+
/** Azure DevOps profile, consumed by azdo-tool. */
|
|
3
3
|
export type AzureConfig = {
|
|
4
4
|
organization: string;
|
|
5
5
|
defaultProject: string;
|
|
6
6
|
timeoutMs?: number;
|
|
7
7
|
};
|
|
8
|
+
/** Azure platform (PaaS) profile, consumed by az-tool. */
|
|
9
|
+
export type AzurePlatformConfig = {
|
|
10
|
+
subscription: string;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Require --profile to be passed explicitly before this subscription is
|
|
14
|
+
* touched. Defaults to true for profiles keyed "prod" or "production".
|
|
15
|
+
*/
|
|
16
|
+
production?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Resource groups this profile may address. Empty or absent means every
|
|
19
|
+
* resource group in the subscription is allowed.
|
|
20
|
+
*/
|
|
21
|
+
allowedResourceGroups?: string[];
|
|
22
|
+
};
|
|
8
23
|
export type CleanupPolicy = "leave-running" | "stop-if-started";
|
|
9
24
|
export type VpnPrerequisite = {
|
|
10
25
|
type: "vpn";
|
|
@@ -181,6 +196,8 @@ export type AgentToolsConfig = {
|
|
|
181
196
|
$schema?: string;
|
|
182
197
|
/** Named Azure DevOps profiles. e.g. { default: { organization: "...", defaultProject: "..." } } */
|
|
183
198
|
azure?: Record<string, AzureConfig>;
|
|
199
|
+
/** Named Azure platform profiles. e.g. { default: { subscription: "..." } } */
|
|
200
|
+
azurePlatform?: Record<string, AzurePlatformConfig>;
|
|
184
201
|
/** Named VPN definitions referenced by profile prerequisites. */
|
|
185
202
|
vpns?: Record<string, VpnConfig>;
|
|
186
203
|
/** Named Kubernetes cluster profiles. e.g. { default: {...}, staging: {...} } */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC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+
*
|
|
4
|
+
* Shared because two tools reach the Azure CLI: az-tool for the platform, and
|
|
5
|
+
* azdo-tool for the `acr`/`account` groups it still passes through for
|
|
6
|
+
* backwards compatibility. Both must refuse the same commands — a term added
|
|
7
|
+
* to one list and not the other reopens a credential read through whichever
|
|
8
|
+
* tool was missed.
|
|
9
|
+
*/
|
|
10
|
+
/** Read-shaped verbs that return credential material, in any command group. */
|
|
11
|
+
export declare const CREDENTIAL_BLOCKED_VERBS: readonly ["get-access-token", "get-credentials", "get-secrets", "list-account-keys", "list-connection-strings", "list-keys", "list-publishing-credentials", "list-publishing-profiles", "list-secrets", "show-connection-string", "show-secret"];
|
|
12
|
+
/**
|
|
13
|
+
* Command group segments that carry credential material. For these the listing
|
|
14
|
+
* itself returns values — `az storage account keys list` and
|
|
15
|
+
* `az webapp config appsettings list` both print secrets.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CREDENTIAL_BLOCKED_SEGMENTS: readonly ["admin-key", "appsettings", "connection-string", "credential", "credentials", "key", "keys", "password", "query-key", "sas", "secret", "secrets"];
|
|
18
|
+
export declare const isCredentialBlockedVerb: (word: string) => boolean;
|
|
19
|
+
export declare const isCredentialBlockedSegment: (word: string) => boolean;
|
|
20
|
+
//# sourceMappingURL=azure-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-credentials.d.ts","sourceRoot":"","sources":["../../src/shared/azure-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,kPAY3B,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,6JAa9B,CAAC;AAEX,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,OACS,CAAC;AAEjE,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,KAAG,OACS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const REQUIRED_BINARIES: {
|
|
2
2
|
readonly az: {
|
|
3
|
-
readonly tools: "az-tool";
|
|
3
|
+
readonly tools: "az-tool and azdo-tool";
|
|
4
4
|
readonly install: "Install it with `brew install azure-cli` (macOS) or see https://learn.microsoft.com/cli/azure/install-azure-cli.";
|
|
5
5
|
};
|
|
6
6
|
readonly gh: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogic-cz/agent-tools",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure DevOps, logs, sessions, and audit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure platform, Azure DevOps, logs, sessions, and audit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
7
7
|
"ai",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"bin": {
|
|
23
23
|
"agent-tools-audit": "./src/audit-tool/index.ts",
|
|
24
24
|
"agent-tools-az": "./src/az-tool/index.ts",
|
|
25
|
+
"agent-tools-azdo": "./src/azdo-tool/index.ts",
|
|
25
26
|
"agent-tools-db": "./src/db-tool/index.ts",
|
|
26
27
|
"agent-tools-gh": "./src/gh-tool/index.ts",
|
|
27
28
|
"agent-tools-k8s": "./src/k8s-tool/index.ts",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"agent-tools-session": "./src/session-tool/index.ts",
|
|
31
32
|
"audit-tool": "./src/audit-tool/index.ts",
|
|
32
33
|
"az-tool": "./src/az-tool/index.ts",
|
|
34
|
+
"azdo-tool": "./src/azdo-tool/index.ts",
|
|
33
35
|
"db-tool": "./src/db-tool/index.ts",
|
|
34
36
|
"gh-tool": "./src/gh-tool/index.ts",
|
|
35
37
|
"k8s-tool": "./src/k8s-tool/index.ts",
|
|
@@ -87,6 +89,10 @@
|
|
|
87
89
|
"types": "./dist/az-tool/*.d.ts",
|
|
88
90
|
"default": "./src/az-tool/*.ts"
|
|
89
91
|
},
|
|
92
|
+
"#azdo/*": {
|
|
93
|
+
"types": "./dist/azdo-tool/*.d.ts",
|
|
94
|
+
"default": "./src/azdo-tool/*.ts"
|
|
95
|
+
},
|
|
90
96
|
"#guard": {
|
|
91
97
|
"types": "./dist/credential-guard/index.d.ts",
|
|
92
98
|
"default": "./src/credential-guard/index.ts"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://raw.githubusercontent.com/blogic-cz/agent-tools/main/schemas/agent-tools.schema.json",
|
|
4
4
|
"title": "Agent Tools Configuration",
|
|
5
|
-
"description": "Root configuration for the agent-tools package. Tool-specific sections (azure, kubernetes, database, observability, logs) are maps of named profiles keyed by profile name. Tools choose a profile via --profile <name> (default key is 'default', single-entry maps can be auto-selected). session, audit, and credentialGuard are global sections.",
|
|
5
|
+
"description": "Root configuration for the agent-tools package. Tool-specific sections (azure, azurePlatform, kubernetes, database, observability, logs) are maps of named profiles keyed by profile name. Tools choose a profile via --profile <name> (default key is 'default', single-entry maps can be auto-selected). session, audit, and credentialGuard are global sections.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": true,
|
|
8
8
|
"properties": {
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
"$ref": "#/definitions/AzureConfig"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
+
"azurePlatform": {
|
|
22
|
+
"description": "Named Azure platform (PaaS) profiles as Record<string, AzurePlatformConfig>.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": {
|
|
25
|
+
"description": "Azure platform profile pinning az-tool to one subscription.",
|
|
26
|
+
"$ref": "#/definitions/AzurePlatformConfig"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
21
29
|
"kubernetes": {
|
|
22
30
|
"description": "Named Kubernetes cluster profiles as Record<string, K8sConfig>.",
|
|
23
31
|
"type": "object",
|
|
@@ -141,6 +149,33 @@
|
|
|
141
149
|
},
|
|
142
150
|
"required": ["organization", "defaultProject"]
|
|
143
151
|
},
|
|
152
|
+
"AzurePlatformConfig": {
|
|
153
|
+
"description": "Azure platform (PaaS) profile configuration. Pins every az-tool command to one subscription.",
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"properties": {
|
|
157
|
+
"subscription": {
|
|
158
|
+
"description": "Azure subscription ID or name appended to every command as --subscription.",
|
|
159
|
+
"type": "string"
|
|
160
|
+
},
|
|
161
|
+
"timeoutMs": {
|
|
162
|
+
"description": "Optional command timeout in milliseconds.",
|
|
163
|
+
"type": "number"
|
|
164
|
+
},
|
|
165
|
+
"production": {
|
|
166
|
+
"description": "Require --profile to be passed explicitly before this subscription is touched. Defaults to true for profiles keyed 'prod' or 'production'.",
|
|
167
|
+
"type": "boolean"
|
|
168
|
+
},
|
|
169
|
+
"allowedResourceGroups": {
|
|
170
|
+
"description": "Resource groups this profile may address via -g/--resource-group. Empty or absent allows every resource group in the subscription.",
|
|
171
|
+
"type": "array",
|
|
172
|
+
"items": {
|
|
173
|
+
"type": "string"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"required": ["subscription"]
|
|
178
|
+
},
|
|
144
179
|
"K8sConfig": {
|
|
145
180
|
"description": "Kubernetes cluster profile configuration.",
|
|
146
181
|
"type": "object",
|
|
@@ -651,6 +686,12 @@
|
|
|
651
686
|
"timeoutMs": 60000
|
|
652
687
|
}
|
|
653
688
|
},
|
|
689
|
+
"azurePlatform": {
|
|
690
|
+
"default": {
|
|
691
|
+
"subscription": "00000000-0000-0000-0000-000000000000",
|
|
692
|
+
"timeoutMs": 60000
|
|
693
|
+
}
|
|
694
|
+
},
|
|
654
695
|
"kubernetes": {
|
|
655
696
|
"default": {
|
|
656
697
|
"clusterId": "398bf1ad-788c-40f5-a7e0-88366648d9d9",
|
package/src/az-tool/config.ts
CHANGED
|
@@ -1,33 +1,143 @@
|
|
|
1
|
-
|
|
1
|
+
/** Command groups owned by azdo-tool. Routed there with a hint instead of being run here. */
|
|
2
|
+
export const AZURE_DEVOPS_GROUPS = ["devops", "pipelines", "repos", "boards", "artifacts"] as const;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
/** Verbs that only read state, matched exactly against the command verb. */
|
|
5
|
+
export const READ_ONLY_VERBS = [
|
|
6
|
+
"list",
|
|
7
|
+
"show",
|
|
8
|
+
"describe",
|
|
9
|
+
"exists",
|
|
10
|
+
"search",
|
|
11
|
+
"history",
|
|
12
|
+
"version",
|
|
13
|
+
"validate",
|
|
14
|
+
"wait",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
/** Verb families that only read state, matched as a prefix of the command verb. */
|
|
18
|
+
export const READ_ONLY_VERB_PREFIXES = ["list-", "show-", "check-", "get-"] as const;
|
|
4
19
|
|
|
5
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Mutating verbs. Unknown verbs are rejected anyway; this list exists so the
|
|
22
|
+
* common cases get "'delete' is a mutating operation" instead of "unknown verb".
|
|
23
|
+
*/
|
|
24
|
+
export const BLOCKED_VERBS = [
|
|
25
|
+
"add",
|
|
26
|
+
"apply",
|
|
27
|
+
"approve",
|
|
28
|
+
"assign",
|
|
29
|
+
"attach",
|
|
30
|
+
"browse",
|
|
31
|
+
"cancel",
|
|
32
|
+
"clear",
|
|
33
|
+
"connect",
|
|
34
|
+
"create",
|
|
35
|
+
"delete",
|
|
36
|
+
"deploy",
|
|
37
|
+
"destroy",
|
|
38
|
+
"detach",
|
|
39
|
+
"disable",
|
|
40
|
+
"down",
|
|
41
|
+
"download",
|
|
42
|
+
"enable",
|
|
43
|
+
"execute",
|
|
44
|
+
"failover",
|
|
45
|
+
"generate",
|
|
46
|
+
"grant",
|
|
47
|
+
"import",
|
|
48
|
+
"init",
|
|
49
|
+
"install",
|
|
50
|
+
"invoke",
|
|
51
|
+
"login",
|
|
52
|
+
"logout",
|
|
53
|
+
"move",
|
|
54
|
+
"patch",
|
|
55
|
+
"publish",
|
|
56
|
+
"prune",
|
|
57
|
+
"purge",
|
|
58
|
+
"regenerate",
|
|
59
|
+
"reject",
|
|
60
|
+
"remove",
|
|
61
|
+
"renew",
|
|
62
|
+
"repair",
|
|
63
|
+
"replace",
|
|
64
|
+
"reset",
|
|
65
|
+
"restart",
|
|
66
|
+
"restore",
|
|
67
|
+
"revoke",
|
|
68
|
+
"rotate",
|
|
69
|
+
"run",
|
|
70
|
+
"scale",
|
|
71
|
+
"set",
|
|
72
|
+
"ssh",
|
|
73
|
+
"start",
|
|
74
|
+
"stop",
|
|
75
|
+
"swap",
|
|
76
|
+
"sync",
|
|
77
|
+
"tunnel",
|
|
78
|
+
"unassign",
|
|
79
|
+
"uninstall",
|
|
80
|
+
"untag",
|
|
81
|
+
"up",
|
|
82
|
+
"update",
|
|
83
|
+
"upgrade",
|
|
84
|
+
"upload",
|
|
85
|
+
] as const;
|
|
6
86
|
|
|
7
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Credential-bearing verbs and group segments live in `#shared` because
|
|
89
|
+
* azdo-tool's `acr`/`account` passthrough must refuse exactly the same
|
|
90
|
+
* commands. Re-exported here so this file stays the single place az-tool's
|
|
91
|
+
* security config is read from.
|
|
92
|
+
*
|
|
93
|
+
* Segment matching keeps neighbouring groups reachable: `keyvault list` works
|
|
94
|
+
* because the blocked segment is `secret`, not `keyvault`. Key Vault gets a
|
|
95
|
+
* further carve-out below.
|
|
96
|
+
*/
|
|
97
|
+
export { CREDENTIAL_BLOCKED_SEGMENTS, CREDENTIAL_BLOCKED_VERBS } from "#shared/azure-credentials";
|
|
8
98
|
|
|
9
|
-
|
|
99
|
+
/** The Key Vault command group, which needs finer treatment than segment matching. */
|
|
100
|
+
export const KEYVAULT_GROUP = "keyvault";
|
|
10
101
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Key Vault subgroups that expose public material only — a key's public JWK, a
|
|
104
|
+
* certificate's public half. The private halves live under `secret`, which
|
|
105
|
+
* stays gated. Without this, segment matching on `key` would block the whole
|
|
106
|
+
* `az keyvault key` surface for no gain.
|
|
107
|
+
*/
|
|
108
|
+
export const KEYVAULT_PUBLIC_SUBGROUPS = ["key", "certificate"] as const;
|
|
14
109
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Key Vault subgroups where listing is metadata-only but `show` returns the
|
|
112
|
+
* value. `az keyvault secret list` yields ids, attributes, and tags — no
|
|
113
|
+
* secret material — so the list family is allowed and `show` is not.
|
|
114
|
+
*/
|
|
115
|
+
export const KEYVAULT_NAME_ONLY_SUBGROUPS = ["secret", "secrets"] as const;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Flags controlled by the selected profile. A user override would defeat the
|
|
119
|
+
* configured subscription pin, so they are rejected rather than forwarded.
|
|
120
|
+
*/
|
|
121
|
+
export const CONTROLLED_FLAGS = ["--subscription"] as const;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Alternate addressing modes rejected outright. `--ids` takes a full ARM
|
|
125
|
+
* resource ID that carries its own subscription and resource group, so it
|
|
126
|
+
* side-steps both the subscription pin and the resource group allowlist.
|
|
127
|
+
* `-g` plus `--name` expresses the same target inside the guarded scope.
|
|
128
|
+
*/
|
|
129
|
+
export const REJECTED_ADDRESSING_FLAGS = ["--ids"] as const;
|
|
130
|
+
|
|
131
|
+
/** Flags naming the resource group a command addresses. */
|
|
132
|
+
export const RESOURCE_GROUP_FLAGS = ["-g", "--resource-group"] as const;
|
|
25
133
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
134
|
+
/**
|
|
135
|
+
* The resource group segment of an ARM resource ID. Flags such as `--scope`
|
|
136
|
+
* and `--resource` take a full ID, naming a resource group without ever using
|
|
137
|
+
* -g, so IDs are mined for group names too.
|
|
138
|
+
*/
|
|
139
|
+
export const RESOURCE_GROUP_IN_ID_PATTERN = /\/resourceGroups\/([^/\s]+)/gi;
|
|
29
140
|
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type BlockedInvokeArea = (typeof BLOCKED_INVOKE_AREAS)[number];
|
|
141
|
+
export type ReadOnlyVerb = (typeof READ_ONLY_VERBS)[number];
|
|
142
|
+
export type BlockedVerb = (typeof BLOCKED_VERBS)[number];
|
|
143
|
+
export type AzureDevOpsGroup = (typeof AZURE_DEVOPS_GROUPS)[number];
|
package/src/az-tool/errors.ts
CHANGED
|
@@ -27,6 +27,14 @@ export class AzTimeoutError extends Schema.TaggedError<AzTimeoutError>()("AzTime
|
|
|
27
27
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
28
28
|
}) {}
|
|
29
29
|
|
|
30
|
+
export class AzProfileError extends Schema.TaggedError<AzProfileError>()("AzProfileError", {
|
|
31
|
+
message: Schema.String,
|
|
32
|
+
profile: Schema.String,
|
|
33
|
+
hint: Schema.optionalKey(Schema.String),
|
|
34
|
+
nextCommand: Schema.optionalKey(Schema.String),
|
|
35
|
+
retryable: Schema.optionalKey(Schema.Boolean),
|
|
36
|
+
}) {}
|
|
37
|
+
|
|
30
38
|
export class AzParseError extends Schema.TaggedError<AzParseError>()("AzParseError", {
|
|
31
39
|
message: Schema.String,
|
|
32
40
|
rawOutput: Schema.String,
|
|
@@ -35,4 +43,9 @@ export class AzParseError extends Schema.TaggedError<AzParseError>()("AzParseErr
|
|
|
35
43
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
36
44
|
}) {}
|
|
37
45
|
|
|
38
|
-
export type AzError =
|
|
46
|
+
export type AzError =
|
|
47
|
+
| AzSecurityError
|
|
48
|
+
| AzCommandError
|
|
49
|
+
| AzTimeoutError
|
|
50
|
+
| AzParseError
|
|
51
|
+
| AzProfileError;
|