Open
Conversation
| if err := listener.Close(); err != nil { | ||
| log.Printf("failed to close listener: %v", err) | ||
| } | ||
| }() |
Collaborator
Author
There was a problem hiding this comment.
server.Shutdown() closes the listener, so no explicit close needed
780adc5 to
e39bd29
Compare
| func getWebAppURL() string { | ||
| // allows overriding the URL for testing | ||
| if url := os.Getenv("LOCALSTACK_WEB_APP_URL"); url != "" { | ||
| return url |
Collaborator
Author
There was a problem hiding this comment.
Not sure why I added this in the first place, but we never overwrite it at the moment, so I removed it.
| assert.True(t, inspect.State.Running, "container should be running") | ||
| } | ||
|
|
||
| func TestStartCommandTriggersLoginWithoutToken(t *testing.T) { |
Collaborator
Author
There was a problem hiding this comment.
This test was just moved to test/integration/login_browser_flow_test.go
e39bd29 to
6be9ca5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a device code flow as a fallback option when the browser-based authentication doesn't work.
When running
lstk start, the CLI now supports two authentication paths:User Experience
When running
lstk:If user presses ENTER after confirming in browser:
Mock Server Approach
This PR introduces a platform API client.
The device flow tests use
httptest.NewServerto create a real HTTP server that mimics the platform API.The production code remains unchanged, we just point it to a different URL via
LOCALSTACK_PLATFORM_URL.This allows
TestDeviceFlowSuccessto verify the complete end-to-end flow including container startup with a valid token.