Skip to content

Commit 16b287b

Browse files
sdharani91dharsrin
andauthored
feat: enable iam auth for agentic chat (#1736)
Co-authored-by: Dharani Srinivasan <[email protected]>
1 parent 9f525c6 commit 16b287b

26 files changed

+5309
-3517
lines changed
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { standalone } from '@aws/language-server-runtimes/runtimes'
22
import {
3+
AmazonQServiceServerIAM,
4+
AmazonQServiceServerToken,
35
CodeWhispererSecurityScanServerTokenProxy,
46
CodeWhispererServerTokenProxy,
5-
QAgenticChatServerTokenProxy,
7+
QAgenticChatServerProxy,
68
QConfigurationServerTokenProxy,
7-
QLocalProjectContextServerTokenProxy,
9+
QLocalProjectContextServerProxy,
810
QNetTransformServerTokenProxy,
911
WorkspaceContextServerTokenProxy,
1012
} from '@aws/lsp-codewhisperer'
@@ -14,26 +16,32 @@ import {
1416
FsToolsServer,
1517
McpToolsServer,
1618
} from '@aws/lsp-codewhisperer/out/language-server/agenticChat/tools/toolServer'
17-
import { createTokenRuntimeProps } from './standalone-common'
19+
import { RuntimeProps } from '@aws/language-server-runtimes/runtimes/runtime'
1820

1921
const MAJOR = 0
2022
const MINOR = 1
2123
const PATCH = 0
2224
const VERSION = `${MAJOR}.${MINOR}.${PATCH}`
2325

24-
const props = createTokenRuntimeProps(VERSION, [
25-
CodeWhispererServerTokenProxy,
26-
CodeWhispererSecurityScanServerTokenProxy,
27-
QConfigurationServerTokenProxy,
28-
QNetTransformServerTokenProxy,
29-
QAgenticChatServerTokenProxy,
30-
IdentityServer.create,
31-
FsToolsServer,
32-
BashToolsServer,
33-
QLocalProjectContextServerTokenProxy,
34-
WorkspaceContextServerTokenProxy,
35-
McpToolsServer,
36-
// LspToolsServer,
37-
])
26+
const props = {
27+
version: VERSION,
28+
servers: [
29+
CodeWhispererServerTokenProxy,
30+
CodeWhispererSecurityScanServerTokenProxy,
31+
QConfigurationServerTokenProxy,
32+
QNetTransformServerTokenProxy,
33+
QAgenticChatServerProxy,
34+
IdentityServer.create,
35+
FsToolsServer,
36+
BashToolsServer,
37+
QLocalProjectContextServerProxy,
38+
WorkspaceContextServerTokenProxy,
39+
McpToolsServer,
40+
// LspToolsServer,
41+
AmazonQServiceServerIAM,
42+
AmazonQServiceServerToken,
43+
],
44+
name: 'AWS CodeWhisperer',
45+
} as RuntimeProps
3846

3947
standalone(props)

app/aws-lsp-codewhisperer-runtimes/src/token-standalone.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
QChatServerTokenProxy,
66
QConfigurationServerTokenProxy,
77
QNetTransformServerTokenProxy,
8-
QLocalProjectContextServerTokenProxy,
8+
QLocalProjectContextServerProxy,
99
WorkspaceContextServerTokenProxy,
1010
} from '@aws/lsp-codewhisperer'
1111
import { IdentityServer } from '@aws/lsp-identity'
@@ -23,7 +23,7 @@ const props = createTokenRuntimeProps(VERSION, [
2323
QNetTransformServerTokenProxy,
2424
QChatServerTokenProxy,
2525
IdentityServer.create,
26-
QLocalProjectContextServerTokenProxy,
26+
QLocalProjectContextServerProxy,
2727
WorkspaceContextServerTokenProxy,
2828
])
2929

app/aws-lsp-codewhisperer-runtimes/webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const webworkerConfig = {
8888
net: false,
8989
tls: false,
9090
http2: false,
91+
buffer: require.resolve('buffer/'),
9192
},
9293
extensions: ['.ts', '.tsx', '.js', '.jsx'],
9394
},
@@ -109,6 +110,9 @@ const webworkerConfig = {
109110
new webpack.ProvidePlugin({
110111
process: 'process/browser',
111112
}),
113+
new webpack.ProvidePlugin({
114+
Buffer: ['buffer', 'Buffer'],
115+
}),
112116
],
113117
}
114118

app/aws-lsp-json-runtimes/src/tests/jsonServerCFInteg.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function createLSPServer(runtimeFile: string) {
4747
return { client, endpoint, process }
4848
}
4949

50-
describe('Test JsonServer with CloudFormation schema', () => {
50+
;(describe('Test JsonServer with CloudFormation schema', () => {
5151
let client: LspClient
5252
let endpoint: JSONRPCEndpoint
5353
let process: ChildProcessWithoutNullStreams
@@ -200,4 +200,4 @@ describe('Test JsonServer with CloudFormation schema', () => {
200200

201201
expect(clientResult).to.deep.equal(HOVER_JSON_CUSTOMIZED)
202202
})
203-
})
203+
}))

app/aws-lsp-yaml-runtimes/src/tests/yamlServerCFInteg.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function createLSPServer(runtimeFile: string) {
4747
return { client, endpoint, process }
4848
}
4949

50-
describe('Test YamlServer with CloudFormation schema', () => {
50+
;(describe('Test YamlServer with CloudFormation schema', () => {
5151
const rootPath = path.resolve(__dirname)
5252
let process: ChildProcessWithoutNullStreams
5353
let endpoint: JSONRPCEndpoint
@@ -203,4 +203,4 @@ describe('Test YamlServer with CloudFormation schema', () => {
203203

204204
expect(clientResult).to.deep.equal(HOVER_YAML_CUSTOMIZED)
205205
})
206-
})
206+
}))
Binary file not shown.

0 commit comments

Comments
 (0)