Skip to content

Commit 67b5f51

Browse files
authored
chore: upgrade thv to 0.1.8 (#556)
* chore: upgrade thv to 0.1.8 * fix: allow_transport is removed
1 parent b4ba3d5 commit 67b5f51

File tree

6 files changed

+17
-49
lines changed

6 files changed

+17
-49
lines changed

renderer/src/common/api/generated/types.gen.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ export type PermissionsOutboundNetworkPermissions = {
4040
* AllowPort is a list of allowed ports
4141
*/
4242
allow_port?: Array<number>
43-
/**
44-
* AllowTransport is a list of allowed transport protocols (tcp, udp)
45-
*/
46-
allow_transport?: Array<string>
4743
/**
4844
* InsecureAllowAll allows all outbound network connections
4945
*/

renderer/src/common/api/openapi.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@
6767
"type": "array",
6868
"uniqueItems": false
6969
},
70-
"allow_transport": {
71-
"description": "AllowTransport is a list of allowed transport protocols (tcp, udp)",
72-
"items": { "type": "string" },
73-
"type": "array",
74-
"uniqueItems": false
75-
},
7670
"insecure_allow_all": {
7771
"description": "InsecureAllowAll allows all outbound network connections",
7872
"type": "boolean"
@@ -703,6 +697,9 @@
703697
"WorkloadStatusStopped",
704698
"WorkloadStatusError",
705699
"WorkloadStatusStarting",
700+
"WorkloadStatusStopping",
701+
"WorkloadStatusUnhealthy",
702+
"WorkloadStatusRemoving",
706703
"WorkloadStatusUnknown"
707704
]
708705
}

