feat: add authentication default settings support #810
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.
Add authentication default settings support
Summary
This PR provides a comprehensive solution to issue #654 by adding configurable default authentication settings that eliminate repeated prompts during
q login
. This implementation supersedes PR #655 by not only supporting CLI arguments but also persistent default settings.Motivation
Issue #654 reports that
q login
always prompts for start URL and region even when--identity-provider
and--region
are provided via CLI arguments. While PR #655 addresses the immediate CLI argument issue, users still face repeated prompts across login sessions.This PR provides a more complete solution by:
Changes
New Settings
Three new settings are introduced that users can configure via
q settings
:auth.defaultLicense
: Default license type ("free"
or"pro"
)auth.defaultRegion
: Default AWS region (e.g.,"us-east-1"
)auth.defaultIdentityProvider
: Default Identity Center start URLBehavior
Priority order (highest to lowest):
--region us-east-1
)q settings
)When CLI arguments or default settings exist, prompts are automatically skipped with visual feedback.
Example Usage
Scenario 1: Using CLI arguments (PR #655 behavior)
Scenario 2: Using persistent defaults (NEW)
Scenario 3: Override defaults with CLI arguments
Scenario 4: First-time setup with CLI arguments
Implementation Details
resolve_auth_value()
helper function to handle priority resolutionlogin_interactive()
to check CLI args → default settings → promptComparison with PR #655
Testing
Related Issues