@superglue/cli 1.1.26 → 1.1.27

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.
@@ -1,147 +1,77 @@
1
1
  # Access Rules (RBAC)
2
2
 
3
- On superglue, roles define tool-level and system-level allowlists. Users can have multiple roles. Roles and access rules are only available on enterprise organizations. Non-enterprise orgs do not have RBAC — all users have admin access on personal organizations.
3
+ On superglue, roles define binary tool-level and system-level allowlists. Users can have multiple roles. Roles and access rules are only available on enterprise organizations.
4
4
 
5
5
  ## Data Model
6
6
 
7
- ### Role
8
-
9
7
  ```typescript
10
8
  interface Role {
11
9
  id: string;
12
10
  name: string;
13
11
  description?: string;
14
- tools: "ALL" | string[]; // tool allowlist
15
- systems: "ALL" | Record<string, SystemPermission>; // system allowlist
16
- isBaseRole?: boolean; // true for admin, member, enduser
17
- }
18
- ```
19
-
20
- ### SystemPermission
21
-
22
- Each system entry is either a predefined access level or a custom rule:
23
-
24
- ```typescript
25
- type SystemPermission = SystemAccessLevel | { rules: CustomRule[] };
26
- ```
27
-
28
- | Type | Meaning |
29
- | ------------------ | ------------------------------------------------ |
30
- | `"read-write"` | All HTTP methods allowed |
31
- | `"read-only"` | Only GET and HEAD; POST/PUT/PATCH/DELETE blocked |
32
- | `{ rules: [...] }` | Custom JS expressions that gate access |
33
-
34
- Systems not listed in the role's `systems` map are DENIED, unless the system access is set to `"ALL"`.
35
-
36
- ### CustomRule
37
-
38
- ```typescript
39
- interface CustomRule {
40
- id: string;
41
- name: string;
42
- expression?: string; // JS expression, receives stepConfig
43
- isActive: boolean;
12
+ tools: "ALL" | string[];
13
+ systems: "ALL" | string[];
14
+ isBaseRole?: boolean;
44
15
  }
45
16
  ```
46
17
 
47
- Custom rules are inline in the systems map. A system either has a standard access level OR a custom rule, never both. Custom rules must return truthy to **allow** the request. If it returns falsy, throws, or has no expression, the request is blocked (fail-closed).
18
+ Only `"ALL"` means open access. Empty arrays, missing fields, or `null` mean no direct access from that role.
48
19
 
49
20
  ## Tool Permissions
50
21
 
51
22
  - `tools: "ALL"` — every tool is allowed, including tools created in the future
52
- - `tools: ["tool-id-1", "tool-id-2"]` — only these specific tools are allowed; new tools are NOT auto-included (but see Auto-Append below)
23
+ - `tools: ["tool-id-1", "tool-id-2"]` — only these specific tools are allowed
24
+ - Effective tool visibility also requires access to every system referenced by that tool's request steps
53
25
 
54
26
  ## System Permissions
55
27
 
56
- - `systems: "ALL"` — every system allowed at READ_WRITE level, including future systems. Custom rules are not possible in this mode.
57
- - `systems: { "gmail": "read-write", "stripe": "read-only" }` — SPECIFIC mode: per-system access levels; unlisted systems are denied.
58
- - `systems: { "gmail": { rules: [{ name: "block-deletes", expression: "stepConfig.method !== 'DELETE'", isActive: true }] } }` — custom rule on a specific system
28
+ - `systems: "ALL"` — every current and future system is allowed
29
+ - `systems: ["gmail", "stripe"]` — only these specific systems are allowed
30
+ - System access is binary by system ID: listed means allowed, omitted means denied.
59
31
 
60
- ## Mutation Detection by Protocol
32
+ ## Tool/System Entanglement
61
33
 
62
- Read-only mode blocks mutating requests. How "mutating" is determined per protocol:
34
+ A saved tool is effectively visible and runnable only when both are true:
63
35
 
64
- - **HTTP** — POST, PUT, PATCH, DELETE are mutating; GET and HEAD are read-only
65
- - **Postgres** — SQL statements starting with or containing INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE, etc. are mutating; everything else (SELECT) is read-only
66
- - **FTP / SMB** — operations other than `list`, `get`, `exists`, `stat` are mutating
67
- - **Redis** — commands not in the read-only set (GET, MGET, EXISTS, KEYS, SCAN, TTL, TYPE, HGET, HGETALL, LRANGE, SMEMBERS, SCARD, etc.) are mutating
68
- - **Transform** — never mutating (pure data transformation, no external system)
36
+ 1. The user has tool access through at least one role.
37
+ 2. The user has access to every `systemId` referenced by the tool's request steps.
69
38
 
70
- On parse failure, all protocols default to **mutating** (fail-closed).
71
-
72
- ## Custom Rule Expressions
73
-
74
- Custom rules only apply in SPECIFIC mode. If systems is `"ALL"`, no custom rules exist.
75
-
76
- Expressions receive a **resolved** `stepConfig` object — all template variables (`<<variable>>` and `<<(sourceData) => ...>>` expressions) are substituted with their actual runtime values before the rule evaluates. This means rules see the real URL, headers, body, and query params, not raw templates.
77
-
78
- ```typescript
79
- interface StepConfig {
80
- url: string;
81
- method: string;
82
- headers: Record<string, string>;
83
- queryParams: Record<string, string>;
84
- body: unknown;
85
- systemId: string;
86
- }
87
- ```
88
-
89
- Example expressions:
90
-
91
- ```javascript
92
- // Block all POST requests to a specific endpoint
93
- stepConfig.method !== "POST" || !stepConfig.url.includes("/admin");
94
-
95
- // Only allow GET requests to /api/v1/read endpoints
96
- stepConfig.method === "GET" && stepConfig.url.includes("/api/v1/read");
97
-
98
- // Block requests with certain headers
99
- !stepConfig.headers["x-dangerous-header"];
100
-
101
- // Block a specific datasource ID in the resolved body
102
- !(typeof stepConfig.body === "object" && stepConfig.body?.datasource?.id === "blocked-id");
103
- ```
39
+ When granting a tool, inspect the tool's request-step `systemId` values and grant required systems when the user should be able to see or run the tool.
104
40
 
105
41
  ## Multi-Role Semantics
106
42
 
107
- Users can have multiple roles. Resolution is **union (most permissive wins) everywhere**:
108
-
109
- | Layer | Semantics | Example |
110
- | ------------ | ------------------------------ | --------------------------------------------------------------------------- |
111
- | Tools | Union (most permissive wins) | If role A allows tool X and role B doesn't, tool X is allowed |
112
- | Systems | Union (most permissive wins) | If role A gives READ_ONLY and role B gives READ_WRITE, result is READ_WRITE |
113
- | Custom rules | Per-role union (any role wins) | If any role's complete rule set allows the request, it goes through |
43
+ Users can have multiple roles. Resolution is union:
114
44
 
115
- Custom rule detail:
45
+ | Layer | Semantics |
46
+ | ------- | ----------------------------------------------------- |
47
+ | Tools | If any role allows a tool, the tool ID is allowed |
48
+ | Systems | If any role allows a system, the system ID is allowed |
116
49
 
117
- - **Within a single role**, all custom rules for that system must pass (AND logic)
118
- - **Across roles**, evaluation is per-role: if any role fully allows the request (all its rules pass, or it has no custom rule for that system), the request is allowed (OR logic)
50
+ Assigned roles can add access but cannot remove access granted by another role.
119
51
 
120
52
  ## Base Roles
121
53
 
122
- Every user has exactly **one** base role. There are three:
54
+ Every user has exactly one base role:
123
55
 
124
- - **`admin`** — Full access to everything. Bypasses all RBAC checks. The admin role is **immutable** — it cannot be edited at all, nor can it be re-assigned.
125
- - **`member`** — Default for org team members. Starts with `tools: "ALL"`, `systems: "ALL"`. Tool and system allowlists can be narrowed to restrict access. Name and description cannot be changed. Cannot be deleted.
126
- - **`enduser`** — Default for end users with Credentials-only access. Starts with `tools: []`, `systems: {}` (no access). Tool and system allowlists must be explicitly populated to grant access. Name and description cannot be changed. Cannot be deleted.
56
+ - **`admin`** — full access to everything. The admin role is immutable.
57
+ - **`member`** — default for org team members. Starts with `tools: "ALL"`, `systems: "ALL"`. Tool and system allowlists can be narrowed. Name and description cannot be changed. Cannot be deleted.
127
58
 
