Skip to content

Revert "Use a free port in u2m authentication flows rather than 8020. (#1239)"#1266

Closed
shreyas-goenka wants to merge 2 commits into
mainfrom
revert-u2m-free
Closed

Revert "Use a free port in u2m authentication flows rather than 8020. (#1239)"#1266
shreyas-goenka wants to merge 2 commits into
mainfrom
revert-u2m-free

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1266
  • Commit SHA: c5ba137ef36f1d9489cb5e21547d260ec27999f3

Checks will be approved automatically on success.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts a previous change that dynamically assigned random ports for OAuth2 callback URLs in the u2m authentication flow. The revert is necessary because the random port approach breaks databricks auth login functionality due to OAuth application registration requirements.

  • Restores hardcoded port 8020 for OAuth2 callback server
  • Removes dynamic port assignment logic and related test infrastructure
  • Updates changelog to document the revert

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
credentials/u2m/persistent_auth.go Reverts to hardcoded port 8020, removes dynamic port assignment logic
credentials/u2m/persistent_auth_test.go Removes tests for dynamic port assignment and updates existing tests to use port 8020
NEXT_CHANGELOG.md Documents the revert in the bug fixes section

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
if p.oAuthArgument == nil {
return nil, errors.New("missing OAuthArgument")
}

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

The nil check for oAuthArgument has been moved earlier in the function but the original validation logic at line 298 still exists. This creates duplicate validation logic that should be consolidated.

Suggested change
}

Copilot uses AI. Check for mistakes.

// Do not include the refresh token for security reasons. Refresh tokens are
// long-lived credentials that we do not want to expose unnecessarily.
// do not print refresh token to end-user

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The comment has been simplified from a more detailed explanation about security reasons for not including refresh tokens. The original comment provided better context about why refresh tokens are excluded.

Suggested change
// do not print refresh token to end-user
// For security reasons, we remove the refresh token before returning the token to the end-user.
// Exposing the refresh token (e.g., via logs or API responses) could allow unauthorized parties to obtain long-lived access.
// By clearing it here, we help prevent accidental leakage of sensitive credentials.

Copilot uses AI. Check for mistakes.
@shreyas-goenka

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1267, which is branched off 0.79

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.

2 participants