Conversation
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 local API key management system ("auth store") and updates the documentation and CLI to support it. API keys are now stored securely in a user-local JSON file instead of
config.ymlor environment variables, and a new set ofmotion authcommands is added for managing keys. The provider configuration logic is updated to prioritize the new auth store, and related documentation is improved. Some unused code and hardcoded keys are also removed.Authentication and API Key Management
core/auth.pymodule implementing a local API key store with secure permissions, and functions to set, get, remove, and list keys. ([core/auth.pyR1-R63](https://github.com/MathiTz/motion-harness/pull/5/files#diff-ea2d5e1b7edd45baafc4092389e518517296d62c6c34f7f05739c6042c6535a3R1-R63))core/config.pyto resolve API keys in the following order: auth store → environment variable → config file, and to check the auth store first when determining if a provider has a key. ([[1]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-97ed6d1d0787c0eb92725a8c161e43c9b5281d1f671cc27d91809406ff084368L69-R80),[[2]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-97ed6d1d0787c0eb92725a8c161e43c9b5281d1f671cc27d91809406ff084368L114-R122),[[3]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-97ed6d1d0787c0eb92725a8c161e43c9b5281d1f671cc27d91809406ff084368R7))motion auth login|logout|listinmain.py, allowing users to manage provider API keys interactively. ([[1]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-b10564ab7d2c520cdd0243874879fb0a782862c3c902ab535faabe57d5a505e1R241-R288),[[2]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-b10564ab7d2c520cdd0243874879fb0a782862c3c902ab535faabe57d5a505e1R298-R310))README.mdto describe the new API key workflow, CLI commands, and key storage location. ([[1]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L62-R71),[[2]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L124-R130),[[3]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R141-L143))[docs/roadmap.mdR23-R30](https://github.com/MathiTz/motion-harness/pull/5/files#diff-6a17656d764b8e1930354f341cf7f47960b63845c3046edcd8bbf282aaa2f464R23-R30))Configuration and Cleanup
config.example.yml, reflecting the new key management approach. ([[1]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-eb1da5ba0fb2e9105ef946b94964db48293ab8d344c3961bbbc42509783e7765L51-L60),[[2]](https://github.com/MathiTz/motion-harness/pull/5/files#diff-eb1da5ba0fb2e9105ef946b94964db48293ab8d344c3961bbbc42509783e7765L71-L80))These changes significantly improve security and usability by keeping secrets out of project files and providing a clear, user-friendly way to manage API credentials.