renderer/src/common/mocks/fixtures/registry.ts

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export const MOCK_REGISTRY_RESPONSE = [
1111
network: {
1212
outbound: {
1313
insecure_allow_all: true,
14-
allow_transport: ['tcp'],
1514
allow_port: [443],
1615
},
1716
},
@@ -62,7 +61,6 @@ export const MOCK_REGISTRY_RESPONSE = [
6261
permissions: {
6362
network: {
6463
outbound: {
65-
allow_transport: ['tcp'],
6664
allow_host: ['api.slack.com', 'slack.com'],
6765
allow_port: [443],
6866
},
@@ -120,7 +118,6 @@ export const MOCK_REGISTRY_RESPONSE = [
120118
permissions: {
121119
network: {
122120
outbound: {
123-
allow_transport: ['tcp'],
124121
allow_port: [443],
125122
},
126123
},
@@ -165,7 +162,7 @@ export const MOCK_REGISTRY_RESPONSE = [
165162
network: {
166163
outbound: {
167164
insecure_allow_all: true,
168-
allow_transport: ['tcp'],
165+
169166
allow_port: [443],
170167
},
171168
},
@@ -215,7 +212,6 @@ export const MOCK_REGISTRY_RESPONSE = [
215212
permissions: {
216213
network: {
217214
outbound: {
218-
allow_transport: ['tcp'],
219215
allow_port: [443, 6379],
220216
},
221217
},
@@ -353,7 +349,6 @@ export const MOCK_REGISTRY_RESPONSE = [
353349
permissions: {
354350
network: {
355351
outbound: {
356-
allow_transport: ['tcp'],
357352
allow_host: ['docs.github.com', 'github.com'],
358353
allow_port: [443],
359354
},
@@ -441,7 +436,6 @@ export const MOCK_REGISTRY_RESPONSE = [
441436
permissions: {
442437
network: {
443438
outbound: {
444-
allow_transport: ['tcp'],
445439
allow_host: ['developers.google.com', 'maps.com'],
446440
allow_port: [443],
447441
},
@@ -494,7 +488,7 @@ export const MOCK_REGISTRY_RESPONSE = [
494488
network: {
495489
outbound: {
496490
insecure_allow_all: true,
497-
allow_transport: ['tcp'],
491+
498492
allow_port: [443],
499493
},
500494
},
@@ -547,7 +541,6 @@ export const MOCK_REGISTRY_RESPONSE = [
547541
permissions: {
548542
network: {
549543
outbound: {
550-
allow_transport: ['tcp'],
551544
allow_host: ['api.notion.com'],
552545
allow_port: [443],
553546
},
@@ -601,7 +594,6 @@ export const MOCK_REGISTRY_RESPONSE = [
601594
permissions: {
602595
network: {
603596
outbound: {
604-
allow_transport: ['tcp'],
605597
allow_port: [443],
606598
},
607599
},
@@ -644,7 +636,6 @@ export const MOCK_REGISTRY_RESPONSE = [
644636
permissions: {
645637
network: {
646638
outbound: {
647-
allow_transport: ['tcp'],
648639
allow_port: [443],
649640
},
650641
},
@@ -682,7 +673,6 @@ export const MOCK_REGISTRY_RESPONSE = [
682673
write: ['/tmp'],
683674
network: {
684675
outbound: {
685-
allow_transport: ['tcp'],
686676
allow_port: [443],
687677
},
688678
},
@@ -730,7 +720,7 @@ export const MOCK_REGISTRY_RESPONSE = [
730720
network: {
731721
outbound: {
732722
insecure_allow_all: true,
733-
allow_transport: ['tcp'],
723+
734724
allow_port: [443, 27017, 27018, 27019, 27020],
735725
},
736726
},
@@ -850,7 +840,6 @@ export const MOCK_REGISTRY_RESPONSE = [
850840
permissions: {
851841
network: {
852842
outbound: {
853-
allow_transport: ['tcp'],
854843
allow_host: ['api.osv.dev'],
855844
allow_port: [443],
856845
},
@@ -901,7 +890,7 @@ export const MOCK_REGISTRY_RESPONSE = [
901890
network: {
902891
outbound: {
903892
insecure_allow_all: true,
904-
allow_transport: ['tcp'],
893+
905894
allow_port: [443],
906895
},
907896
},
@@ -954,7 +943,6 @@ export const MOCK_REGISTRY_RESPONSE = [
954943
write: ['/tmp/db'],
955944
network: {
956945
outbound: {
957-
allow_transport: ['tcp'],
958946
allow_port: [443],
959947
},
960948
},
@@ -987,7 +975,6 @@ export const MOCK_REGISTRY_RESPONSE = [
987975
permissions: {
988976
network: {
989977
outbound: {
990-
allow_transport: ['tcp'],
991978
allow_host: ['brave.com', 'api.search.brave.com'],
992979
allow_port: [443],
993980
},
@@ -1032,7 +1019,6 @@ export const MOCK_REGISTRY_RESPONSE = [
10321019
permissions: {
10331020
network: {
10341021
outbound: {
1035-
allow_transport: ['tcp'],
10361022
allow_port: [443],
10371023
},
10381024
},
@@ -1082,7 +1068,6 @@ export const MOCK_REGISTRY_RESPONSE = [
10821068
network: {
10831069
outbound: {
10841070
insecure_allow_all: true,
1085-
allow_transport: ['tcp'],
10861071
},
10871072
},
10881073
},
@@ -1142,7 +1127,6 @@ export const MOCK_REGISTRY_RESPONSE = [
11421127
permissions: {
11431128
network: {
11441129
outbound: {
1145-
allow_transport: ['tcp'],
11461130
allow_port: [443],
11471131
},
11481132
},
@@ -1192,7 +1176,6 @@ export const MOCK_REGISTRY_RESPONSE = [
11921176
permissions: {
11931177
network: {
11941178
outbound: {
1195-
allow_transport: ['tcp'],
11961179
allow_host: ['semgrep.dev', 'semgrep.com'],
11971180
allow_port: [443],
11981181
},
@@ -1244,7 +1227,6 @@ export const MOCK_REGISTRY_RESPONSE = [
12441227
permissions: {
12451228
network: {
12461229
outbound: {
1247-
allow_transport: ['tcp'],
12481230
allow_port: [443],
12491231
},
12501232
},
@@ -1283,7 +1265,7 @@ export const MOCK_REGISTRY_RESPONSE = [
12831265
network: {
12841266
outbound: {
12851267
insecure_allow_all: true,
1286-
allow_transport: ['tcp'],
1268+
12871269
allow_port: [443],
12881270
},
12891271
},
@@ -1328,7 +1310,7 @@ export const MOCK_REGISTRY_RESPONSE = [
13281310
network: {
13291311
outbound: {
13301312
insecure_allow_all: true,
1331-
allow_transport: ['tcp'],
1313+
13321314
allow_port: [443],
13331315
},
13341316
},
@@ -1420,7 +1402,7 @@ export const MOCK_REGISTRY_RESPONSE = [
14201402
network: {
14211403
outbound: {
14221404
insecure_allow_all: true,
1423-
allow_transport: ['tcp'],
1405+
14241406
allow_port: [443],
14251407
},
14261408
},
@@ -1513,7 +1495,6 @@ export const MOCK_REGISTRY_RESPONSE = [
15131495
permissions: {
15141496
network: {
15151497
outbound: {
1516-
allow_transport: ['tcp'],
15171498
allow_host: ['*'],
15181499
allow_port: [443],
15191500
},
@@ -1580,7 +1561,6 @@ export const MOCK_REGISTRY_RESPONSE = [
15801561
permissions: {
15811562
network: {
15821563
outbound: {
1583-
allow_transport: ['tcp'],
15841564
allow_host: ['api.perplexity.ai'],
15851565
allow_port: [443],
15861566
},
@@ -1613,7 +1593,6 @@ export const MOCK_REGISTRY_RESPONSE = [
16131593
permissions: {
16141594
network: {
16151595
outbound: {
1616-
allow_transport: ['tcp'],
16171596
allow_host: ['atlassian.net', 'atlassian.com'],
16181597
allow_port: [443],
16191598
},
@@ -1780,7 +1759,6 @@ export const MOCK_REGISTRY_RESPONSE = [
17801759
permissions: {
17811760
network: {
17821761
outbound: {
1783-
allow_transport: ['tcp'],
17841762
allow_port: [443],
17851763
},
17861764
},
@@ -1822,7 +1800,7 @@ export const MOCK_REGISTRY_RESPONSE = [
18221800
network: {
18231801
outbound: {
18241802
insecure_allow_all: true,
1825-
allow_transport: ['tcp'],
1803+
18261804
allow_port: [443],
18271805
},
18281806
},
@@ -1878,7 +1856,7 @@ export const MOCK_REGISTRY_RESPONSE = [
18781856
network: {
18791857
outbound: {
18801858
insecure_allow_all: true,
1881-
allow_transport: ['tcp'],
1859+
18821860
allow_host: ['github.com'],
18831861
allow_port: [443],
18841862
},
@@ -1960,7 +1938,6 @@ export const MOCK_REGISTRY_RESPONSE = [
19601938
permissions: {
19611939
network: {
19621940
outbound: {
1963-
allow_transport: ['tcp'],
19641941
allow_port: [443],
19651942
},
19661943
},
@@ -1992,7 +1969,6 @@ export const MOCK_REGISTRY_RESPONSE = [
19921969
permissions: {
19931970
network: {
19941971
outbound: {
1995-
allow_transport: ['tcp'],
19961972
allow_host: ['docs.gitlab.com', 'gitlab.com', 'full.com'],
19971973
allow_port: [443],
19981974
},

renderer/src/common/mocks/fixtures/registry_server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const registryServerFixture = {
88
tier: 'official',
99
status: 'active',
1010
permissions: {
11-
network: { outbound: { allow_transport: ['tcp'], allow_port: [443] } },
11+
network: { outbound: { allow_port: [443] } },
1212
},
1313
tools: ['get_current_time', 'convert_time'],
1414
env_vars: [

renderer/src/features/registry-servers/lib/orchestrate-run-registry-server.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
type Options,
3+
type PermissionsOutboundNetworkPermissions,
34
type PostApiV1BetaSecretsDefaultKeysData,
45
type RegistryImageMetadata,
56
type SecretsSecretParameter,
@@ -112,17 +113,15 @@ export function prepareCreateWorkloadData(
112113
)
113114

114115
// Extract and transform network isolation fields
115-
const { allowedHosts, allowedPorts, allowedProtocols, networkIsolation } =
116-
data
116+
const { allowedHosts, allowedPorts, networkIsolation } = data
117117
const permission_profile = networkIsolation
118118
? {
119119
network: {
120120
outbound: {
121121
allow_host: allowedHosts,
122122
allow_port: allowedPorts.map(parseInt),
123-
allow_transport: allowedProtocols ?? [],
124123
insecure_allow_all: false,
125-
},
124+
} as PermissionsOutboundNetworkPermissions,
126125
},
127126
}
128127
: undefined

utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const TOOLHIVE_VERSION = process.env.THV_VERSION ?? 'v0.1.7'
1+
export const TOOLHIVE_VERSION = process.env.THV_VERSION ?? 'v0.1.8'

0 commit comments

Comments
 (0)