fix!: centralize env credentials and remove inline tokens#77
Merged
Conversation
Introduce src/configs/credentials.ts to load credentials from environment (dotenv) and expose getCredentials(). Modify loadEnv() to return both parsed config and credentials, and propagate credentials into loadConfig(). Update providers to read tokens via getCredentials() and accept optional tokens, removing direct token fallbacks. Adjust ProvidersMap.guessProviders to check credentials. Clean up types: remove deprecated token fields from provider configs to encourage using env/credentials. Update README to mention CONTRIBKIT_* environment variables. Note: this is a breaking change for code that previously set provider tokens directly in the config; tokens should now be provided via env vars or the new credentials API.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #77 +/- ##
============================
============================
Continue to review full report in Codecov by Harness.
|
Introduce a recursive pruneUndefined helper to remove undefined values from env/config objects instead of using JSON.stringify/parse. Apply it in loadEnvCredentials and loadEnv to produce clean credential/config shapes. Also tighten the afdian presence check in providers (use optional chaining) to avoid errors when config.afdian is absent.
|
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.



Description
Introduce src/configs/credentials.ts to load credentials from environment (dotenv) and expose getCredentials(). Modify loadEnv() to return both parsed config and credentials, and propagate credentials into loadConfig(). Update providers to read tokens via getCredentials() and accept optional tokens, removing direct token fallbacks. Adjust ProvidersMap.guessProviders to check credentials. Clean up types: remove deprecated token fields from provider configs to encourage using env/credentials. Update README to mention CONTRIBKIT_* environment variables. Note: this is a breaking change for code that previously set provider tokens directly in the config; tokens should now be provided via env vars or the new credentials API.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage