@tadnt2003/n8n-nodes-infisical 0.2.1 → 0.3.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/LICENSE +1 -0
- package/README.md +182 -65
- package/dist/nodes/Infisical/Infisical.node.js +577 -234
- package/dist/nodes/InfisicalSync/InfisicalSync.node.d.ts +10 -0
- package/dist/nodes/InfisicalSync/InfisicalSync.node.js +1057 -0
- package/dist/nodes/InfisicalSync/infisical.png +0 -0
- package/dist/utils/auth.d.ts +5 -0
- package/dist/utils/auth.js +27 -0
- package/dist/utils/folderOperations.d.ts +2 -0
- package/dist/utils/folderOperations.js +103 -0
- package/dist/utils/projectOperations.d.ts +2 -0
- package/dist/utils/projectOperations.js +89 -0
- package/dist/utils/secretOperations.d.ts +2 -0
- package/dist/utils/secretOperations.js +256 -0
- package/dist/utils/syncOperations.d.ts +2 -0
- package/dist/utils/syncOperations.js +750 -0
- package/package.json +6 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -10,7 +10,6 @@ An n8n community node for integrating [Infisical](https://infisical.com/) — th
|
|
|
10
10
|
[Installation](#installation)
|
|
11
11
|
[Credentials](#credentials)
|
|
12
12
|
[Operations](#operations)
|
|
13
|
-
[Usage Examples](#usage-examples)
|
|
14
13
|
[Compatibility](#compatibility)
|
|
15
14
|
[Resources](#resources)
|
|
16
15
|
|
|
@@ -39,16 +38,6 @@ Universal Auth uses a Machine Identity's Client ID and Client Secret to obtain a
|
|
|
39
38
|
5. Assign the identity to your project with appropriate roles
|
|
40
39
|
6. Copy the **Client ID** and **Client Secret**
|
|
41
40
|
|
|
42
|
-
**Credential fields:**
|
|
43
|
-
|
|
44
|
-
| Field | Required | Description |
|
|
45
|
-
| --- | --- | --- |
|
|
46
|
-
| API URL | Yes | Base URL of your Infisical API (default: `https://app.infisical.com/api`) |
|
|
47
|
-
| Authentication Type | Yes | Select **Universal Auth (Machine Identity)** |
|
|
48
|
-
| Client ID | Yes | The Machine Identity's Client ID |
|
|
49
|
-
| Client Secret | Yes | The Machine Identity's Client Secret |
|
|
50
|
-
| Organization Slug | No | Scope the access token to a specific organization. Leave blank to use the organization the machine identity belongs to. To restrict access to a specific project, assign the identity to that project in Organization Settings → Machine Identities → your identity → Project Access. |
|
|
51
|
-
|
|
52
41
|
### Service Token (Legacy)
|
|
53
42
|
|
|
54
43
|
Service Tokens are deprecated by Infisical and may be removed in future versions. Use Universal Auth for new integrations.
|
|
@@ -58,14 +47,6 @@ Service Tokens are deprecated by Infisical and may be removed in future versions
|
|
|
58
47
|
3. Create a new Service Token with the required permissions
|
|
59
48
|
4. Copy the token
|
|
60
49
|
|
|
61
|
-
**Credential fields:**
|
|
62
|
-
|
|
63
|
-
| Field | Required | Description |
|
|
64
|
-
| --- | --- | --- |
|
|
65
|
-
| API URL | Yes | Base URL of your Infisical API (default: `https://app.infisical.com/api`) |
|
|
66
|
-
| Authentication Type | Yes | Select **Service Token (Legacy)** |
|
|
67
|
-
| Service Token | Yes | Your Infisical Service Token |
|
|
68
|
-
|
|
69
50
|
> For self-hosted Infisical, set API URL to your instance (e.g., `https://infisical.example.com/api`).
|
|
70
51
|
|
|
71
52
|
---
|
|
@@ -81,10 +62,11 @@ All Secret operations require: **Project ID**, **Environment**, **Secret Path**
|
|
|
81
62
|
| **Get** | Fetch a single secret by key | `GET` | `/v4/secrets/{key}` |
|
|
82
63
|
| **Get Many** | List all secrets in a path | `GET` | `/v4/secrets` |
|
|
83
64
|
| **Create** | Create a single secret | `POST` | `/v4/secrets/{key}` |
|
|
84
|
-
| **Create Many** | Create multiple secrets in one request | `POST` | `/
|
|
65
|
+
| **Create Many** | Create multiple secrets in one request | `POST` | `/v4/secrets/batch` |
|
|
85
66
|
| **Update** | Update a single secret | `PATCH` | `/v4/secrets/{key}` |
|
|
86
|
-
| **Update Many** | Update multiple secrets in one request | `PATCH` | `/
|
|
67
|
+
| **Update Many** | Update multiple secrets in one request | `PATCH` | `/v4/secrets/batch` |
|
|
87
68
|
| **Delete** | Delete a single secret by key | `DELETE` | `/v4/secrets/{key}` |
|
|
69
|
+
| **Delete Many** | Delete multiple secrets in one request | `DELETE` | `/v4/secrets/batch` |
|
|
88
70
|
|
|
89
71
|
#### Get
|
|
90
72
|
|
|
@@ -106,11 +88,19 @@ Required: **Secret Key**, **Secret Value**
|
|
|
106
88
|
| Skip Multiline Encoding | Disable multiline encoding for the value |
|
|
107
89
|
| Type | `shared` (default) or `personal` |
|
|
108
90
|
|
|
91
|
+
**Secret Metadata (optional):** Add one or more key/value metadata tags to attach to the secret.
|
|
92
|
+
|
|
109
93
|
#### Create Many
|
|
110
94
|
|
|
111
95
|
Add secrets using the repeatable **Secrets** list. Each entry requires **Secret Key** and **Secret Value**.
|
|
112
96
|
|
|
113
|
-
Per-secret optional fields:
|
|
97
|
+
Per-secret optional fields:
|
|
98
|
+
|
|
99
|
+
| Field | Description |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| Secret Comment | Attach a comment to this secret |
|
|
102
|
+
| Skip Multiline Encoding | Disable multiline encoding for this secret's value |
|
|
103
|
+
| Secret Metadata | Key/value metadata tags for this secret |
|
|
114
104
|
|
|
115
105
|
**Additional Fields (optional):**
|
|
116
106
|
|
|
@@ -124,9 +114,9 @@ Returns each created secret as a separate output item. If a secret protection po
|
|
|
124
114
|
|
|
125
115
|
Required: **Secret Key** (identifies the secret to update)
|
|
126
116
|
|
|
127
|
-
All update values are optional — set only what needs to change
|
|
117
|
+
All update values are optional — set only what needs to change.
|
|
128
118
|
|
|
129
|
-
**Additional Fields:**
|
|
119
|
+
**Additional Fields (optional):**
|
|
130
120
|
|
|
131
121
|
| Field | Description |
|
|
132
122
|
| --- | --- |
|
|
@@ -136,11 +126,21 @@ All update values are optional — set only what needs to change:
|
|
|
136
126
|
| Type | `shared` or `personal` |
|
|
137
127
|
| Skip Multiline Encoding | Disable multiline encoding for the value |
|
|
138
128
|
|
|
129
|
+
**Secret Metadata (optional):** Add one or more key/value metadata tags to attach to the secret.
|
|
130
|
+
|
|
139
131
|
#### Update Many
|
|
140
132
|
|
|
141
133
|
Add secrets using the repeatable **Secrets** list. Each entry requires **Secret Key** (the current name).
|
|
142
134
|
|
|
143
|
-
Per-secret optional fields:
|
|
135
|
+
Per-secret optional fields:
|
|
136
|
+
|
|
137
|
+
| Field | Description |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| Secret Value | The new value (leave blank to keep existing) |
|
|
140
|
+
| New Secret Name | Rename this secret |
|
|
141
|
+
| Secret Comment | Update the comment for this secret |
|
|
142
|
+
| Skip Multiline Encoding | Disable multiline encoding for this secret's value |
|
|
143
|
+
| Secret Metadata | Key/value metadata tags for this secret |
|
|
144
144
|
|
|
145
145
|
**Additional Fields (optional):**
|
|
146
146
|
|
|
@@ -149,71 +149,188 @@ Per-secret optional fields: Secret Value, New Secret Name, Secret Comment, Skip
|
|
|
149
149
|
| Mode | `failOnNotFound` (default) — error if secret missing; `upsert` — create if missing; `ignore` — skip missing secrets |
|
|
150
150
|
| Secret Path Override | Use a different path than the top-level Secret Path for this batch |
|
|
151
151
|
|
|
152
|
-
Returns each updated secret as a separate output item.
|
|
152
|
+
Returns each updated secret as a separate output item. If a secret protection policy is active, returns an approval object instead.
|
|
153
153
|
|
|
154
154
|
#### Delete
|
|
155
155
|
|
|
156
156
|
Required: **Secret Key**
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
#### Delete Many
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
Add secrets using the repeatable **Secrets** list. Each entry requires **Secret Key** and **Type** (`shared` or `personal`).
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
**Additional Fields (optional):**
|
|
163
|
+
|
|
164
|
+
| Field | Description |
|
|
163
165
|
| --- | --- |
|
|
164
|
-
|
|
|
166
|
+
| Secret Path Override | Use a different path than the top-level Secret Path for this batch |
|
|
165
167
|
|
|
166
168
|
---
|
|
167
169
|
|
|
168
|
-
|
|
170
|
+
### Project
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
| Operation | Description | Method | API endpoint |
|
|
173
|
+
| --- | --- | --- | --- |
|
|
174
|
+
| **Get** | Fetch a project by ID | `GET` | `/v1/projects/{id}` |
|
|
175
|
+
| **Get by Slug** | Fetch a project by slug | `GET` | `/v1/projects/slug/{slug}` |
|
|
176
|
+
| **Get Many** | List all accessible projects | `GET` | `/v1/projects` |
|
|
177
|
+
| **Get Secret Snapshots** | List secret snapshots for a project environment | `GET` | `/v1/projects/{id}/secret-snapshots` |
|
|
178
|
+
| **Get User Memberships** | List all user memberships in a project | `GET` | `/v1/projects/{id}/memberships` |
|
|
179
|
+
| **Get User by Username** | Fetch a project member by username | `POST` | `/v1/projects/{id}/memberships/details` |
|
|
180
|
+
|
|
181
|
+
#### Get Project
|
|
182
|
+
|
|
183
|
+
Required: **Project ID**
|
|
184
|
+
|
|
185
|
+
#### Get by Slug
|
|
186
|
+
|
|
187
|
+
Required: **Project Slug**
|
|
188
|
+
|
|
189
|
+
#### Get Many Projects
|
|
190
|
+
|
|
191
|
+
No extra required fields. Returns each project as a separate output item.
|
|
192
|
+
|
|
193
|
+
#### Get Secret Snapshots
|
|
194
|
+
|
|
195
|
+
Required: **Project ID**, **Environment**
|
|
196
|
+
|
|
197
|
+
**Additional Fields (optional):**
|
|
198
|
+
|
|
199
|
+
| Field | Description |
|
|
200
|
+
| --- | --- |
|
|
201
|
+
| Secret Path | Filter snapshots by path (default: `/`) |
|
|
202
|
+
| Offset | Number of results to skip (for pagination) |
|
|
203
|
+
| Limit | Maximum number of results to return |
|
|
204
|
+
|
|
205
|
+
Returns each snapshot as a separate output item.
|
|
206
|
+
|
|
207
|
+
#### Get User Memberships
|
|
208
|
+
|
|
209
|
+
Required: **Project ID**
|
|
210
|
+
|
|
211
|
+
Returns each membership as a separate output item.
|
|
212
|
+
|
|
213
|
+
#### Get User by Username
|
|
214
|
+
|
|
215
|
+
Required: **Project ID**, **Username**
|
|
174
216
|
|
|
175
217
|
---
|
|
176
218
|
|
|
177
|
-
|
|
219
|
+
### Folder
|
|
178
220
|
|
|
179
|
-
|
|
221
|
+
All Folder operations except **Get Folder by ID** require: **Project ID**, **Environment**, **Folder Path** (default: `/`).
|
|
180
222
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
223
|
+
| Operation | Description | Method | API endpoint |
|
|
224
|
+
| --- | --- | --- | --- |
|
|
225
|
+
| **Get Folder by ID** | Fetch a folder by its ID | `GET` | `/v2/folders/{id}` |
|
|
226
|
+
| **List Folders** | List all folders at a path | `GET` | `/v2/folders` |
|
|
227
|
+
| **Create** | Create a new folder | `POST` | `/v2/folders` |
|
|
228
|
+
| **Update** | Rename or update a folder | `PATCH` | `/v2/folders/{id}` |
|
|
229
|
+
| **Delete** | Delete a folder | `DELETE` | `/v2/folders/{id}` |
|
|
185
230
|
|
|
186
|
-
|
|
231
|
+
#### Get Folder by ID
|
|
187
232
|
|
|
188
|
-
|
|
189
|
-
2. Fill in **Project ID**, **Environment**, **Secret Path**
|
|
190
|
-
3. Each secret is output as a separate item
|
|
233
|
+
Required: **Folder ID**
|
|
191
234
|
|
|
192
|
-
|
|
235
|
+
#### List Folders
|
|
193
236
|
|
|
194
|
-
|
|
195
|
-
2. Fill in **Project ID**, **Environment**, **Secret Path**, **Secret Key**, **Secret Value**
|
|
196
|
-
3. Optionally add a comment or set the type via **Additional Fields**
|
|
237
|
+
Required: **Project ID**, **Environment**, **Folder Path**
|
|
197
238
|
|
|
198
|
-
|
|
239
|
+
**Additional Fields (optional):**
|
|
199
240
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
241
|
+
| Field | Description |
|
|
242
|
+
| --- | --- |
|
|
243
|
+
| Recursive | Return all nested subfolders as well |
|
|
244
|
+
| Last Secret Modified | Filter folders by last secret modification time |
|
|
204
245
|
|
|
205
|
-
|
|
246
|
+
Returns each folder as a separate output item.
|
|
206
247
|
|
|
207
|
-
|
|
208
|
-
2. Fill in **Project ID**, **Environment**, **Secret Path**, **Secret Key**
|
|
209
|
-
3. Open **Additional Fields** → set **New Secret Name** and/or **Secret Value**
|
|
248
|
+
#### Create Folder
|
|
210
249
|
|
|
211
|
-
|
|
250
|
+
Required: **Project ID**, **Environment**, **Folder Path** (parent path), **Folder Name**
|
|
212
251
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
252
|
+
**Additional Fields (optional):**
|
|
253
|
+
|
|
254
|
+
| Field | Description |
|
|
255
|
+
| --- | --- |
|
|
256
|
+
| Description | A description for the folder |
|
|
257
|
+
|
|
258
|
+
#### Update Folder
|
|
259
|
+
|
|
260
|
+
Required: **Project ID**, **Environment**, **Folder Path**, **Folder ID**, **Folder Name** (new name)
|
|
261
|
+
|
|
262
|
+
**Additional Fields (optional):**
|
|
263
|
+
|
|
264
|
+
| Field | Description |
|
|
265
|
+
| --- | --- |
|
|
266
|
+
| Description | A description for the folder |
|
|
267
|
+
|
|
268
|
+
#### Delete Folder
|
|
269
|
+
|
|
270
|
+
Required: **Project ID**, **Environment**, **Folder Path**, **Folder ID or Name**
|
|
271
|
+
|
|
272
|
+
**Additional Fields (optional):**
|
|
273
|
+
|
|
274
|
+
| Field | Description |
|
|
275
|
+
| --- | --- |
|
|
276
|
+
| Force Delete | Delete the folder even if it contains secrets or subfolders |
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## InfisicalSync
|
|
281
|
+
|
|
282
|
+
The **InfisicalSync** node provides bidirectional sync between n8n credentials and Infisical secrets. It requires an **InfisicalApi** credential (to authenticate to Infisical) and optionally an **n8nApi** credential (to read and write n8n credentials via the REST API).
|
|
283
|
+
|
|
284
|
+
### Sync Operations
|
|
285
|
+
|
|
286
|
+
| Operation | Direction | Description |
|
|
287
|
+
| --- | --- | --- |
|
|
288
|
+
| **Sync to Infisical** | n8n → Infisical | Push an n8n credential as a folder of secrets in Infisical. Each field becomes a secret; a `n8n_credential_type` metadata tag is attached to every secret for auto-discovery. Supports **Form** mode (select credential type from a dropdown and fill individual fields) and **JSON** mode (paste any credential type as a raw JSON object). When an n8nApi credential is configured, the input is validated against the n8n schema before any Infisical write occurs. |
|
|
289
|
+
| **Sync from Infisical** | Infisical → n8n | Pull all secrets from a named Infisical folder and update an existing n8n credential by ID. |
|
|
290
|
+
| **Auto Sync from Infisical** | Infisical → n8n | Discover all subfolders under a root Infisical path, read the `n8n_credential_type` metadata tag from each folder's secrets, then create or update the matching n8n credentials automatically. Uses the n8n REST API and validates credential data against each type's JSON Schema before saving. |
|
|
291
|
+
|
|
292
|
+
### Supported Credential Types (Form Mode)
|
|
293
|
+
|
|
294
|
+
Form mode supports **31 credential types**. JSON mode accepts any type registered in n8n.
|
|
295
|
+
|
|
296
|
+
#### AI / LLM
|
|
297
|
+
|
|
298
|
+
`anthropicApi`, `openAiApi`, `groqApi`, `cohereApi`, `huggingFaceApi`, `mistralCloudApi`
|
|
299
|
+
|
|
300
|
+
#### Productivity / Project Management
|
|
301
|
+
|
|
302
|
+
`jiraSoftwareCloudApi`
|
|
303
|
+
|
|
304
|
+
#### Messaging / Webhooks
|
|
305
|
+
|
|
306
|
+
`discordBotApi`, `discordWebhookApi`
|
|
307
|
+
|
|
308
|
+
#### Google
|
|
309
|
+
|
|
310
|
+
`googleApi`, `googleOAuth2Api`, `googleSheetsOAuth2Api`, `googleDriveOAuth2Api`, `googleDocsOAuth2Api`
|
|
311
|
+
|
|
312
|
+
#### Databases
|
|
313
|
+
|
|
314
|
+
`mySql`, `postgres`, `mongoDb`, `microsoftSql`, `redis`
|
|
315
|
+
|
|
316
|
+
#### Infrastructure
|
|
317
|
+
|
|
318
|
+
`n8nApi`, `infisicalApi`
|
|
319
|
+
|
|
320
|
+
#### Generic HTTP Auth
|
|
321
|
+
|
|
322
|
+
`httpBearerAuth`, `httpBasicAuth`, `httpDigestAuth`, `httpHeaderAuth`, `httpQueryAuth`, `httpCustomAuth`, `httpSslAuth`, `oAuth1Api`, `oAuth2Api`, `jwtAuth`
|
|
323
|
+
|
|
324
|
+
> **Note**: `httpMultipleHeadersAuth` is not supported in form mode because its `headers` field is a `fixedCollection` that cannot be serialised to flat Infisical key-value secrets. Use JSON mode for that type.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## API behaviour notes
|
|
329
|
+
|
|
330
|
+
- All operations use **Infisical API v4** for single-secret endpoints (`/api/v4/secrets/…`) and batch secret endpoints (`/api/v4/secrets/batch`).
|
|
331
|
+
- Project operations use **Infisical API v1** (`/api/v1/projects/…`).
|
|
332
|
+
- Folder operations use **Infisical API v2** (`/api/v2/folders/…`).
|
|
333
|
+
- When a **secret protection policy** is active on the project, create/update/delete endpoints return an approval object (`{ approval: { id, status, … } }`) instead of the secret directly.
|
|
217
334
|
|
|
218
335
|
---
|
|
219
336
|
|
|
@@ -221,9 +338,9 @@ The Delete request sends `projectId`, `environment`, and `secretPath` in the JSO
|
|
|
221
338
|
|
|
222
339
|
| Component | Version |
|
|
223
340
|
| --- | --- |
|
|
224
|
-
| n8n |
|
|
341
|
+
| n8n | v2.21.5 |
|
|
225
342
|
| Infisical | Cloud and Community Edition |
|
|
226
|
-
| Infisical API | v4
|
|
343
|
+
| Infisical API | v4 |
|
|
227
344
|
| n8n Nodes API | v1 |
|
|
228
345
|
|
|
229
346
|
---
|