Skip to content

Add config-based OAuth client IDs#31

Open
mduongvandinh wants to merge 1 commit intoRightNow-AI:mainfrom
mduongvandinh:feat/oauth-config
Open

Add config-based OAuth client IDs#31
mduongvandinh wants to merge 1 commit intoRightNow-AI:mainfrom
mduongvandinh:feat/oauth-config

Conversation

@mduongvandinh
Copy link

Summary

  • Users can configure real OAuth client IDs via [oauth] section in config.toml
  • Falls back to built-in placeholder IDs when not configured

Changes

  • Add OAuthConfig struct to KernelConfig with 4 optional provider fields
  • Add client_ids() function accepting Option<&str> overrides per provider
  • Refactor default_client_ids() to delegate to client_ids(None, None, None, None)
  • Add 3 tests verifying override and fallback behavior

Config example

[oauth]
google_client_id = "123456789.apps.googleusercontent.com"
github_client_id = "Iv1.abc123def456"

Test plan

  • All 1710+ workspace tests pass
  • cargo clippy -p openfang-extensions -p openfang-kernel --all-targets -- -D warnings zero warnings
  • cargo fmt --all --check clean
  • 8 OAuth tests pass including 3 new ones

Files changed

  • crates/openfang-types/src/config.rs (+25)
  • crates/openfang-extensions/src/oauth.rs (+72, -13)

Users can now set oauth.google_client_id, oauth.github_client_id,
oauth.microsoft_client_id, and oauth.slack_client_id in config.toml.
Falls back to built-in placeholder IDs when not configured. Adds
OAuthConfig struct to KernelConfig and client_ids() function that
accepts optional overrides.
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.

1 participant