@relazio/plugin-sdk 0.1.0 โ†’ 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +96 -199
  2. package/package.json +2 -3
package/README.md CHANGED
@@ -1,84 +1,30 @@
1
- # Relazio - Plugin SDK
1
+ # Relazio Plugin SDK
2
2
 
3
- > Official SDK for building external plugins for Relazio
3
+ Official SDK for building external plugins for the Relazio OSINT platform.
4
4
 
5
- [![Status](https://img.shields.io/badge/Status-In%20Development-yellow.svg)](https://github.com/relazio/plugin-sdk)
5
+ [![npm version](https://img.shields.io/npm/v/@relazio/plugin-sdk.svg)](https://www.npmjs.com/package/@relazio/plugin-sdk)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- **Platform**: Relazio (dal latino *relatio* - relazione, rapporto)
9
- **Platform Version**: 2.0.0
10
- **SDK Status**: ๐Ÿ“‹ Documentation Phase
11
- **Target Release**: Q1 2026
8
+ ## Overview
12
9
 
13
- ---
10
+ The Relazio Plugin SDK enables developers to create external plugins that extend the Relazio platform's capabilities. The SDK provides a complete framework for building secure, multi-tenant plugins with minimal boilerplate code.
14
11
 
15
- ## ๐Ÿ“‹ Overview
12
+ ## Features
16
13
 
17
- Questo repository contiene la documentazione e, in futuro, il codice sorgente dell'SDK ufficiale per creare plugin esterni per **Relazio**.
14
+ - **Multi-Tenant Support**: Automatic organization management with isolated configurations
15
+ - **Sync & Async Transforms**: Support for both immediate and long-running operations
16
+ - **Automatic Endpoints**: Built-in `/register`, `/unregister`, and `/manifest.json` endpoints
17
+ - **Security**: HMAC-SHA256 signature generation and validation
18
+ - **Job Management**: Progress tracking and webhook notifications for async operations
19
+ - **TypeScript**: Full type safety and IntelliSense support
18
20
 
19
- ### Platform Features Implemented โœ…
20
-
21
- Il sistema plugin esterni della piattaforma รจ **PRODUCTION READY** (Dicembre 2025):
22
-
23
- - โœ… Manifest validation (HTTPS, TLS, Zod)
24
- - โœ… Installation flow completo
25
- - โœ… Webhook system con HMAC-SHA256
26
- - โœ… Job queue con 7 stati
27
- - โœ… Rate limiting (30/min, 500/hour, 2000/day)
28
- - โœ… Timeout enforcement (30 min max)
29
- - โœ… Security completa
30
- - โœ… E2E testing (44 test, 91% pass)
31
-
32
- ### SDK Packages Status
33
-
34
- - โœ… `@relazio/plugin-sdk` - NPM package (TypeScript/JavaScript) - **COMPLETO** โญ
35
- - โœ… Core plugin system
36
- - โœ… Sync & async transforms
37
- - โœ… HMAC signature utilities
38
- - โœ… Job progress tracking
39
- - โœ… Express server integration
40
- - โœ… **Multi-tenant support** (NEW!)
41
- - [ ] `relazio-plugin-sdk` - PyPI package (Python) - Q1 2026
42
- - [ ] CLI tool per scaffold plugin - Q1 2026
43
- - [ ] Mock platform per testing locale - Q2 2026
44
- - โœ… Repository esempi plugin - **4 esempi disponibili**
45
-
46
- ---
47
-
48
- ## ๐Ÿ“š Documentazione
49
-
50
- Tutta la documentazione รจ disponibile nella cartella `docs/`:
51
-
52
- ### Per Utenti
53
-
54
- - **[EXTERNAL_PLUGINS_README.md](docs/EXTERNAL_PLUGINS_README.md)** - Quick start guide per installare e usare plugin esterni
55
-
56
- ### Per Sviluppatori
57
-
58
- - **[QUICKSTART.md](QUICKSTART.md)** - โญ Quick start per creare plugin (3 righe di codice!)
59
- - **[SDK.md](docs/SDK.md)** - โญ SDK API reference completa (TypeScript/Python)
60
- - **[MULTI_TENANT.md](docs/MULTI_TENANT.md)** - Guida multi-tenancy (architettura standard)
61
- - **[CONFIGURATION.md](docs/CONFIGURATION.md)** - Guida configurazione (string, number, boolean, select)
62
- - **[EXTERNAL_PLUGINS.md](docs/EXTERNAL_PLUGINS.md)** - Architettura sistema plugin esterni
63
- - **[EXTERNAL_PLUGINS_FLOW.md](docs/EXTERNAL_PLUGINS_FLOW.md)** - Flussi dettagliati step-by-step
64
- - **[IMPLEMENTATION_EXTERNAL_PLUGINS.md](docs/IMPLEMENTATION_EXTERNAL_PLUGINS.md)** - Piano implementazione (reference)
65
-
66
- ### Reference
67
-
68
- - **[EXTERNAL_PLUGINS_COMPLETE.md](docs/EXTERNAL_PLUGINS_COMPLETE.md)** - Riepilogo completo dell'implementazione platform
69
- - **[PLUGIN_SYSTEM.md](docs/PLUGIN_SYSTEM.md)** - Plugin built-in (reference)
70
-
71
- ---
72
-
73
- ## ๐Ÿš€ Quick Start
74
-
75
- ### Installazione
21
+ ## Installation
76
22
 
77
23
  ```bash
78
24
  npm install @relazio/plugin-sdk
79
25
  ```
80
26
 
81
- ### Esempio Minimo
27
+ ## Quick Start
82
28
 
83
29
  ```typescript
84
30
  import { RelazioPlugin } from '@relazio/plugin-sdk';
@@ -88,11 +34,10 @@ const plugin = new RelazioPlugin({
88
34
  name: 'My Plugin',
89
35
  version: '1.0.0',
90
36
  author: 'Your Name',
91
- description: 'What it does',
37
+ description: 'Plugin description',
92
38
  category: 'network'
93
39
  });
94
40
 
95
- // Registra transform
96
41
  plugin.transform({
97
42
  id: 'my-transform',
98
43
  name: 'My Transform',
@@ -100,156 +45,108 @@ plugin.transform({
100
45
  inputType: 'domain',
101
46
  outputTypes: ['ip'],
102
47
 
103
- handler: async (input, config) => {
104
- // input.organizationId contiene l'ID dell'organizzazione
105
- console.log(`Processing for org: ${input.organizationId}`);
106
-
48
+ async handler(input, config) {
107
49
  return {
108
- entities: [
109
- {
110
- type: 'ip',
111
- value: '8.8.8.8',
112
- label: 'Google DNS'
113
- }
114
- ],
50
+ entities: [{
51
+ type: 'ip',
52
+ value: '8.8.8.8',
53
+ label: 'Google DNS'
54
+ }],
115
55
  edges: []
116
56
  };
117
57
  }
118
58
  });
119
59
 
120
- // Avvia server multi-tenant
121
- plugin.start({
60
+ await plugin.start({
122
61
  port: 3000,
123
- multiTenant: true // โ† Gestisce automaticamente tutto!
62
+ multiTenant: true
124
63
  });
125
64
  ```
126
65
 
127
- **๐ŸŽ‰ Il plugin gestisce automaticamente:**
128
- - โœ… Endpoint `/register` per nuove organizzazioni
129
- - โœ… Generazione automatica webhook secrets
130
- - โœ… Gestione separata per ogni organization
131
- - โœ… Zero configurazione manuale necessaria!
132
-
133
- ### Esempi Completi
134
-
135
- Vedi la cartella `examples/` per esempi funzionanti:
136
- - **Email Parser** - Transform sincrona semplice
137
- - **DNS Toolkit** - Multiple transforms sincrone
138
- - **Multi-Tenant Plugin** - Transform asincrona con multi-organization
139
-
140
- ---
141
-
142
- ## ๐ŸŽฏ Roadmap
143
-
144
- ### Phase 1: Documentation โœ… (Completata - Dicembre 2025)
145
- - [x] Architecture design
146
- - [x] SDK API design
147
- - [x] Flow documentation
148
- - [x] Security requirements
149
- - [x] Platform implementation
150
-
151
- ### Phase 2: TypeScript SDK โœ… (Completata - Dicembre 2025)
152
- - [x] Core SDK implementation
153
- - [x] Manifest generator
154
- - [x] HMAC signing utilities
155
- - [x] Webhook handler
156
- - [x] Job progress tracking
157
- - [x] Testing utilities
158
- - [x] Esempi funzionanti
159
- - [ ] NPM package publication (Q1 2026)
160
- - [ ] CLI tool (Q1 2026)
161
-
162
- ### Phase 3: Python SDK (Q1 2026)
163
- - [ ] Core SDK implementation
164
- - [ ] Manifest generator
165
- - [ ] HMAC signing utilities
166
- - [ ] Webhook handler (Flask/FastAPI)
167
- - [ ] Job progress tracking
168
- - [ ] Testing utilities
169
- - [ ] CLI tool
170
- - [ ] PyPI package publication
171
-
172
- ### Phase 4: Developer Experience (Q2 2026)
173
- - [ ] Developer portal
174
- - [ ] Plugin examples repository
175
- - [ ] Video tutorials
176
- - [ ] Plugin templates (starter kits)
177
- - [ ] Testing playground
178
- - [ ] Plugin marketplace submission
179
-
180
- ---
181
-
182
- ## ๐Ÿ” Security Requirements
183
-
184
- ### Mandatory (Enforced by Platform)
185
-
186
- - โœ… **HTTPS**: All endpoints must use HTTPS (HTTP rejected)
187
- - โœ… **TLS Valid**: Valid SSL certificate required
188
- - โœ… **HMAC Signature**: All webhooks must be signed with HMAC-SHA256
189
- - โœ… **Rate Limiting**: 30 req/min, 500 req/hour, 2000 req/day
190
- - โœ… **Timeouts**: 30s sync, 5s async response, 30 min job max
191
-
192
- ### SDK Handles
193
-
194
- - HMAC signature generation
195
- - Webhook endpoint setup
196
- - Job progress tracking
197
- - Error handling
198
- - Timeout awareness
199
-
200
- ---
201
-
202
- ## ๐Ÿ“ฆ Package Structure (Future)
66
+ ## Documentation
203
67
 
204
- ```
205
- @relazio/plugin-sdk/
206
- โ”œโ”€โ”€ src/
207
- โ”‚ โ”œโ”€โ”€ core/
208
- โ”‚ โ”‚ โ”œโ”€โ”€ plugin.ts # Main Plugin class
209
- โ”‚ โ”‚ โ”œโ”€โ”€ manifest.ts # Manifest generator
210
- โ”‚ โ”‚ โ””โ”€โ”€ types.ts # TypeScript types
211
- โ”‚ โ”œโ”€โ”€ server/
212
- โ”‚ โ”‚ โ”œโ”€โ”€ express.ts # Express integration
213
- โ”‚ โ”‚ โ””โ”€โ”€ fastify.ts # Fastify integration
214
- โ”‚ โ”œโ”€โ”€ security/
215
- โ”‚ โ”‚ โ””โ”€โ”€ hmac.ts # HMAC utilities
216
- โ”‚ โ”œโ”€โ”€ jobs/
217
- โ”‚ โ”‚ โ””โ”€โ”€ progress.ts # Job progress tracking
218
- โ”‚ โ””โ”€โ”€ testing/
219
- โ”‚ โ””โ”€โ”€ mock-platform.ts # Mock platform for tests
220
- โ”œโ”€โ”€ examples/
221
- โ”‚ โ”œโ”€โ”€ dns-plugin/
222
- โ”‚ โ”œโ”€โ”€ ip-lookup/
223
- โ”‚ โ””โ”€โ”€ shodan-integration/
224
- โ””โ”€โ”€ docs/
225
- โ””โ”€โ”€ (all documentation files)
226
- ```
68
+ - [Examples](./examples/) - Working plugin examples
69
+ - [Changelog](./CHANGELOG.md) - Version history
70
+
71
+ ## Multi-Tenant Architecture
72
+
73
+ The SDK automatically handles organization registration and management:
74
+
75
+ 1. Platform requests `/register` with organization details
76
+ 2. SDK generates unique webhook secret
77
+ 3. SDK stores organization configuration
78
+ 4. Platform receives webhook secret
79
+ 5. Plugin processes requests with organization isolation
80
+
81
+ ## Security
82
+
83
+ All plugins must implement the following security requirements:
84
+
85
+ - **HTTPS**: Production endpoints must use HTTPS
86
+ - **HMAC Signatures**: All webhooks are signed with HMAC-SHA256
87
+ - **Rate Limiting**: Enforced by the platform (30 req/min, 500 req/hour)
88
+ - **Timeouts**: 30s for sync transforms, 30 minutes maximum for async jobs
89
+
90
+ ## API Reference
227
91
 
228
- ---
92
+ ### Core Classes
229
93
 
230
- ## ๐Ÿค Contributing
94
+ #### RelazioPlugin
231
95
 
232
- Il progetto รจ attualmente in fase di sviluppo. I contributi saranno benvenuti a partire da Q1 2026.
96
+ Main plugin class that manages transforms and server lifecycle.
233
97
 
234
- ---
98
+ ```typescript
99
+ const plugin = new RelazioPlugin(config: PluginConfig)
100
+ ```
235
101
 
236
- ## ๐Ÿ“„ License
102
+ #### Transform Registration
103
+
104
+ ```typescript
105
+ // Synchronous transform
106
+ plugin.transform({
107
+ id: string,
108
+ name: string,
109
+ description: string,
110
+ inputType: EntityType,
111
+ outputTypes: EntityType[],
112
+ handler: async (input, config) => TransformResult
113
+ })
114
+
115
+ // Asynchronous transform
116
+ plugin.asyncTransform({
117
+ id: string,
118
+ name: string,
119
+ description: string,
120
+ inputType: EntityType,
121
+ outputTypes: EntityType[],
122
+ handler: async (input, config, job) => TransformResult
123
+ })
124
+ ```
237
125
 
238
- MIT License - see LICENSE file for details.
126
+ #### Server Management
239
127
 
240
- ---
128
+ ```typescript
129
+ await plugin.start({
130
+ port: number,
131
+ host?: string,
132
+ multiTenant?: boolean,
133
+ https?: { key: string, cert: string }
134
+ })
135
+
136
+ await plugin.stop()
137
+ ```
241
138
 
242
- ## ๐Ÿ”— Links
139
+ ## Requirements
243
140
 
244
- - **Platform Repository**: [github.com/relazio/relazio](https://github.com/relazio/relazio)
245
- - **Documentation**: [docs/](docs/)
246
- - **Website**: Coming soon
247
- - **Discord**: Coming soon
141
+ - Node.js >= 18.0.0
142
+ - TypeScript >= 5.0.0 (for development)
248
143
 
249
- ---
144
+ ## License
250
145
 
251
- **Status**: ๐Ÿ“‹ Documentation Complete, Implementation Q1 2026
252
- **Platform**: โœ… Production Ready (Dicembre 2025)
253
- **SDK**: ๐Ÿšง In Development (Q1 2026)
146
+ MIT License - see [LICENSE](./LICENSE) file for details.
254
147
 
148
+ ## Links
255
149
 
150
+ - [npm Package](https://www.npmjs.com/package/@relazio/plugin-sdk)
151
+ - [GitHub Repository](https://github.com/relazio/plugin-sdk)
152
+ - [Issue Tracker](https://github.com/relazio/plugin-sdk/issues)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relazio/plugin-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Official SDK for building external plugins for Relazio",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "license": "MIT",
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/relazio/plugin-sdk.git"
25
+ "url": "git+https://github.com/relazio/plugin-sdk.git"
26
26
  },
27
27
  "files": [
28
28
  "dist",
@@ -49,4 +49,3 @@
49
49
  "node": ">=18.0.0"
50
50
  }
51
51
  }
52
-