Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ab47a46
Add webviews for Amazon Q IAM credentials option and form
liramon1 Jun 5, 2025
eeebd0b
Implement IAM setup function
liramon1 Jun 6, 2025
61c1138
Make AuthUtils session switch between SsoLogin, IamLogin, and undefined
liramon1 Jun 9, 2025
146a95f
Start implementing IamLogin class
liramon1 Jun 10, 2025
eb0be34
Remove iamSessions from profiles
liramon1 Jun 11, 2025
a241b1c
Implement updateIamProfile and change STS references to IAM
liramon1 Jun 13, 2025
e923bad
Implement _getIamCredential and its callers
liramon1 Jun 13, 2025
2dabb43
fix(amazonq): delete iam profile when logout
yuxianrz Jun 16, 2025
ff181f4
start modifying auth2 consumers
liramon1 Jun 16, 2025
f61bcee
Merge remote-tracking branch 'origin/feature/flare-mega' into feature…
liramon1 Jun 16, 2025
eb3526a
undo unnecessary changes
liramon1 Jun 17, 2025
849006b
undo more unnecessary changes
liramon1 Jun 18, 2025
1968d41
fix logout bug
liramon1 Jun 18, 2025
06c5ad8
Fix bug where profile failed to be retrieved after signing out and ba…
liramon1 Jun 19, 2025
60ffc92
Fix region profile selector not triggering
liramon1 Jun 19, 2025
e1cfdc3
Add support for IAM credentials to region profile manager
liramon1 Jun 19, 2025
422d085
feat: remember iam access key
yuxianrz Jun 19, 2025
424a1af
Revert unnecessary region profile changes
liramon1 Jun 20, 2025
9dbe490
Add limited IAM support for inline chat
liramon1 Jun 20, 2025
f044eb6
Revert CredentialChangedKind for backwards compatibility
liramon1 Jun 20, 2025
7506ecc
fix: fix missing autofill after disabling extension
yuxianrz Jun 25, 2025
ce07bd2
Re-add session restore for IAM
liramon1 Jun 30, 2025
2a181a6
revert workspace and launch.json
yuxianrz Jul 10, 2025
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
2 changes: 1 addition & 1 deletion packages/amazonq/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"env": {
"SSMDOCUMENT_LANGUAGESERVER_PORT": "6010",
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080"
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080",
// Below allows for overrides used during development
// "__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/agent-standalone.js",
// "__AMAZONQLSP_UI": "${workspaceFolder}/../../../language-servers/chat-client/build/amazonq-ui.js"
Expand Down
15 changes: 13 additions & 2 deletions packages/amazonq/src/inlineChat/provider/inlineChatProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class InlineChatProvider {
private async generateResponse(
triggerPayload: TriggerPayload & { projectContextQueryLatencyMs?: number },
triggerID: string
) {
): Promise<GenerateAssistantResponseCommandOutput | undefined> {
const triggerEvent = this.triggerEventsStorage.getTriggerEvent(triggerID)
if (triggerEvent === undefined) {
return
Expand Down Expand Up @@ -182,7 +182,18 @@ export class InlineChatProvider {
let response: GenerateAssistantResponseCommandOutput | undefined = undefined
session.createNewTokenSource()
try {
response = await session.chatSso(request)
if (AuthUtil.instance.isSsoSession()) {
response = await session.chatSso(request)
} else {
// Call sendMessage because Q Developer Streaming Client does not have generateAssistantResponse
const { sendMessageResponse, ...rest } = await session.chatIam(request)
// Convert sendMessageCommandOutput to GenerateAssistantResponseCommandOutput
response = {
generateAssistantResponseResponse: sendMessageResponse,
conversationId: session.sessionIdentifier,
...rest
}
}
getLogger().info(
`response to tab: ${tabID} conversationID: ${session.sessionIdentifier} requestID: ${response.$metadata.requestId} metadata: %O`,
response.$metadata
Expand Down
11 changes: 10 additions & 1 deletion packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ export async function startLanguageServer(
},
credentials: {
providesBearerToken: true,
// Add IAM credentials support
providesIamCredentials: true,
supportsAssumeRole: true,
},
},
/**
Expand Down Expand Up @@ -211,9 +214,10 @@ export async function startLanguageServer(

/** All must be setup before {@link AuthUtil.restore} otherwise they may not trigger when expected */
AuthUtil.instance.regionProfileManager.onDidChangeRegionProfile(async () => {
const activeProfile = AuthUtil.instance.regionProfileManager.activeRegionProfile
void pushConfigUpdate(client, {
type: 'profile',
profileArn: AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn,
profileArn: activeProfile?.arn,
})
})

Expand Down Expand Up @@ -286,6 +290,11 @@ async function postStartLanguageServer(
sso: {
startUrl: AuthUtil.instance.connection?.startUrl,
},
// Add IAM credentials metadata
iam: {
region: AuthUtil.instance.connection?.region,
accesskey: AuthUtil.instance.connection?.accessKey,
},
}
})

Expand Down
2 changes: 1 addition & 1 deletion packages/amazonq/test/e2e/amazonq/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export async function loginToIdC() {
)
}

await AuthUtil.instance.login(startUrl, region)
await AuthUtil.instance.login(startUrl, region, 'sso')
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ describe('RegionProfileManager', async function () {

async function setupConnection(type: 'builderId' | 'idc') {
if (type === 'builderId') {
await AuthUtil.instance.login(constants.builderIdStartUrl, region)
await AuthUtil.instance.login(constants.builderIdStartUrl, region, 'sso')
assert.ok(AuthUtil.instance.isSsoSession())
assert.ok(AuthUtil.instance.isBuilderIdConnection())
} else if (type === 'idc') {
await AuthUtil.instance.login(enterpriseSsoStartUrl, region)
await AuthUtil.instance.login(enterpriseSsoStartUrl, region, 'sso')
assert.ok(AuthUtil.instance.isSsoSession())
assert.ok(AuthUtil.instance.isIdcConnection())
}
Expand Down
Loading
Loading