dominusnode-dify 1.0.0__tar.gz

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.

Potentially problematic release.


This version of dominusnode-dify might be problematic. Click here for more details.

@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dominus Node
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.1
2
+ Name: dominusnode-dify
3
+ Version: 1.0.0
4
+ Summary: DomiNode tool provider for Dify -- 22 proxy, wallet, and team management tools
5
+ License: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: httpx>=0.25.0
10
+ Provides-Extra: dev
11
+ Requires-Dist: pytest>=7.0; extra == "dev"
12
+
13
+ # dominusnode-dify
14
+
15
+ Dify tool provider for the [DomiNode](https://dominusnode.com) rotating proxy-as-a-service platform. Provides 22 tools for proxy management, wallet operations, team administration, and payment processing.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install dominusnode-dify
21
+ ```
22
+
23
+ Or install from source:
24
+
25
+ ```bash
26
+ cd integrations/dify
27
+ pip install -e ".[dev]"
28
+ ```
29
+
30
+ ## Dify Plugin Structure
31
+
32
+ This integration follows the Dify tool provider convention:
33
+
34
+ ```
35
+ integrations/dify/
36
+ provider/dominusnode.yaml # Provider definition (credentials)
37
+ tools/*.yaml # 22 tool YAML definitions
38
+ dominusnode_dify/tools.py # Python implementation
39
+ ```
40
+
41
+ ### Provider Credentials
42
+
43
+ The provider YAML (`provider/dominusnode.yaml`) defines three credentials:
44
+
45
+ | Credential | Type | Required | Default |
46
+ |-----------|------|----------|---------|
47
+ | `api_key` | secret-input | Yes | - |
48
+ | `base_url` | text-input | No | `https://api.dominusnode.com` |
49
+ | `proxy_host` | text-input | No | `proxy.dominusnode.com` |
50
+
51
+ ### Environment Variables
52
+
53
+ Alternatively, set environment variables:
54
+
55
+ ```bash
56
+ export DOMINUSNODE_API_KEY="dn_live_your_api_key_here"
57
+ export DOMINUSNODE_BASE_URL="https://api.dominusnode.com"
58
+ export DOMINUSNODE_PROXY_HOST="proxy.dominusnode.com"
59
+ export DOMINUSNODE_PROXY_PORT="8080"
60
+ ```
61
+
62
+ ## Quick Start (Python API)
63
+
64
+ ```python
65
+ from dominusnode_dify import DominusNodeProvider
66
+
67
+ # Create provider with Dify-style credentials dict
68
+ provider = DominusNodeProvider(credentials={
69
+ "api_key": "dn_live_...",
70
+ "base_url": "https://api.dominusnode.com",
71
+ "proxy_host": "proxy.dominusnode.com",
72
+ })
73
+
74
+ # Check wallet balance
75
+ result = provider.check_balance({})
76
+ print(result) # {"balanceCents": 5000}
77
+
78
+ # Fetch a URL through rotating proxies
79
+ result = provider.proxied_fetch({
80
+ "url": "https://example.com",
81
+ "country": "US",
82
+ "proxy_type": "dc",
83
+ })
84
+
85
+ # Use the tool dispatcher (how Dify invokes tools)
86
+ result = provider.invoke_tool("check_balance", {})
87
+ result = provider.invoke_tool("proxied_fetch", {"url": "https://example.com"})
88
+ ```
89
+
90
+ ## Tools (22 total)
91
+
92
+ ### Proxy Tools
93
+
94
+ | Tool | Description | Required Parameters |
95
+ |------|-------------|-------------------|
96
+ | `proxied_fetch` | Fetch URL through rotating proxy | `url` |
97
+ | `get_proxy_config` | Get proxy configuration | - |
98
+ | `list_sessions` | List active proxy sessions | - |
99
+
100
+ ### Wallet Tools
101
+
102
+ | Tool | Description | Required Parameters |
103
+ |------|-------------|-------------------|
104
+ | `check_balance` | Check wallet balance | - |
105
+ | `check_usage` | Check usage statistics | - |
106
+ | `topup_paypal` | Create PayPal top-up order | `amount_cents` |
107
+ | `x402_info` | Get x402 micropayment info | - |
108
+
109
+ ### Agentic Wallet Tools
110
+
111
+ | Tool | Description | Required Parameters |
112
+ |------|-------------|-------------------|
113
+ | `create_agentic_wallet` | Create sub-wallet with spending limit | `label`, `spending_limit_cents` |
114
+ | `fund_agentic_wallet` | Fund agentic wallet from main wallet | `wallet_id`, `amount_cents` |
115
+ | `agentic_wallet_balance` | Check agentic wallet balance | `wallet_id` |
116
+ | `list_agentic_wallets` | List all agentic wallets | - |
117
+ | `agentic_transactions` | Get agentic wallet transactions | `wallet_id` |
118
+ | `freeze_agentic_wallet` | Freeze agentic wallet | `wallet_id` |
119
+ | `unfreeze_agentic_wallet` | Unfreeze agentic wallet | `wallet_id` |
120
+ | `delete_agentic_wallet` | Delete agentic wallet | `wallet_id` |
121
+
122
+ ### Team Tools
123
+
124
+ | Tool | Description | Required Parameters |
125
+ |------|-------------|-------------------|
126
+ | `create_team` | Create team with shared wallet | `name` |
127
+ | `list_teams` | List all teams | - |
128
+ | `team_details` | Get team details | `team_id` |
129
+ | `team_fund` | Fund team wallet | `team_id`, `amount_cents` |
130
+ | `team_create_key` | Create team API key | `team_id`, `label` |
131
+ | `team_usage` | Get team usage history | `team_id` |
132
+ | `update_team` | Update team settings | `team_id` |
133
+ | `update_team_member_role` | Change member role | `team_id`, `user_id`, `role` |
134
+
135
+ ## Usage Examples
136
+
137
+ ### Proxied Fetch with Geo-Targeting
138
+
139
+ ```python
140
+ # Fetch through a US datacenter proxy ($3/GB)
141
+ result = provider.proxied_fetch({
142
+ "url": "https://example.com",
143
+ "country": "US",
144
+ "proxy_type": "dc",
145
+ })
146
+
147
+ # Fetch through a German residential proxy ($5/GB)
148
+ result = provider.proxied_fetch({
149
+ "url": "https://example.de",
150
+ "country": "DE",
151
+ "proxy_type": "residential",
152
+ })
153
+ ```
154
+
155
+ ### Agentic Wallet Management
156
+
157
+ ```python
158
+ # Create a sub-wallet for an AI agent with $10 spending limit
159
+ wallet = provider.create_agentic_wallet({
160
+ "label": "Research Agent",
161
+ "spending_limit_cents": 1000,
162
+ })
163
+
164
+ # Fund it with $5 from main wallet
165
+ provider.fund_agentic_wallet({
166
+ "wallet_id": wallet["id"],
167
+ "amount_cents": 500,
168
+ })
169
+
170
+ # Check balance
171
+ print(provider.agentic_wallet_balance({"wallet_id": wallet["id"]}))
172
+
173
+ # Freeze if needed
174
+ provider.freeze_agentic_wallet({"wallet_id": wallet["id"]})
175
+ ```
176
+
177
+ ### Team Management
178
+
179
+ ```python
180
+ # Create a team
181
+ team = provider.create_team({"name": "Research Team", "max_members": 10})
182
+
183
+ # Fund the team wallet
184
+ provider.team_fund({
185
+ "team_id": team["id"],
186
+ "amount_cents": 5000,
187
+ })
188
+
189
+ # Create a team API key
190
+ key = provider.team_create_key({
191
+ "team_id": team["id"],
192
+ "label": "Agent Key",
193
+ })
194
+ ```
195
+
196
+ ### Dify Tool Dispatch
197
+
198
+ ```python
199
+ # The invoke_tool method is designed for Dify's tool invocation system
200
+ result = provider.invoke_tool("proxied_fetch", {
201
+ "url": "https://example.com",
202
+ "country": "GB",
203
+ "proxy_type": "residential",
204
+ })
205
+
206
+ result = provider.invoke_tool("create_team", {
207
+ "name": "My Team",
208
+ "max_members": 5,
209
+ })
210
+
211
+ # List all available tools
212
+ tools = DominusNodeProvider.get_tools()
213
+ for tool in tools:
214
+ print(tool)
215
+ ```
216
+
217
+ ## Security
218
+
219
+ This integration includes comprehensive security measures:
220
+
221
+ - **SSRF Prevention**: Blocks requests to private IPs (10.x, 172.16-31.x, 192.168.x, 127.x, 0.0.0.0/8, 169.254.x, 100.64-127.x CGNAT, 224+ multicast), IPv6 loopback/ULA/link-local, IPv4-mapped/compatible IPv6, Teredo (2001:0000::/32), 6to4 (2002::/16), hex/octal/decimal encoded IPs
222
+ - **DNS Rebinding Protection**: Resolves hostnames and validates all IP addresses before connecting
223
+ - **TLD Blocking**: .localhost, .local, .internal, .arpa
224
+ - **Credential Protection**: Embedded URL credentials blocked; API keys scrubbed from all error output
225
+ - **OFAC Compliance**: Cuba, Iran, North Korea, Russia, Syria blocked for geo-targeting
226
+ - **HTTP Method Restriction**: Only GET, HEAD, OPTIONS allowed through proxy
227
+ - **Prototype Pollution Prevention**: Dangerous keys stripped from all JSON responses
228
+ - **Response Limits**: 10 MB body cap, 4000 char truncation for LLM context
229
+ - **Redirect Disabled**: No redirect following to prevent open redirect abuse
230
+
231
+ ## Running Tests
232
+
233
+ ```bash
234
+ cd integrations/dify
235
+ pip install -e ".[dev]"
236
+ pytest tests/ -v
237
+ ```
238
+
239
+ ## License
240
+
241
+ MIT
@@ -0,0 +1,229 @@
1
+ # dominusnode-dify
2
+
3
+ Dify tool provider for the [DomiNode](https://dominusnode.com) rotating proxy-as-a-service platform. Provides 22 tools for proxy management, wallet operations, team administration, and payment processing.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install dominusnode-dify
9
+ ```
10
+
11
+ Or install from source:
12
+
13
+ ```bash
14
+ cd integrations/dify
15
+ pip install -e ".[dev]"
16
+ ```
17
+
18
+ ## Dify Plugin Structure
19
+
20
+ This integration follows the Dify tool provider convention:
21
+
22
+ ```
23
+ integrations/dify/
24
+ provider/dominusnode.yaml # Provider definition (credentials)
25
+ tools/*.yaml # 22 tool YAML definitions
26
+ dominusnode_dify/tools.py # Python implementation
27
+ ```
28
+
29
+ ### Provider Credentials
30
+
31
+ The provider YAML (`provider/dominusnode.yaml`) defines three credentials:
32
+
33
+ | Credential | Type | Required | Default |
34
+ |-----------|------|----------|---------|
35
+ | `api_key` | secret-input | Yes | - |
36
+ | `base_url` | text-input | No | `https://api.dominusnode.com` |
37
+ | `proxy_host` | text-input | No | `proxy.dominusnode.com` |
38
+
39
+ ### Environment Variables
40
+
41
+ Alternatively, set environment variables:
42
+
43
+ ```bash
44
+ export DOMINUSNODE_API_KEY="dn_live_your_api_key_here"
45
+ export DOMINUSNODE_BASE_URL="https://api.dominusnode.com"
46
+ export DOMINUSNODE_PROXY_HOST="proxy.dominusnode.com"
47
+ export DOMINUSNODE_PROXY_PORT="8080"
48
+ ```
49
+
50
+ ## Quick Start (Python API)
51
+
52
+ ```python
53
+ from dominusnode_dify import DominusNodeProvider
54
+
55
+ # Create provider with Dify-style credentials dict
56
+ provider = DominusNodeProvider(credentials={
57
+ "api_key": "dn_live_...",
58
+ "base_url": "https://api.dominusnode.com",
59
+ "proxy_host": "proxy.dominusnode.com",
60
+ })
61
+
62
+ # Check wallet balance
63
+ result = provider.check_balance({})
64
+ print(result) # {"balanceCents": 5000}
65
+
66
+ # Fetch a URL through rotating proxies
67
+ result = provider.proxied_fetch({
68
+ "url": "https://example.com",
69
+ "country": "US",
70
+ "proxy_type": "dc",
71
+ })
72
+
73
+ # Use the tool dispatcher (how Dify invokes tools)
74
+ result = provider.invoke_tool("check_balance", {})
75
+ result = provider.invoke_tool("proxied_fetch", {"url": "https://example.com"})
76
+ ```
77
+
78
+ ## Tools (22 total)
79
+
80
+ ### Proxy Tools
81
+
82
+ | Tool | Description | Required Parameters |
83
+ |------|-------------|-------------------|
84
+ | `proxied_fetch` | Fetch URL through rotating proxy | `url` |
85
+ | `get_proxy_config` | Get proxy configuration | - |
86
+ | `list_sessions` | List active proxy sessions | - |
87
+
88
+ ### Wallet Tools
89
+
90
+ | Tool | Description | Required Parameters |
91
+ |------|-------------|-------------------|
92
+ | `check_balance` | Check wallet balance | - |
93
+ | `check_usage` | Check usage statistics | - |
94
+ | `topup_paypal` | Create PayPal top-up order | `amount_cents` |
95
+ | `x402_info` | Get x402 micropayment info | - |
96
+
97
+ ### Agentic Wallet Tools
98
+
99
+ | Tool | Description | Required Parameters |
100
+ |------|-------------|-------------------|
101
+ | `create_agentic_wallet` | Create sub-wallet with spending limit | `label`, `spending_limit_cents` |
102
+ | `fund_agentic_wallet` | Fund agentic wallet from main wallet | `wallet_id`, `amount_cents` |
103
+ | `agentic_wallet_balance` | Check agentic wallet balance | `wallet_id` |
104
+ | `list_agentic_wallets` | List all agentic wallets | - |
105
+ | `agentic_transactions` | Get agentic wallet transactions | `wallet_id` |
106
+ | `freeze_agentic_wallet` | Freeze agentic wallet | `wallet_id` |
107
+ | `unfreeze_agentic_wallet` | Unfreeze agentic wallet | `wallet_id` |
108
+ | `delete_agentic_wallet` | Delete agentic wallet | `wallet_id` |
109
+
110
+ ### Team Tools
111
+
112
+ | Tool | Description | Required Parameters |
113
+ |------|-------------|-------------------|
114
+ | `create_team` | Create team with shared wallet | `name` |
115
+ | `list_teams` | List all teams | - |
116
+ | `team_details` | Get team details | `team_id` |
117
+ | `team_fund` | Fund team wallet | `team_id`, `amount_cents` |
118
+ | `team_create_key` | Create team API key | `team_id`, `label` |
119
+ | `team_usage` | Get team usage history | `team_id` |
120
+ | `update_team` | Update team settings | `team_id` |
121
+ | `update_team_member_role` | Change member role | `team_id`, `user_id`, `role` |
122
+
123
+ ## Usage Examples
124
+
125
+ ### Proxied Fetch with Geo-Targeting
126
+
127
+ ```python
128
+ # Fetch through a US datacenter proxy ($3/GB)
129
+ result = provider.proxied_fetch({
130
+ "url": "https://example.com",
131
+ "country": "US",
132
+ "proxy_type": "dc",
133
+ })
134
+
135
+ # Fetch through a German residential proxy ($5/GB)
136
+ result = provider.proxied_fetch({
137
+ "url": "https://example.de",
138
+ "country": "DE",
139
+ "proxy_type": "residential",
140
+ })
141
+ ```
142
+
143
+ ### Agentic Wallet Management
144
+
145
+ ```python
146
+ # Create a sub-wallet for an AI agent with $10 spending limit
147
+ wallet = provider.create_agentic_wallet({
148
+ "label": "Research Agent",
149
+ "spending_limit_cents": 1000,
150
+ })
151
+
152
+ # Fund it with $5 from main wallet
153
+ provider.fund_agentic_wallet({
154
+ "wallet_id": wallet["id"],
155
+ "amount_cents": 500,
156
+ })
157
+
158
+ # Check balance
159
+ print(provider.agentic_wallet_balance({"wallet_id": wallet["id"]}))
160
+
161
+ # Freeze if needed
162
+ provider.freeze_agentic_wallet({"wallet_id": wallet["id"]})
163
+ ```
164
+
165
+ ### Team Management
166
+
167
+ ```python
168
+ # Create a team
169
+ team = provider.create_team({"name": "Research Team", "max_members": 10})
170
+
171
+ # Fund the team wallet
172
+ provider.team_fund({
173
+ "team_id": team["id"],
174
+ "amount_cents": 5000,
175
+ })
176
+
177
+ # Create a team API key
178
+ key = provider.team_create_key({
179
+ "team_id": team["id"],
180
+ "label": "Agent Key",
181
+ })
182
+ ```
183
+
184
+ ### Dify Tool Dispatch
185
+
186
+ ```python
187
+ # The invoke_tool method is designed for Dify's tool invocation system
188
+ result = provider.invoke_tool("proxied_fetch", {
189
+ "url": "https://example.com",
190
+ "country": "GB",
191
+ "proxy_type": "residential",
192
+ })
193
+
194
+ result = provider.invoke_tool("create_team", {
195
+ "name": "My Team",
196
+ "max_members": 5,
197
+ })
198
+
199
+ # List all available tools
200
+ tools = DominusNodeProvider.get_tools()
201
+ for tool in tools:
202
+ print(tool)
203
+ ```
204
+
205
+ ## Security
206
+
207
+ This integration includes comprehensive security measures:
208
+
209
+ - **SSRF Prevention**: Blocks requests to private IPs (10.x, 172.16-31.x, 192.168.x, 127.x, 0.0.0.0/8, 169.254.x, 100.64-127.x CGNAT, 224+ multicast), IPv6 loopback/ULA/link-local, IPv4-mapped/compatible IPv6, Teredo (2001:0000::/32), 6to4 (2002::/16), hex/octal/decimal encoded IPs
210
+ - **DNS Rebinding Protection**: Resolves hostnames and validates all IP addresses before connecting
211
+ - **TLD Blocking**: .localhost, .local, .internal, .arpa
212
+ - **Credential Protection**: Embedded URL credentials blocked; API keys scrubbed from all error output
213
+ - **OFAC Compliance**: Cuba, Iran, North Korea, Russia, Syria blocked for geo-targeting
214
+ - **HTTP Method Restriction**: Only GET, HEAD, OPTIONS allowed through proxy
215
+ - **Prototype Pollution Prevention**: Dangerous keys stripped from all JSON responses
216
+ - **Response Limits**: 10 MB body cap, 4000 char truncation for LLM context
217
+ - **Redirect Disabled**: No redirect following to prevent open redirect abuse
218
+
219
+ ## Running Tests
220
+
221
+ ```bash
222
+ cd integrations/dify
223
+ pip install -e ".[dev]"
224
+ pytest tests/ -v
225
+ ```
226
+
227
+ ## License
228
+
229
+ MIT
@@ -0,0 +1,64 @@
1
+ """DomiNode Dify integration -- 24 tools for the Dify AI platform.
2
+
3
+ Provides a Dify-compatible tool provider that exposes 24 tools for
4
+ interacting with the DomiNode rotating proxy-as-a-service platform.
5
+
6
+ Tools cover:
7
+ - Proxied HTTP fetching through rotating proxies
8
+ - Wallet balance and usage monitoring
9
+ - Proxy configuration and session listing
10
+ - Agentic wallet management (create, fund, freeze, unfreeze, delete)
11
+ - Team management (create, list, fund, keys, usage, update, role changes)
12
+ - x402 micropayment info
13
+ - PayPal top-up
14
+
15
+ Security:
16
+ - Full SSRF prevention (private IP blocking, DNS rebinding, Teredo/6to4,
17
+ IPv4-mapped/compatible IPv6, hex/octal/decimal normalization, zone ID
18
+ stripping, .localhost/.local/.internal/.arpa TLD blocking, embedded
19
+ credential blocking)
20
+ - OFAC sanctioned country validation (CU, IR, KP, RU, SY)
21
+ - Credential scrubbing in all error outputs
22
+ - Prototype pollution prevention on all parsed JSON
23
+ - HTTP method restriction (GET/HEAD/OPTIONS only for proxied fetch)
24
+ - 10 MB response cap, 4000 char truncation, 30 s timeout
25
+ - Redirect following disabled to prevent open redirect abuse
26
+
27
+ Requires: httpx (``pip install httpx``)
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ __version__ = "1.0.0"
33
+
34
+ from dominusnode_dify.tools import (
35
+ BLOCKED_HOSTNAMES,
36
+ SANCTIONED_COUNTRIES,
37
+ DominusNodeProvider,
38
+ _extract_6to4_ipv4,
39
+ _extract_teredo_ipv4,
40
+ _is_private_ip,
41
+ _normalize_ipv4,
42
+ _sanitize_error,
43
+ _strip_dangerous_keys,
44
+ _validate_label,
45
+ _validate_positive_int,
46
+ _validate_uuid,
47
+ validate_url,
48
+ )
49
+
50
+ __all__ = [
51
+ "DominusNodeProvider",
52
+ "BLOCKED_HOSTNAMES",
53
+ "SANCTIONED_COUNTRIES",
54
+ "_is_private_ip",
55
+ "_normalize_ipv4",
56
+ "_extract_teredo_ipv4",
57
+ "_extract_6to4_ipv4",
58
+ "_sanitize_error",
59
+ "_strip_dangerous_keys",
60
+ "_validate_label",
61
+ "_validate_positive_int",
62
+ "_validate_uuid",
63
+ "validate_url",
64
+ ]