Skip to content

feat: add configuration file support for API key management#1

Open
lhr000lhr wants to merge 2 commits into
argmaxinc:mainfrom
lhr000lhr:main
Open

feat: add configuration file support for API key management#1
lhr000lhr wants to merge 2 commits into
argmaxinc:mainfrom
lhr000lhr:main

Conversation

@lhr000lhr

Copy link
Copy Markdown
  • Add config.json and config.template.json for secure API key storage
  • Update DefaultEnvInitializer to load API keys from JSON config file
  • Add Config struct for JSON decoding with proper error handling
  • Include fallback mechanism when config file is missing
  • Update .gitignore to prevent accidental commit of sensitive config
  • Update README with clear setup instructions for both config file and direct code approaches
  • Improve security by separating API keys from source code

BREAKING CHANGE: API key is now loaded from config.json instead of hardcoded value

- Introduced `config.json` for API key storage, with a template file `config.template.json`.
- Updated `DefaultEnvInitializer.swift` to load API keys from the configuration file.
- Enhanced README with instructions for using the configuration file and emphasized the importance of not committing sensitive information.
- Added background mode support in `Info.plist` for audio processing.
- Updated `.gitignore` to include `config.json` to prevent accidental commits.

@chen-argmax chen-argmax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the change! lgtm just a couple of fields remove

Comment thread Playground.xcodeproj/project.pbxproj Outdated
MACOSX_DEPLOYMENT_TARGET = 14.2;
MARKETING_VERSION = 0.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.argmaxinc.example.Playground${DEVELOPMENT_TEAM}";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = com.argmaxinc.example.Playground;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this required?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, Xcode generated this part

Comment thread Playground.xcodeproj/project.pbxproj Outdated
DEPLOYMENT_POSTPROCESSING = NO;
DEVELOPMENT_ASSET_PATHS = "\"Playground/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 2A7SXV3WJH;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove your development team :)

Comment thread Playground.xcodeproj/project.pbxproj Outdated
MACOSX_DEPLOYMENT_TARGET = 14.2;
MARKETING_VERSION = 0.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.argmaxinc.example.Playground${DEVELOPMENT_TEAM}";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = com.argmaxinc.example.Playground;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Comment thread README.md Outdated
```json
{
"apiKey": "your_actual_api_key_here",
"huggingFaceToken": null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we just open sourced our huggingface repo, so huggingfacetoken is no longer needded, we can remove this field

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yea I also removed huggingFaceToken form the PlainTextAPIKeyProvider now

@lhr000lhr lhr000lhr reopened this Aug 6, 2025
…ration

- Updated `README.md` to reflect the removal of `huggingFaceToken` from the API key configuration.
- Modified `DefaultEnvInitializer.swift` to eliminate references to `huggingFaceToken` when initializing the API key provider.
- Adjusted `config.template.json` to remove `huggingFaceToken` from the template structure.
- Cleared `DEVELOPMENT_TEAM` entries in `project.pbxproj` for better configuration management.
@lhr000lhr lhr000lhr requested a review from chen-argmax August 6, 2025 05:10

@chen-argmax chen-argmax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the contribution!

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