Skip to content

Commit 3484e8e

Browse files
feat(ssh_tunnel): Import/Export Databases with SSHTunnel credentials (#23099)
1 parent 9673838 commit 3484e8e

File tree

30 files changed

+2039
-50
lines changed

30 files changed

+2039
-50
lines changed

docs/static/resources/openapi.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10716,6 +10716,18 @@
1071610716
"passwords": {
1071710717
"description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
1071810718
"type": "string"
10719+
},
10720+
"ssh_tunnel_passwords": {
10721+
"description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
10722+
"type": "string"
10723+
},
10724+
"ssh_tunnel_private_keys": {
10725+
"description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.",
10726+
"type": "string"
10727+
},
10728+
"ssh_tunnel_private_keyspasswords": {
10729+
"description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key_password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.",
10730+
"type": "string"
1071910731
}
1072010732
},
1072110733
"type": "object"
@@ -11439,6 +11451,18 @@
1143911451
"passwords": {
1144011452
"description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
1144111453
"type": "string"
11454+
},
11455+
"ssh_tunnel_passwords": {
11456+
"description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
11457+
"type": "string"
11458+
},
11459+
"ssh_tunnel_private_keys": {
11460+
"description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.",
11461+
"type": "string"
11462+
},
11463+
"ssh_tunnel_private_keyspasswords": {
11464+
"description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key_password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.",
11465+
"type": "string"
1144211466
}
1144311467
},
1144411468
"type": "object"
@@ -13020,6 +13044,18 @@
1302013044
"passwords": {
1302113045
"description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
1302213046
"type": "string"
13047+
},
13048+
"ssh_tunnel_passwords": {
13049+
"description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
13050+
"type": "string"
13051+
},
13052+
"ssh_tunnel_private_keys": {
13053+
"description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.",
13054+
"type": "string"
13055+
},
13056+
"ssh_tunnel_private_keyspasswords": {
13057+
"description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key_password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.",
13058+
"type": "string"
1302313059
}
1302413060
},
1302513061
"type": "object"
@@ -14788,6 +14824,18 @@
1478814824
"passwords": {
1478914825
"description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
1479014826
"type": "string"
14827+
},
14828+
"ssh_tunnel_passwords": {
14829+
"description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
14830+
"type": "string"
14831+
},
14832+
"ssh_tunnel_private_keys": {
14833+
"description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.",
14834+
"type": "string"
14835+
},
14836+
"ssh_tunnel_private_keyspasswords": {
14837+
"description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key_password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.",
14838+
"type": "string"
1479114839
}
1479214840
},
1479314841
"type": "object"
@@ -16231,6 +16279,18 @@
1623116279
"sync_metrics": {
1623216280
"description": "sync metrics?",
1623316281
"type": "boolean"
16282+
},
16283+
"ssh_tunnel_passwords": {
16284+
"description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
16285+
"type": "string"
16286+
},
16287+
"ssh_tunnel_private_keys": {
16288+
"description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.",
16289+
"type": "string"
16290+
},
16291+
"ssh_tunnel_private_keyspasswords": {
16292+
"description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key_password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.",
16293+
"type": "string"
1623416294
}
1623516295
},
1623616296
"type": "object"
@@ -19428,6 +19488,18 @@
1942819488
"passwords": {
1942919489
"description": "JSON map of passwords for each featured database in the ZIP file. If the ZIP includes a database config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
1943019490
"type": "string"
19491+
},
19492+
"ssh_tunnel_passwords": {
19493+
"description": "JSON map of passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_password\"}`.",
19494+
"type": "string"
19495+
},
19496+
"ssh_tunnel_private_keys": {
19497+
"description": "JSON map of private_keys for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key\"}`.",
19498+
"type": "string"
19499+
},
19500+
"ssh_tunnel_private_keyspasswords": {
19501+
"description": "JSON map of private_key_passwords for each ssh_tunnel associated to a featured database in the ZIP file. If the ZIP includes a ssh_tunnel config in the path `databases/MyDatabase.yaml`, the private_key_password should be provided in the following format: `{\"databases/MyDatabase.yaml\": \"my_private_key_password\"}`.",
19502+
"type": "string"
1943119503
}
1943219504
},
1943319505
"type": "object"

superset-frontend/src/components/ImportModal/ImportModal.test.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,51 @@ describe('ImportModelsModal', () => {
146146
);
147147
expect(wrapperWithPasswords.find('input[type="password"]')).toExist();
148148
});
149+
150+
it('should render ssh_tunnel password fields when needed for import', () => {
151+
const wrapperWithPasswords = mount(
152+
<ImportModelsModal
153+
{...requiredProps}
154+
sshTunnelPasswordFields={['databases/examples.yaml']}
155+
/>,
156+
{
157+
context: { store },
158+
},
159+
);
160+
expect(
161+
wrapperWithPasswords.find('[data-test="ssh_tunnel_password"]'),
162+
).toExist();
163+
});
164+
165+
it('should render ssh_tunnel private_key fields when needed for import', () => {
166+
const wrapperWithPasswords = mount(
167+
<ImportModelsModal
168+
{...requiredProps}
169+
sshTunnelPrivateKeyFields={['databases/examples.yaml']}
170+
/>,
171+
{
172+
context: { store },
173+
},
174+
);
175+
expect(
176+
wrapperWithPasswords.find('[data-test="ssh_tunnel_private_key"]'),
177+
).toExist();
178+
});
179+
180+
it('should render ssh_tunnel private_key_password fields when needed for import', () => {
181+
const wrapperWithPasswords = mount(
182+
<ImportModelsModal
183+
{...requiredProps}
184+
sshTunnelPrivateKeyPasswordFields={['databases/examples.yaml']}
185+
/>,
186+
{
187+
context: { store },
188+
},
189+
);
190+
expect(
191+
wrapperWithPasswords.find(
192+
'[data-test="ssh_tunnel_private_key_password"]',
193+
),
194+
).toExist();
195+
});
149196
});

0 commit comments

Comments
 (0)