Skip to content

Conversation

@opieter-aws
Copy link
Contributor

@opieter-aws opieter-aws commented Apr 8, 2025

Problem

The business logic of auth-related features is complex and implemented separately for all IDEs. Flare/DEXP LSP server has implemented auth that can be reused for all IDEs.

Solution

This PR is the first in a set of PRs to migrate all auth for vscode to Flare, leveraging their identity server

Components

  • New auth2 file with all logic to connect to Flare for SSO-related auth.

Testing

This PR includes unit tests. The current full implementation is tested manually and can be found here: https://github.com/opieter-aws/aws-toolkit-vscode/tree/wip/amazonqLSP-auth

When the auth code is complete, we will conduct a bug bash before release.

NOTE: integration tests are failing, since this PR only contains the source code change of AuthUtil.ts, and not yet all reference changes. This is to keep the PR manageable. Follow up PR will contain reference changes (~90 files).


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

github-actions bot commented Apr 8, 2025

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@opieter-aws
Copy link
Contributor Author

/runIntegrationTests

@opieter-aws opieter-aws marked this pull request as ready for review April 8, 2025 15:46
@opieter-aws opieter-aws requested a review from a team as a code owner April 8, 2025 15:46
@Hweinstock
Copy link
Contributor

Hweinstock commented Apr 8, 2025

The linux test failing is known and tracked here: #6718. The codecatalyst one looks familiar, and started an issue here: #6959.

@opieter-aws opieter-aws requested a review from a team as a code owner April 8, 2025 20:05
Copy link
Contributor

@justinmk3 justinmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this change eliminates any part of packages/amazonq/src/lsp/auth.ts, it will be helpful to see those changes as part of this same PR, makes the "delta" obvious

@opieter-aws
Copy link
Contributor Author

If this change eliminates any part of packages/amazonq/src/lsp/auth.ts, it will be helpful to see those changes as part of this same PR, makes the "delta" obvious

This change replaces the entire packages/amazonq/src/lsp/auth.ts file. I will remove the file as part of this PR.

Copy link
Contributor

@justinmk3 justinmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any extra insight, based on your own discoveries while developing this, that you can add to the class docstrings?

@opieter-aws opieter-aws merged commit 8777084 into aws:feature/amazonqLSP-auth Apr 11, 2025
3 of 22 checks passed
opieter-aws added a commit that referenced this pull request Apr 14, 2025
## Problem
The [first version](#6958)
of migration of all auth for vscode to Flare using the identity server
did not support the recently introduced RegionProfileManager

## Solution
These code changes bring back the RegionProfileManager functionality, in
the new auth setup. Integration tests and unit tests to be fixed after
all references are updated in a follow-up PR to keep the changes
manageable. **CI is expected to fail**.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
opieter-aws added a commit that referenced this pull request Apr 17, 2025
…zon Q (#7062)

## Problem
The business logic of auth-related features is complex and implemented
separately for all IDEs. Flare/DEXP LSP server has implemented auth that
can be reused for all IDEs. The source code was introduced, but not yet
instantiated upon activation.

Follow up for #6958

## Solution
* Remove `"amazonqLSP"` experiment flag
* Have
[regionProfileManager.ts](https://github.com/aws/aws-toolkit-vscode/pull/7062/files#diff-f5716036a70a8b212e9dae829ec09e33731f181c173a3f2b9ad9d361d51af14b)
depend on `authProvider` through `IAuthProvider` interface to remove
circular dependency with `AuthUtil`
* Deprecate `getChatAuthState()` API in favor of new `getAuthState()`
* Instantiate and activate LSP client and new AuthUtil instance 

NOTE: CI is expected to fail, since the reference updates for AuthUtil
in the rest of code and unit tests have not been committed yet

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <[email protected]>
opieter-aws added a commit that referenced this pull request Apr 21, 2025
…dentity server for Amazon Q (#7088)

## Problem
The business logic of auth-related features is complex and implemented
separately for all IDEs. Flare/DEXP LSP server has implemented auth that
can be reused for all IDEs. The source code was introduced already
introduced in #6958 with
activation and client updates in
#7062. But the references
to `AuthUtil` through the codebase weren't updated yet.

## Solution
* Update all remaining references to `AuthUtil` in the codebase
* All `toolkits` unit tests are passing
* Disable telemetry and existing AuthUtil unit tests, to be updated in
follow-up PR
* `amazonq` and `web` unit tests still failing, to be addressed in
follow-up PR

**Note that CI is expected to fail for amazonq and web unit tests**



---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants