Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Private Key Auth #159

Merged
merged 56 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2d34de4
First pass storing private key (#32)
bmingles Oct 15, 2024
88fadd3
Refactored secret storage to support user maps (#32)
bmingles Oct 15, 2024
450d47f
Caching user login preferences (#32)
bmingles Oct 16, 2024
89f66c6
Lazy DHE credentials (#32)
bmingles Oct 16, 2024
ad97e50
Commands to trash all connections to server (#32)
bmingles Oct 16, 2024
98b76de
Started cleaning up login flow (#32)
bmingles Oct 16, 2024
cf7a5da
Progress on signing keys (32)
bmingles Oct 22, 2024
640290a
Added Base64Signature type (32)
bmingles Oct 23, 2024
c114d7e
Refactored some auth utils (32)
bmingles Oct 23, 2024
dd34f6a
Refactored secret storage, added clear storage cmd, and wired up more…
bmingles Oct 23, 2024
3a2e951
DISPOSE_DHE_CLIENT_CMD (32)
bmingles Oct 24, 2024
80d39c1
onDidInvalidate event (32)
bmingles Oct 24, 2024
63bb7d4
Fixed misnamed key (32)
bmingles Oct 24, 2024
10a317b
Fixed bug with non-awaited promise (32)
bmingles Oct 24, 2024
fb3bdc9
Fixed misnamed key bug (32)
bmingles Oct 24, 2024
1218c14
Private key login (32)
bmingles Oct 24, 2024
72945b9
TODO comment (32)
bmingles Oct 24, 2024
166c44b
Refactored login prompts (32)
bmingles Oct 25, 2024
490809a
Consolidated login prompt logic (32)
bmingles Oct 25, 2024
c13f808
Moved login to UserLoginController (32)
bmingles Oct 25, 2024
facfaa8
Removed DISPOSE_DHE_CLIENT_CMD (32)
bmingles Oct 25, 2024
5f46b02
Temporary client for generating keys (32)
bmingles Oct 25, 2024
9dd6b69
Renamed cmd to CREATE_AUTHENTICATED_CLIENT_CMD (32)
bmingles Oct 25, 2024
86e44fb
Added onChange and getOrThrow to SerializedKeyMap (32)
bmingles Oct 25, 2024
934ab0c
Simplified dhe client caching (32)
bmingles Oct 25, 2024
4ea19cb
Store client only after login (32)
bmingles Oct 25, 2024
635c330
Type safety for authenticated / unauthenticated client (32)
bmingles Oct 25, 2024
e62c257
Relaxed linting rule (32)
bmingles Oct 28, 2024
c956fc5
Made worker status check more explicit (32)
bmingles Oct 28, 2024
82cb2d2
Fixed tests (32)
bmingles Oct 28, 2024
c9aac37
Fixed esm warning for vitest (32)
bmingles Oct 28, 2024
6b9cf1d
Handle 404 (32)
bmingles Oct 28, 2024
12e69f5
Refactored some utils (32)
bmingles Oct 29, 2024
8f8abe8
Upgraded to latest dh alpha packages (32)
bmingles Oct 30, 2024
dc2d314
Switched to use auth-nodejs utils (32)
bmingles Oct 30, 2024
c5903b2
Split out command to connect and operate as another user (32)
bmingles Oct 30, 2024
a2b79ce
Handle login cancelled (32)
bmingles Oct 30, 2024
4019065
Fixed issue where workers weren't getting disposed (32)
bmingles Oct 30, 2024
46ef560
Upgraded to latest DHE apis (32)
bmingles Oct 31, 2024
b3d1316
Moved some commands to context menu (32)
bmingles Oct 31, 2024
6fe4a66
Stop prompts from closing on blur (32)
bmingles Oct 31, 2024
15986be
Moved DHE client disposal (32)
bmingles Oct 31, 2024
56af217
Comments (32)
bmingles Oct 31, 2024
15298aa
Removed commented out code (32)
bmingles Oct 31, 2024
891577e
Comment (32)
bmingles Oct 31, 2024
9f47cfe
Comment (32) (32)
bmingles Oct 31, 2024
4a67a91
Comments (32)
bmingles Oct 31, 2024
c497656
Update src/services/SecretService.ts
bmingles Nov 1, 2024
88d09d1
Remember username in keygen (32)
bmingles Nov 1, 2024
1894f4f
Disconnect from server before deleting client (32)
bmingles Nov 1, 2024
d5939c1
Bumped @deephaven-enterprise packages to latest (32)
bmingles Nov 1, 2024
4a3cc27
Updated api (32)
bmingles Nov 1, 2024
b87ea10
Delete invalid keys (32)
bmingles Nov 4, 2024
fb33975
Merge branch 'main' into 32-private-key
bmingles Nov 4, 2024
add40ff
Changed login workflow to auto login private key (32)
bmingles Nov 4, 2024
8572cb7
Changed disconnect icon (32)
bmingles Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
"rules": {
"no-return-await": "off",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/explicit-function-return-type": "error"
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{ "checksVoidReturn": false }
]
}
}
],
Expand Down
107 changes: 62 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 53 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,39 @@
"command": "vscode-deephaven.downloadLogs",
"title": "Deephaven: Download Logs"
},
{
"command": "vscode-deephaven.clearSecretStorage",
"title": "Deephaven: Clear Secrets"
},
{
"command": "vscode-deephaven.connectToServer",
"title": "Deephaven: Connect to Server",
"title": "Connect to Server",
"icon": "$(plug)"
},
{
"command": "vscode-deephaven.connectToServerOperateAs",
"title": "Connect to Server as Another User",
"icon": "$(account)"
},
{
"command": "vscode-deephaven.createNewTextDoc",
"title": "New File",
"icon": "$(new-file)"
},
{
"command": "vscode-deephaven.disconnectEditor",
"title": "Deephaven: Disconnect Editor",
"title": "Disconnect Editor",
"icon": "$(debug-disconnect)"
},
{
"command": "vscode-deephaven.disconnectFromServer",
"title": "Deephaven: Discard Connection",
"icon": "$(trash)"
"title": "Disconnect from Server",
"icon": "$(debug-disconnect)"
},
{
"command": "vscode-deephaven.generateDHEKeyPair",
"title": "Generate DHE Key Pair",
"icon": "$(key)"
},
{
"command": "vscode-deephaven.openInBrowser",
Expand All @@ -188,25 +202,25 @@
},
{
"command": "vscode-deephaven.openVariablePanels",
"title": "Deephaven: Open Variable Panels"
"title": "Open Variable Panels"
},
{
"command": "vscode-deephaven.refreshVariablePanels",
"title": "Deephaven: Refresh Variable Panels"
"title": "Refresh Variable Panels"
},
{
"command": "vscode-deephaven.refreshServerTree",
"title": "Deephaven: Refresh Server Tree",
"title": "Refresh Server Tree",
"icon": "$(refresh)"
},
{
"command": "vscode-deephaven.refreshServerConnectionTree",
"title": "Deephaven: Refresh Server Connection Tree",
"title": "Refresh Server Connection Tree",
"icon": "$(refresh)"
},
{
"command": "vscode-deephaven.requestDheUserCredentials",
"title": "Deephaven: Request DHE User Credentials"
"command": "vscode-deephaven.createAuthenticatedClient",
"title": "Create Authenticated Client"
},
{
"command": "vscode-deephaven.startServer",
Expand Down Expand Up @@ -633,6 +647,10 @@
"command": "vscode-deephaven.selectConnection",
"when": "true"
},
{
"command": "vscode-deephaven.clearSecretStorage",
"when": "true"
},
{
"command": "vscode-deephaven.downloadLogs",
"when": "true"
Expand All @@ -649,6 +667,10 @@
"command": "vscode-deephaven.connectToServer",
"when": "false"
},
{
"command": "vscode-deephaven.connectToServerOperateAs",
"when": "false"
},
{
"command": "vscode-deephaven.disconnectEditor",
"when": "false"
Expand All @@ -657,6 +679,10 @@
"command": "vscode-deephaven.disconnectFromServer",
"when": "false"
},
{
"command": "vscode-deephaven.generateDHEKeyPair",
"when:": "false"
},
{
"command": "vscode-deephaven.openVariablePanels",
"when": "false"
Expand All @@ -674,7 +700,7 @@
"when": "false"
},
{
"command": "vscode-deephaven.requestDheUserCredentials",
"command": "vscode-deephaven.createAuthenticatedClient",
"when": "false"
}
],
Expand Down Expand Up @@ -716,9 +742,8 @@
],
"view/item/context": [
{
"command": "vscode-deephaven.connectToServer",
"when": "view == vscode-deephaven.serverTree && (viewItem == isManagedServerDisconnected || viewItem == isServerRunningDisconnected || viewItem == isDHEServerRunning)",
"group": "inline"
"command": "vscode-deephaven.connectToServerOperateAs",
"when": "view == vscode-deephaven.serverTree && viewItem == isDHEServerRunningDisconnected"
},
{
"command": "vscode-deephaven.createNewTextDoc",
Expand All @@ -732,12 +757,16 @@
},
{
"command": "vscode-deephaven.disconnectFromServer",
"when": "view == vscode-deephaven.serverConnectionTree && viewItem == isConnection",
"when": "(view == vscode-deephaven.serverTree && (viewItem == isServerRunningConnected || viewItem == isDHEServerRunningConnected)) || (view == vscode-deephaven.serverConnectionTree && viewItem == isConnection)",
"group": "inline@2"
},
{
"command": "vscode-deephaven.generateDHEKeyPair",
"when": "view == vscode-deephaven.serverTree && (viewItem == isDHEServerRunningConnected || viewItem == isDHEServerRunningDisconnected)"
},
{
"command": "vscode-deephaven.openInBrowser",
"when": "view == vscode-deephaven.serverTree && (viewItem == isManagedServerConnected || viewItem == isServerRunningConnected || viewItem == isServerRunningDisconnected || viewItem == isManagedServerDisconnected || viewItem == isDHEServerRunning)",
"when": "view == vscode-deephaven.serverTree && (viewItem == isManagedServerConnected || viewItem == isManagedServerDisconnected || viewItem == isServerRunningConnected || viewItem == isServerRunningDisconnected || viewItem == isDHEServerRunningConnected || viewItem == isDHEServerRunningDisconnected)",
"group": "inline"
},
{
Expand Down Expand Up @@ -781,9 +810,15 @@
]
}
},
"dependencies": {
"@deephaven-enterprise/auth-nodejs": "^1.20240723.111-beta",
"@deephaven-enterprise/query-utils": "^1.20240723.111-beta",
"@deephaven/require-jsapi": "file:./packages/require-jsapi",
"nanoid": "^5.0.7"
},
"devDependencies": {
"@deephaven-enterprise/jsapi-types": "^1.20240723.95-beta",
"@deephaven/jsapi-types": "^1.0.0-dev0.35.3",
"@deephaven-enterprise/jsapi-types": "^1.20240723.111-beta",
"@deephaven/jsapi-types": "^1.0.0-dev0.36.1",
"@types/node": "22.5.4",
"@types/vscode": "^1.91.0",
"@types/ws": "^8.5.10",
Expand All @@ -809,11 +844,6 @@
"wdio-ctrf-json-reporter": "^0.0.10",
"wdio-vscode-service": "^6.1.0"
},
"dependencies": {
"@deephaven-enterprise/query-utils": "^1.20240723.95-beta",
"@deephaven/require-jsapi": "file:./packages/require-jsapi",
"nanoid": "^5.0.7"
},
"overrides": {
"event-target-shim": "^6.0.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/require-jsapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"ws": "^8.18.0"
},
"devDependencies": {
"@deephaven-enterprise/jsapi-types": "^1.20240723.95-beta"
"@deephaven-enterprise/jsapi-types": "^1.20240723.111-beta"
}
}
5 changes: 5 additions & 0 deletions packages/require-jsapi/src/serverUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export async function downloadFromURL(
});

res.on('end', async () => {
if (res.statusCode === 404) {
reject(`File not found: "${url}"`);
return;
}

resolve(file);
});
})
Expand Down
Loading