128
- Base roles define the starting permissions that custom roles can extend or build on top of. Users can also have additional **custom roles** on top of their base role. Custom roles are fully editable (name, description, tools, systems) and can be created and deleted.
59
+ Users can also have additional custom roles on top of their base role. Custom roles are fully editable and can be created/deleted.
129
60
 
130
61
  ## Personal Roles
131
62
 
132
- Admins can create a **personal role** for a specific user. A personal role is a per-user override that scopes which tools and systems that individual can access — independent of their base role and shared custom roles.
63
+ Admins can create a personal role for a specific user. A personal role is a per-user override that grants individual tool and system access independent of shared roles.
133
64
 
134
- - Each user can have at most one personal role
135
- - Personal roles follow the same structure as custom roles (tools allowlist, systems map, custom rules)
136
- - Resolution: personal role permissions are unioned with the user's other roles (most permissive wins)
137
- - Use case: giving a single team member access to a sensitive system without creating a shared role
138
- - Managed via the **Personal Roles** tab in Access Rules (web app) or the REST API (`POST /v1/users/:userId/personal-role`)
65
+ - Each user can have at most one personal role.
66
+ - Personal roles use the same `tools` and `systems` allowlist structure.
67
+ - Personal role allowlists are unioned with the user's other roles.
68
+ - Managed via the Personal Roles tab in Access Rules or the REST API (`POST /v1/users/:userId/personal-role`).
139
69
 
140
- ### Auto-append on resource creation
70
+ ## Auto-Append On Resource Creation
141
71
 
142
- When a user creates a new tool or system, the backend automatically adds it to the **creator's personal role**:
72
+ When a user creates a new tool or system, the backend automatically adds it to the creator's personal role:
143
73
 
144
- - New tool created → appended to the creator's personal role's `tools` list
145
- - New system created → appended to the creator's personal role's `systems` map with `read-write` access
74
+ - New tool created -> appended to the creator's personal role `tools` list
75
+ - New system created -> appended to the creator's personal role `systems` list
146
76
 
147
- This only affects the creator's personal role, not base roles or additional custom roles. It ensures that a user on a restricted allowlist automatically gets access to resources they create without granting those resources to everyone with the same base role.
77
+ This only affects the creator's personal role, not base roles or additional custom roles.
@@ -54,7 +54,7 @@ The persistent left sidebar contains these top-level items:
54
54
  - **Landscape** (`/landscape`) — graph overview of tools, systems, and their connections.
55
55
  - **Tools** (`/tools`, detail at `/tools/{toolId}`) — saved tools; opens the tool playground for editing, testing, and running.
56
56
  - **Systems** (`/systems`, detail at `/systems/{systemId}`) — connected external systems with credentials and documentation.
57
- - **My Credentials** (`/credentials`) — credential management. The **My Credentials** section is for personal user-owned system credentials; the **superglue API keys** section is for API keys. Admins and members open it inside the normal app shell from the sidebar; end users only see this standalone credentials surface.
57
+ - **My Credentials** (`/credentials`) — credential management. The **My Credentials** section is for personal user-owned system credentials; the **superglue API keys** section is for API keys. Admins and members open it inside the normal app shell from the sidebar.
58
58
  - **Runs** (`/runs`, detail at `/runs/{runId}`) — execution history for full, draft, and single-step tool runs. Runs is a top-level sidebar item, not a Control Panel sub-item.
59
59
  - **Control Panel** (`/admin`) — expandable group for organization and account administration:
60
60
  - **Overview** (`/admin`) — dashboard summary, including failed-run and schedule summaries.
@@ -81,7 +81,6 @@ Below the navigation, the sidebar shows the organization switcher and Sign Out.
81
81
  e. Wrap result: `{ currentItem, data, success }`
82
82
  f. On failure: abort if `failureBehavior !== "continue"`
83
83
  3. **Output transform** (if present): run JS function, validate against outputSchema
84
- 4. **Response filters** (if present): remove/mask/fail on pattern matches
85
84
 
86
85
  ### Strategy Routing
87
86