arc-1 0.6.9 → 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 +12 -9
- package/bin/arc1-cli.js +10 -0
- package/bin/arc1.js +1 -1
- package/dist/adt/abapgit.d.ts +39 -0
- package/dist/adt/abapgit.d.ts.map +1 -0
- package/dist/adt/abapgit.js +333 -0
- package/dist/adt/abapgit.js.map +1 -0
- package/dist/adt/cds-impact.d.ts +35 -0
- package/dist/adt/cds-impact.d.ts.map +1 -1
- package/dist/adt/cds-impact.js +71 -0
- package/dist/adt/cds-impact.js.map +1 -1
- package/dist/adt/client.d.ts +4 -1
- package/dist/adt/client.d.ts.map +1 -1
- package/dist/adt/client.js +18 -5
- package/dist/adt/client.js.map +1 -1
- package/dist/adt/config.d.ts +1 -0
- package/dist/adt/config.d.ts.map +1 -1
- package/dist/adt/config.js +1 -0
- package/dist/adt/config.js.map +1 -1
- package/dist/adt/crud.d.ts.map +1 -1
- package/dist/adt/crud.js +74 -8
- package/dist/adt/crud.js.map +1 -1
- package/dist/adt/devtools.d.ts +39 -3
- package/dist/adt/devtools.d.ts.map +1 -1
- package/dist/adt/devtools.js +237 -25
- package/dist/adt/devtools.js.map +1 -1
- package/dist/adt/diagnostics.d.ts +69 -7
- package/dist/adt/diagnostics.d.ts.map +1 -1
- package/dist/adt/diagnostics.js +694 -36
- package/dist/adt/diagnostics.js.map +1 -1
- package/dist/adt/errors.d.ts +36 -2
- package/dist/adt/errors.d.ts.map +1 -1
- package/dist/adt/errors.js +111 -11
- package/dist/adt/errors.js.map +1 -1
- package/dist/adt/features.d.ts.map +1 -1
- package/dist/adt/features.js +3 -0
- package/dist/adt/features.js.map +1 -1
- package/dist/adt/gcts.d.ts +68 -0
- package/dist/adt/gcts.d.ts.map +1 -0
- package/dist/adt/gcts.js +239 -0
- package/dist/adt/gcts.js.map +1 -0
- package/dist/adt/http.d.ts.map +1 -1
- package/dist/adt/http.js +86 -1
- package/dist/adt/http.js.map +1 -1
- package/dist/adt/rap-handlers.d.ts +165 -0
- package/dist/adt/rap-handlers.d.ts.map +1 -0
- package/dist/adt/rap-handlers.js +835 -0
- package/dist/adt/rap-handlers.js.map +1 -0
- package/dist/adt/rap-preflight.d.ts +43 -0
- package/dist/adt/rap-preflight.d.ts.map +1 -0
- package/dist/adt/rap-preflight.js +405 -0
- package/dist/adt/rap-preflight.js.map +1 -0
- package/dist/adt/safety.d.ts +60 -33
- package/dist/adt/safety.d.ts.map +1 -1
- package/dist/adt/safety.js +204 -113
- package/dist/adt/safety.js.map +1 -1
- package/dist/adt/transport.d.ts +1 -1
- package/dist/adt/transport.d.ts.map +1 -1
- package/dist/adt/transport.js +6 -3
- package/dist/adt/transport.js.map +1 -1
- package/dist/adt/types.d.ts +225 -0
- package/dist/adt/types.d.ts.map +1 -1
- package/dist/adt/xml-parser.d.ts +15 -1
- package/dist/adt/xml-parser.d.ts.map +1 -1
- package/dist/adt/xml-parser.js +28 -15
- package/dist/adt/xml-parser.js.map +1 -1
- package/dist/authz/policy.d.ts +53 -0
- package/dist/authz/policy.d.ts.map +1 -0
- package/dist/authz/policy.js +199 -0
- package/dist/authz/policy.js.map +1 -0
- package/dist/cli-args.d.ts +14 -0
- package/dist/cli-args.d.ts.map +1 -0
- package/dist/cli-args.js +62 -0
- package/dist/cli-args.js.map +1 -0
- package/dist/cli.d.ts +13 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +252 -55
- package/dist/cli.js.map +1 -1
- package/dist/extract-sap-cookies.d.ts +24 -0
- package/dist/extract-sap-cookies.d.ts.map +1 -0
- package/dist/extract-sap-cookies.js +317 -0
- package/dist/extract-sap-cookies.js.map +1 -0
- package/dist/handlers/hyperfocused.d.ts +4 -3
- package/dist/handlers/hyperfocused.d.ts.map +1 -1
- package/dist/handlers/hyperfocused.js +25 -16
- package/dist/handlers/hyperfocused.js.map +1 -1
- package/dist/handlers/intent.d.ts +4 -12
- package/dist/handlers/intent.d.ts.map +1 -1
- package/dist/handlers/intent.js +1448 -89
- package/dist/handlers/intent.js.map +1 -1
- package/dist/handlers/schemas.d.ts +83 -11
- package/dist/handlers/schemas.d.ts.map +1 -1
- package/dist/handlers/schemas.js +115 -4
- package/dist/handlers/schemas.js.map +1 -1
- package/dist/handlers/tools.d.ts +4 -3
- package/dist/handlers/tools.d.ts.map +1 -1
- package/dist/handlers/tools.js +342 -143
- package/dist/handlers/tools.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/probe/catalog.d.ts +30 -0
- package/dist/probe/catalog.d.ts.map +1 -0
- package/dist/probe/catalog.js +196 -0
- package/dist/probe/catalog.js.map +1 -0
- package/dist/probe/fixtures.d.ts +54 -0
- package/dist/probe/fixtures.d.ts.map +1 -0
- package/dist/probe/fixtures.js +94 -0
- package/dist/probe/fixtures.js.map +1 -0
- package/dist/probe/format.d.ts +10 -0
- package/dist/probe/format.d.ts.map +1 -0
- package/dist/probe/format.js +114 -0
- package/dist/probe/format.js.map +1 -0
- package/dist/probe/quality.d.ts +13 -0
- package/dist/probe/quality.d.ts.map +1 -0
- package/dist/probe/quality.js +50 -0
- package/dist/probe/quality.js.map +1 -0
- package/dist/probe/runner.d.ts +48 -0
- package/dist/probe/runner.d.ts.map +1 -0
- package/dist/probe/runner.js +211 -0
- package/dist/probe/runner.js.map +1 -0
- package/dist/probe/types.d.ts +159 -0
- package/dist/probe/types.d.ts.map +1 -0
- package/dist/probe/types.js +11 -0
- package/dist/probe/types.js.map +1 -0
- package/dist/server/audit.d.ts +26 -3
- package/dist/server/audit.d.ts.map +1 -1
- package/dist/server/audit.js +12 -1
- package/dist/server/audit.js.map +1 -1
- package/dist/server/config.d.ts +34 -19
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/config.js +327 -187
- package/dist/server/config.js.map +1 -1
- package/dist/server/deny-actions.d.ts +31 -0
- package/dist/server/deny-actions.d.ts.map +1 -0
- package/dist/server/deny-actions.js +156 -0
- package/dist/server/deny-actions.js.map +1 -0
- package/dist/server/effective-policy-log.d.ts +27 -0
- package/dist/server/effective-policy-log.d.ts.map +1 -0
- package/dist/server/effective-policy-log.js +103 -0
- package/dist/server/effective-policy-log.js.map +1 -0
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +15 -16
- package/dist/server/http.js.map +1 -1
- package/dist/server/server.d.ts +38 -4
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +234 -31
- package/dist/server/server.js.map +1 -1
- package/dist/server/types.d.ts +31 -13
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +11 -10
- package/dist/server/types.js.map +1 -1
- package/dist/server/xsuaa.d.ts +1 -2
- package/dist/server/xsuaa.d.ts.map +1 -1
- package/dist/server/xsuaa.js +13 -14
- package/dist/server/xsuaa.js.map +1 -1
- package/package.json +9 -3
package/dist/adt/safety.d.ts
CHANGED
|
@@ -4,18 +4,24 @@
|
|
|
4
4
|
* Gates all operations before they reach SAP. This is the first line of defense
|
|
5
5
|
* against unintended modifications — it runs before any HTTP call.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Design (post-authz-refactor-v2):
|
|
8
|
+
* - Safety flags are all POSITIVE opt-ins (`allow*=true` to enable a capability).
|
|
9
|
+
* Defaults are restrictive. No mix of negations and opt-ins.
|
|
10
|
+
* - Every mutation requires the matching server flag AND the user's scope
|
|
11
|
+
* (two-gate rule; scope check happens in the handler layer).
|
|
12
|
+
* - `allowWrites=false` is a TRUE no-mutation block — it stops object writes,
|
|
13
|
+
* transport writes, git writes, and activation (no loopholes).
|
|
14
|
+
* - Fine-grained per-action denials are expressed via `denyActions` (parsed
|
|
15
|
+
* from `SAP_DENY_ACTIONS`), not via op-code allow/block lists.
|
|
11
16
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
17
|
+
* Internal only: `OperationType` is the classification used by the safety
|
|
18
|
+
* engine. It is NOT admin-facing — the env vars `SAP_ALLOWED_OPS` /
|
|
19
|
+
* `SAP_DISALLOWED_OPS` were removed in v0.7. Admins configure via the `allow*`
|
|
20
|
+
* flags and `SAP_DENY_ACTIONS`.
|
|
14
21
|
*/
|
|
15
22
|
/**
|
|
16
|
-
* Operation type codes.
|
|
17
|
-
*
|
|
18
|
-
* Example: "RSQ" = allow Read, Search, Query only.
|
|
23
|
+
* Operation type codes (internal classification).
|
|
24
|
+
* NOT admin-facing — the code just uses these as a compact categorical label.
|
|
19
25
|
*/
|
|
20
26
|
export declare const OperationType: {
|
|
21
27
|
readonly Read: "R";
|
|
@@ -34,45 +40,66 @@ export declare const OperationType: {
|
|
|
34
40
|
};
|
|
35
41
|
export type OperationTypeCode = (typeof OperationType)[keyof typeof OperationType];
|
|
36
42
|
export interface SafetyConfig {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
allowWrites: boolean;
|
|
44
|
+
allowDataPreview: boolean;
|
|
45
|
+
allowFreeSQL: boolean;
|
|
46
|
+
allowTransportWrites: boolean;
|
|
47
|
+
allowGitWrites: boolean;
|
|
42
48
|
allowedPackages: string[];
|
|
43
|
-
dryRun: boolean;
|
|
44
|
-
enableTransports: boolean;
|
|
45
|
-
transportReadOnly: boolean;
|
|
46
49
|
allowedTransports: string[];
|
|
50
|
+
/** Resolved deny-action patterns from SAP_DENY_ACTIONS. Populated at config-parse time. */
|
|
51
|
+
denyActions: string[];
|
|
47
52
|
}
|
|
48
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Safe defaults — mirrors DEFAULT_CONFIG in src/server/types.ts.
|
|
55
|
+
* Use this when a test needs the real ship default without re-deriving it.
|
|
56
|
+
* If you change DEFAULT_CONFIG's safety fields, update this to match.
|
|
57
|
+
*/
|
|
49
58
|
export declare function defaultSafetyConfig(): SafetyConfig;
|
|
50
|
-
/** No restrictions — use with caution */
|
|
59
|
+
/** No restrictions — use with caution. */
|
|
51
60
|
export declare function unrestrictedSafetyConfig(): SafetyConfig;
|
|
52
|
-
/** Check if an operation type is allowed by the safety config */
|
|
61
|
+
/** Check if an operation type is allowed by the safety config. */
|
|
53
62
|
export declare function isOperationAllowed(config: SafetyConfig, op: OperationTypeCode): boolean;
|
|
54
|
-
/** Check operation and throw AdtSafetyError if blocked */
|
|
63
|
+
/** Check operation and throw AdtSafetyError if blocked. */
|
|
55
64
|
export declare function checkOperation(config: SafetyConfig, op: OperationTypeCode, opName: string): void;
|
|
56
|
-
/** Check if operations on a given package are allowed */
|
|
65
|
+
/** Check if operations on a given package are allowed (write-only check). */
|
|
57
66
|
export declare function isPackageAllowed(config: SafetyConfig, pkg: string): boolean;
|
|
58
|
-
/** Check package and throw AdtSafetyError if blocked */
|
|
67
|
+
/** Check package and throw AdtSafetyError if blocked. */
|
|
59
68
|
export declare function checkPackage(config: SafetyConfig, pkg: string): void;
|
|
60
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Check transport operation. Writes require `allowWrites && allowTransportWrites`.
|
|
71
|
+
* Reads are always allowed at this layer (scope check enforces user gating upstream).
|
|
72
|
+
*/
|
|
61
73
|
export declare function checkTransport(config: SafetyConfig, transport: string, opName: string, isWrite: boolean): void;
|
|
62
74
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
75
|
+
* Check git operation. Writes require `allowWrites && allowGitWrites`.
|
|
76
|
+
* Reads are always allowed at this layer.
|
|
65
77
|
*/
|
|
66
|
-
export declare function
|
|
78
|
+
export declare function checkGit(config: SafetyConfig, operation: string, isWrite?: boolean): void;
|
|
67
79
|
/**
|
|
68
|
-
* Derive a per-user safety config by merging server
|
|
69
|
-
*
|
|
70
|
-
* what the server config allows.
|
|
80
|
+
* Derive a per-user effective safety config by merging the server ceiling with
|
|
81
|
+
* the user's JWT scopes. Scopes can only RESTRICT further, never loosen.
|
|
71
82
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
83
|
+
* Uses the scope expansion rules from src/authz/policy.ts (admin implies all,
|
|
84
|
+
* write implies read, sql implies data). Callers should pass the already-expanded
|
|
85
|
+
* scope list for speed; this function re-expands as a safety net.
|
|
74
86
|
*/
|
|
75
87
|
export declare function deriveUserSafety(serverConfig: SafetyConfig, scopes: string[]): SafetyConfig;
|
|
76
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Derive a per-user effective safety by intersecting a partial SafetyConfig
|
|
90
|
+
* (from an API-key profile) with the server ceiling. Tight side wins field-by-field.
|
|
91
|
+
*
|
|
92
|
+
* Semantics:
|
|
93
|
+
* - Boolean fields: result is `server && profile` (both must be true for capability on).
|
|
94
|
+
* - `allowedPackages`:
|
|
95
|
+
* * If either side is `[]` (no restriction), use the other.
|
|
96
|
+
* * Else intersection by prefix semantics — profile entries covered by the
|
|
97
|
+
* server ceiling survive. If none survive, the effective list denies all
|
|
98
|
+
* packages/transports (true intersection).
|
|
99
|
+
* - `allowedTransports`: same as allowedPackages.
|
|
100
|
+
* - `denyActions`: union (both the server and profile denies apply).
|
|
101
|
+
*/
|
|
102
|
+
export declare function deriveUserSafetyFromProfile(serverConfig: SafetyConfig, profileSafety: Partial<SafetyConfig>): SafetyConfig;
|
|
103
|
+
/** Human-readable description of the safety configuration. */
|
|
77
104
|
export declare function describeSafety(config: SafetyConfig): string;
|
|
78
105
|
//# sourceMappingURL=safety.d.ts.map
|
package/dist/adt/safety.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/adt/safety.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/adt/safety.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;CAchB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,aAAa,CAAC,CAA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AE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CA6B3F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,GACnC,YAAY,CAuCd;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAY3D"}
|
package/dist/adt/safety.js
CHANGED
|
@@ -4,19 +4,25 @@
|
|
|
4
4
|
* Gates all operations before they reach SAP. This is the first line of defense
|
|
5
5
|
* against unintended modifications — it runs before any HTTP call.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Design (post-authz-refactor-v2):
|
|
8
|
+
* - Safety flags are all POSITIVE opt-ins (`allow*=true` to enable a capability).
|
|
9
|
+
* Defaults are restrictive. No mix of negations and opt-ins.
|
|
10
|
+
* - Every mutation requires the matching server flag AND the user's scope
|
|
11
|
+
* (two-gate rule; scope check happens in the handler layer).
|
|
12
|
+
* - `allowWrites=false` is a TRUE no-mutation block — it stops object writes,
|
|
13
|
+
* transport writes, git writes, and activation (no loopholes).
|
|
14
|
+
* - Fine-grained per-action denials are expressed via `denyActions` (parsed
|
|
15
|
+
* from `SAP_DENY_ACTIONS`), not via op-code allow/block lists.
|
|
11
16
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
17
|
+
* Internal only: `OperationType` is the classification used by the safety
|
|
18
|
+
* engine. It is NOT admin-facing — the env vars `SAP_ALLOWED_OPS` /
|
|
19
|
+
* `SAP_DISALLOWED_OPS` were removed in v0.7. Admins configure via the `allow*`
|
|
20
|
+
* flags and `SAP_DENY_ACTIONS`.
|
|
14
21
|
*/
|
|
15
22
|
import { AdtSafetyError } from './errors.js';
|
|
16
23
|
/**
|
|
17
|
-
* Operation type codes.
|
|
18
|
-
*
|
|
19
|
-
* Example: "RSQ" = allow Read, Search, Query only.
|
|
24
|
+
* Operation type codes (internal classification).
|
|
25
|
+
* NOT admin-facing — the code just uses these as a compact categorical label.
|
|
20
26
|
*/
|
|
21
27
|
export const OperationType = {
|
|
22
28
|
Read: 'R',
|
|
@@ -33,71 +39,85 @@ export const OperationType = {
|
|
|
33
39
|
Workflow: 'W',
|
|
34
40
|
Transport: 'X',
|
|
35
41
|
};
|
|
36
|
-
/**
|
|
37
|
-
const
|
|
38
|
-
|
|
42
|
+
/** Mutating operation types — blocked when `allowWrites=false`. */
|
|
43
|
+
const MUTATING_OPS = 'CDUAWX';
|
|
44
|
+
const DENY_ALL_LIST_ENTRY = '__ARC1_DENY_ALL__';
|
|
45
|
+
function listDeniesAll(list) {
|
|
46
|
+
return list.includes(DENY_ALL_LIST_ENTRY);
|
|
47
|
+
}
|
|
48
|
+
function displayAllowList(list) {
|
|
49
|
+
return listDeniesAll(list) ? '[]' : `[${list.join(',')}]`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Safe defaults — mirrors DEFAULT_CONFIG in src/server/types.ts.
|
|
53
|
+
* Use this when a test needs the real ship default without re-deriving it.
|
|
54
|
+
* If you change DEFAULT_CONFIG's safety fields, update this to match.
|
|
55
|
+
*/
|
|
39
56
|
export function defaultSafetyConfig() {
|
|
40
57
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
allowedPackages: [],
|
|
47
|
-
dryRun: false,
|
|
48
|
-
enableTransports: false,
|
|
49
|
-
transportReadOnly: false,
|
|
58
|
+
allowWrites: false,
|
|
59
|
+
allowDataPreview: false,
|
|
60
|
+
allowFreeSQL: false,
|
|
61
|
+
allowTransportWrites: false,
|
|
62
|
+
allowGitWrites: false,
|
|
63
|
+
allowedPackages: ['$TMP'],
|
|
50
64
|
allowedTransports: [],
|
|
65
|
+
denyActions: [],
|
|
51
66
|
};
|
|
52
67
|
}
|
|
53
|
-
/** No restrictions — use with caution */
|
|
68
|
+
/** No restrictions — use with caution. */
|
|
54
69
|
export function unrestrictedSafetyConfig() {
|
|
55
70
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
allowWrites: true,
|
|
72
|
+
allowDataPreview: true,
|
|
73
|
+
allowFreeSQL: true,
|
|
74
|
+
allowTransportWrites: true,
|
|
75
|
+
allowGitWrites: true,
|
|
61
76
|
allowedPackages: [],
|
|
62
|
-
dryRun: false,
|
|
63
|
-
enableTransports: false,
|
|
64
|
-
transportReadOnly: false,
|
|
65
77
|
allowedTransports: [],
|
|
78
|
+
denyActions: [],
|
|
66
79
|
};
|
|
67
80
|
}
|
|
68
|
-
/** Check if an operation type is allowed by the safety config */
|
|
81
|
+
/** Check if an operation type is allowed by the safety config. */
|
|
69
82
|
export function isOperationAllowed(config, op) {
|
|
70
|
-
//
|
|
71
|
-
if (config.
|
|
72
|
-
return true;
|
|
73
|
-
// ReadOnly blocks all write operations
|
|
74
|
-
if (config.readOnly && WRITE_OPS.includes(op))
|
|
83
|
+
// Mutating ops (Create/Update/Delete/Activate/Workflow/Transport) require allowWrites
|
|
84
|
+
if (MUTATING_OPS.includes(op) && !config.allowWrites)
|
|
75
85
|
return false;
|
|
76
|
-
//
|
|
77
|
-
if (
|
|
86
|
+
// Transport mutation has an additional gate
|
|
87
|
+
if (op === OperationType.Transport && !config.allowTransportWrites)
|
|
78
88
|
return false;
|
|
79
|
-
//
|
|
80
|
-
if (
|
|
89
|
+
// Table preview
|
|
90
|
+
if (op === OperationType.Query && !config.allowDataPreview)
|
|
81
91
|
return false;
|
|
82
|
-
//
|
|
83
|
-
if (op === OperationType.
|
|
84
|
-
return false;
|
|
85
|
-
// Disallowed ops blacklist (takes precedence over allowed)
|
|
86
|
-
if (config.disallowedOps?.includes(op))
|
|
87
|
-
return false;
|
|
88
|
-
// Allowed ops whitelist (if set, only listed ops are allowed)
|
|
89
|
-
if (config.allowedOps && !config.allowedOps.includes(op))
|
|
92
|
+
// Free SQL
|
|
93
|
+
if (op === OperationType.FreeSQL && !config.allowFreeSQL)
|
|
90
94
|
return false;
|
|
95
|
+
// All other ops (Read/Search/Intelligence/Test/Lock) are always allowed at this layer.
|
|
96
|
+
// User-gating happens at the scope layer (ACTION_POLICY + hasRequiredScope).
|
|
91
97
|
return true;
|
|
92
98
|
}
|
|
93
|
-
/** Check operation and throw AdtSafetyError if blocked */
|
|
99
|
+
/** Check operation and throw AdtSafetyError if blocked. */
|
|
94
100
|
export function checkOperation(config, op, opName) {
|
|
95
101
|
if (!isOperationAllowed(config, op)) {
|
|
96
|
-
throw new AdtSafetyError(`Operation '${opName}' (type ${op}) is blocked by safety configuration`);
|
|
102
|
+
throw new AdtSafetyError(`Operation '${opName}' (type ${op}) is blocked by safety configuration (${explainOperationBlock(config, op)})`);
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
|
-
/**
|
|
105
|
+
/** Returns a human-readable reason why an operation is blocked. Assumes the op IS blocked. */
|
|
106
|
+
function explainOperationBlock(config, op) {
|
|
107
|
+
if (MUTATING_OPS.includes(op) && !config.allowWrites)
|
|
108
|
+
return 'reason: allowWrites=false blocks mutations (C/D/U/A/W/X)';
|
|
109
|
+
if (op === OperationType.Transport && !config.allowTransportWrites)
|
|
110
|
+
return 'reason: allowTransportWrites=false';
|
|
111
|
+
if (op === OperationType.Query && !config.allowDataPreview)
|
|
112
|
+
return 'reason: allowDataPreview=false';
|
|
113
|
+
if (op === OperationType.FreeSQL && !config.allowFreeSQL)
|
|
114
|
+
return 'reason: allowFreeSQL=false';
|
|
115
|
+
return 'reason: unknown';
|
|
116
|
+
}
|
|
117
|
+
/** Check if operations on a given package are allowed (write-only check). */
|
|
100
118
|
export function isPackageAllowed(config, pkg) {
|
|
119
|
+
if (listDeniesAll(config.allowedPackages))
|
|
120
|
+
return false;
|
|
101
121
|
if (config.allowedPackages.length === 0)
|
|
102
122
|
return true;
|
|
103
123
|
const upperPkg = pkg.toUpperCase();
|
|
@@ -115,14 +135,16 @@ export function isPackageAllowed(config, pkg) {
|
|
|
115
135
|
}
|
|
116
136
|
return false;
|
|
117
137
|
}
|
|
118
|
-
/** Check package and throw AdtSafetyError if blocked */
|
|
138
|
+
/** Check package and throw AdtSafetyError if blocked. */
|
|
119
139
|
export function checkPackage(config, pkg) {
|
|
120
140
|
if (!isPackageAllowed(config, pkg)) {
|
|
121
|
-
throw new AdtSafetyError(`Operations on package '${pkg}' are blocked by safety configuration (allowed: ${
|
|
141
|
+
throw new AdtSafetyError(`Operations on package '${pkg}' are blocked by safety configuration (allowed: ${displayAllowList(config.allowedPackages)})`);
|
|
122
142
|
}
|
|
123
143
|
}
|
|
124
|
-
/** Check if a transport is in the whitelist
|
|
144
|
+
/** Check if a transport is in the whitelist. */
|
|
125
145
|
function isTransportInWhitelist(config, transport) {
|
|
146
|
+
if (listDeniesAll(config.allowedTransports))
|
|
147
|
+
return false;
|
|
126
148
|
if (config.allowedTransports.length === 0)
|
|
127
149
|
return true;
|
|
128
150
|
const upperTransport = transport.toUpperCase();
|
|
@@ -138,89 +160,158 @@ function isTransportInWhitelist(config, transport) {
|
|
|
138
160
|
}
|
|
139
161
|
return false;
|
|
140
162
|
}
|
|
141
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* Check transport operation. Writes require `allowWrites && allowTransportWrites`.
|
|
165
|
+
* Reads are always allowed at this layer (scope check enforces user gating upstream).
|
|
166
|
+
*/
|
|
142
167
|
export function checkTransport(config, transport, opName, isWrite) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
168
|
+
if (isWrite) {
|
|
169
|
+
if (!config.allowWrites) {
|
|
170
|
+
throw new AdtSafetyError(`Transport write '${opName}' is blocked: allowWrites=false. Set SAP_ALLOW_WRITES=true to enable writes.`);
|
|
171
|
+
}
|
|
172
|
+
if (!config.allowTransportWrites) {
|
|
173
|
+
throw new AdtSafetyError(`Transport write '${opName}' is blocked: allowTransportWrites=false. Set SAP_ALLOW_TRANSPORT_WRITES=true to enable transport mutations.`);
|
|
174
|
+
}
|
|
150
175
|
}
|
|
151
|
-
//
|
|
176
|
+
// Transport whitelist applies to both read and write
|
|
152
177
|
if (transport && transport !== '*' && config.allowedTransports.length > 0) {
|
|
153
178
|
if (!isTransportInWhitelist(config, transport)) {
|
|
154
|
-
throw new AdtSafetyError(`Operation '${opName}' on transport '${transport}' is blocked by safety configuration (allowed: ${
|
|
179
|
+
throw new AdtSafetyError(`Operation '${opName}' on transport '${transport}' is blocked by safety configuration (allowed: ${displayAllowList(config.allowedTransports)})`);
|
|
155
180
|
}
|
|
156
181
|
}
|
|
157
182
|
}
|
|
158
183
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
184
|
+
* Check git operation. Writes require `allowWrites && allowGitWrites`.
|
|
185
|
+
* Reads are always allowed at this layer.
|
|
186
|
+
*/
|
|
187
|
+
export function checkGit(config, operation, isWrite = true) {
|
|
188
|
+
if (!isWrite)
|
|
189
|
+
return;
|
|
190
|
+
if (!config.allowWrites) {
|
|
191
|
+
throw new AdtSafetyError(`Git write '${operation}' is blocked: allowWrites=false. Set SAP_ALLOW_WRITES=true to enable writes.`);
|
|
192
|
+
}
|
|
193
|
+
if (!config.allowGitWrites) {
|
|
194
|
+
throw new AdtSafetyError(`Git write '${operation}' is blocked: allowGitWrites=false. Set SAP_ALLOW_GIT_WRITES=true to enable git mutations.`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Derive a per-user effective safety config by merging the server ceiling with
|
|
199
|
+
* the user's JWT scopes. Scopes can only RESTRICT further, never loosen.
|
|
200
|
+
*
|
|
201
|
+
* Uses the scope expansion rules from src/authz/policy.ts (admin implies all,
|
|
202
|
+
* write implies read, sql implies data). Callers should pass the already-expanded
|
|
203
|
+
* scope list for speed; this function re-expands as a safety net.
|
|
161
204
|
*/
|
|
162
|
-
export function
|
|
205
|
+
export function deriveUserSafety(serverConfig, scopes) {
|
|
206
|
+
// Inline the expansion to avoid the circular import with src/authz/policy.ts.
|
|
207
|
+
// Keep in sync with expandScopes() there.
|
|
163
208
|
const expanded = new Set(scopes);
|
|
209
|
+
if (expanded.has('admin')) {
|
|
210
|
+
expanded.add('read');
|
|
211
|
+
expanded.add('write');
|
|
212
|
+
expanded.add('data');
|
|
213
|
+
expanded.add('sql');
|
|
214
|
+
expanded.add('transports');
|
|
215
|
+
expanded.add('git');
|
|
216
|
+
}
|
|
164
217
|
if (expanded.has('write'))
|
|
165
218
|
expanded.add('read');
|
|
166
219
|
if (expanded.has('sql'))
|
|
167
220
|
expanded.add('data');
|
|
168
|
-
|
|
221
|
+
const effective = {
|
|
222
|
+
...serverConfig,
|
|
223
|
+
allowedPackages: [...serverConfig.allowedPackages],
|
|
224
|
+
allowedTransports: [...serverConfig.allowedTransports],
|
|
225
|
+
denyActions: [...serverConfig.denyActions],
|
|
226
|
+
};
|
|
227
|
+
if (!expanded.has('write'))
|
|
228
|
+
effective.allowWrites = false;
|
|
229
|
+
if (!expanded.has('data'))
|
|
230
|
+
effective.allowDataPreview = false;
|
|
231
|
+
if (!expanded.has('sql'))
|
|
232
|
+
effective.allowFreeSQL = false;
|
|
233
|
+
if (!expanded.has('transports'))
|
|
234
|
+
effective.allowTransportWrites = false;
|
|
235
|
+
if (!expanded.has('git'))
|
|
236
|
+
effective.allowGitWrites = false;
|
|
237
|
+
return effective;
|
|
169
238
|
}
|
|
170
239
|
/**
|
|
171
|
-
* Derive a per-user safety
|
|
172
|
-
*
|
|
173
|
-
* what the server config allows.
|
|
240
|
+
* Derive a per-user effective safety by intersecting a partial SafetyConfig
|
|
241
|
+
* (from an API-key profile) with the server ceiling. Tight side wins field-by-field.
|
|
174
242
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
243
|
+
* Semantics:
|
|
244
|
+
* - Boolean fields: result is `server && profile` (both must be true for capability on).
|
|
245
|
+
* - `allowedPackages`:
|
|
246
|
+
* * If either side is `[]` (no restriction), use the other.
|
|
247
|
+
* * Else intersection by prefix semantics — profile entries covered by the
|
|
248
|
+
* server ceiling survive. If none survive, the effective list denies all
|
|
249
|
+
* packages/transports (true intersection).
|
|
250
|
+
* - `allowedTransports`: same as allowedPackages.
|
|
251
|
+
* - `denyActions`: union (both the server and profile denies apply).
|
|
177
252
|
*/
|
|
178
|
-
export function
|
|
253
|
+
export function deriveUserSafetyFromProfile(serverConfig, profileSafety) {
|
|
254
|
+
const and = (a, b) => (b === undefined ? a : a && b);
|
|
255
|
+
const intersectList = (server, profile) => {
|
|
256
|
+
if (!profile)
|
|
257
|
+
return [...server];
|
|
258
|
+
if (server.length === 0 && profile.length === 0)
|
|
259
|
+
return [];
|
|
260
|
+
if (server.length === 0)
|
|
261
|
+
return [...profile];
|
|
262
|
+
if (profile.length === 0)
|
|
263
|
+
return [...server];
|
|
264
|
+
// Profile narrows server: keep profile entries that are covered by server.
|
|
265
|
+
// "Covered by" means: there exists a server entry equal to the profile entry, or a
|
|
266
|
+
// server wildcard that matches it.
|
|
267
|
+
const covers = (serverPat, profilePat) => {
|
|
268
|
+
const s = serverPat.toUpperCase();
|
|
269
|
+
const p = profilePat.toUpperCase();
|
|
270
|
+
if (s === p)
|
|
271
|
+
return true;
|
|
272
|
+
if (s.endsWith('*')) {
|
|
273
|
+
const prefix = s.slice(0, -1);
|
|
274
|
+
if (p.startsWith(prefix))
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
};
|
|
279
|
+
const narrowed = profile.filter((p) => server.some((s) => covers(s, p)));
|
|
280
|
+
// True intersection: disjoint constraints mean no package/transport is allowed.
|
|
281
|
+
// We cannot return [] here because [] means "unrestricted" in SafetyConfig.
|
|
282
|
+
return narrowed.length > 0 ? narrowed : [DENY_ALL_LIST_ENTRY];
|
|
283
|
+
};
|
|
179
284
|
const effective = {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
285
|
+
allowWrites: and(serverConfig.allowWrites, profileSafety.allowWrites),
|
|
286
|
+
allowDataPreview: and(serverConfig.allowDataPreview, profileSafety.allowDataPreview),
|
|
287
|
+
allowFreeSQL: and(serverConfig.allowFreeSQL, profileSafety.allowFreeSQL),
|
|
288
|
+
allowTransportWrites: and(serverConfig.allowTransportWrites, profileSafety.allowTransportWrites),
|
|
289
|
+
allowGitWrites: and(serverConfig.allowGitWrites, profileSafety.allowGitWrites),
|
|
290
|
+
allowedPackages: intersectList(serverConfig.allowedPackages, profileSafety.allowedPackages),
|
|
291
|
+
allowedTransports: intersectList(serverConfig.allowedTransports, profileSafety.allowedTransports),
|
|
292
|
+
denyActions: [...new Set([...serverConfig.denyActions, ...(profileSafety.denyActions ?? [])])],
|
|
183
293
|
};
|
|
184
|
-
const expanded = expandImpliedScopes(scopes);
|
|
185
|
-
// No write scope → force read-only and disable transports
|
|
186
|
-
if (!expanded.includes('write')) {
|
|
187
|
-
effective.readOnly = true;
|
|
188
|
-
effective.enableTransports = false;
|
|
189
|
-
}
|
|
190
|
-
// No data scope (and no sql, which implies data) → block table preview
|
|
191
|
-
if (!expanded.includes('data')) {
|
|
192
|
-
effective.blockData = true;
|
|
193
|
-
}
|
|
194
|
-
// No sql scope → block free SQL
|
|
195
|
-
if (!expanded.includes('sql')) {
|
|
196
|
-
effective.blockFreeSQL = true;
|
|
197
|
-
}
|
|
198
294
|
return effective;
|
|
199
295
|
}
|
|
200
|
-
/** Human-readable description of the safety configuration */
|
|
296
|
+
/** Human-readable description of the safety configuration. */
|
|
201
297
|
export function describeSafety(config) {
|
|
202
298
|
const parts = [];
|
|
203
|
-
if (config.
|
|
204
|
-
parts.push('
|
|
205
|
-
if (config.
|
|
206
|
-
parts.push('
|
|
207
|
-
if (config.
|
|
208
|
-
parts.push('
|
|
209
|
-
if (config.
|
|
210
|
-
parts.push('
|
|
211
|
-
if (config.
|
|
212
|
-
parts.push(
|
|
213
|
-
if (config.disallowedOps)
|
|
214
|
-
parts.push(`DisallowedOps=${config.disallowedOps}`);
|
|
299
|
+
if (config.allowWrites)
|
|
300
|
+
parts.push('WRITES');
|
|
301
|
+
if (config.allowDataPreview)
|
|
302
|
+
parts.push('DATA-PREVIEW');
|
|
303
|
+
if (config.allowFreeSQL)
|
|
304
|
+
parts.push('FREE-SQL');
|
|
305
|
+
if (config.allowTransportWrites)
|
|
306
|
+
parts.push('TRANSPORT-WRITES');
|
|
307
|
+
if (config.allowGitWrites)
|
|
308
|
+
parts.push('GIT-WRITES');
|
|
215
309
|
if (config.allowedPackages.length > 0)
|
|
216
|
-
parts.push(`
|
|
217
|
-
if (config.
|
|
218
|
-
parts.push(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
parts.push(`AllowedTransports=[${config.allowedTransports.join(',')}]`);
|
|
223
|
-
}
|
|
224
|
-
return parts.length === 0 ? 'UNRESTRICTED' : parts.join(', ');
|
|
310
|
+
parts.push(`Packages=${displayAllowList(config.allowedPackages)}`);
|
|
311
|
+
if (config.allowedTransports.length > 0)
|
|
312
|
+
parts.push(`Transports=${displayAllowList(config.allowedTransports)}`);
|
|
313
|
+
if (config.denyActions.length > 0)
|
|
314
|
+
parts.push(`DenyActions=${config.denyActions.length}`);
|
|
315
|
+
return parts.length === 0 ? 'READ-ONLY' : parts.join(', ');
|
|
225
316
|
}
|
|
226
317
|
//# sourceMappingURL=safety.js.map
|
package/dist/adt/safety.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safety.js","sourceRoot":"","sources":["../../src/adt/safety.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"safety.js","sourceRoot":"","sources":["../../src/adt/safety.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,GAAG;IACT,MAAM,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AY,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC1G,IAAI,MAAM,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,cAAc,gBAAgB,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAChH,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1F,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC"}
|
package/dist/adt/transport.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CTS Transport management for SAP ADT.
|
|
3
3
|
*
|
|
4
|
-
* Transport
|
|
4
|
+
* Transport mutations require explicit opt-in via allowWrites + allowTransportWrites.
|
|
5
5
|
* Safety checks are applied at every entry point.
|
|
6
6
|
*/
|
|
7
7
|
import type { AdtHttpClient } from './http.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/adt/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,KAAK,EAAmB,gBAAgB,EAAiB,MAAM,YAAY,CAAC;AAKnF,uEAAuE;AACvE,eAAO,MAAM,eAAe,0DAA0D,CAAC;AAEvF,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAE9F,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAEhE,sFAAs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