Conversation
Key mgmt refactor, pull implementation, -sqlrsync improvements
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 pull request introduces a new authentication and configuration management system for the
sqlrsyncclient, focusing on supporting local configuration files, environment variables, and interactive prompts for credentials. The changes modularize and centralize authentication logic, improve configuration file handling, and provide a clear interface for resolving and storing authentication information.Key changes:
Authentication and Resolution System
authpackage withresolver.go, implementing aResolvertype that centralizes all logic for resolving authentication credentials from environment variables, config files, or user prompts. It supports both "push" and "pull" operations and can save authentication results to local config files or-sqlrsyncfiles. (client/auth/resolver.go)Resolversupports environment variables (SQLRSYNC_AUTH_TOKEN,SQLRSYNC_ADMIN_KEY), explicit keys, and config file lookup, and will prompt the user for an admin key if needed. (client/auth/resolver.go)Configuration File Management
config.goto theauthpackage, which manages reading and writing ofdefaults.tomlandlocal-secrets.tomlin the user's config directory, as well as the-sqlrsyncfiles used for pull/subscribe operations. It includes helpers for safely updating, searching, and removing database entries. (client/auth/config.go)local-secrets.tomlare written with secure permissions (0600). (client/auth/config.go)Code Quality and Consistency
config.go(now largely replaced), such as spacing in function definitions and updating the help URL in generated-sqlrsyncfiles. (client/config.go) [1] [2]References:
[1] [2] [3] [4]