Skip to content

Commit

Permalink
OAuthConfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Jun 15, 2024
1 parent f73fc60 commit b62eb3a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
5 changes: 0 additions & 5 deletions api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ def __init__(self):
# ------------------------
# Platform Configurations.
# ------------------------
self.GITHUB_CLIENT_ID = get_env('GITHUB_CLIENT_ID')
self.GITHUB_CLIENT_SECRET = get_env('GITHUB_CLIENT_SECRET')
self.GOOGLE_CLIENT_ID = get_env('GOOGLE_CLIENT_ID')
self.GOOGLE_CLIENT_SECRET = get_env('GOOGLE_CLIENT_SECRET')

self.HOSTED_OPENAI_API_KEY = get_env('HOSTED_OPENAI_API_KEY')
self.HOSTED_OPENAI_API_BASE = get_env('HOSTED_OPENAI_API_BASE')
self.HOSTED_OPENAI_API_ORGANIZATION = get_env('HOSTED_OPENAI_API_ORGANIZATION')
Expand Down
26 changes: 23 additions & 3 deletions api/configs/feature/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,38 @@ class WorkflowConfigs(BaseModel):
)


class OauthConfigs(BaseModel):
class OAuthConfigs(BaseModel):
"""
oauth configs
"""
OAUTH_REDIRECT_PATH: str = Field(
description='redirect path for ouath',
description='redirect path for OAuth',
default='/console/api/oauth/authorize',
)

GITHUB_CLIENT_ID: Optional[str] = Field(
description='GitHub client id for OAuth',
default=None,
)

GITHUB_CLIENT_SECRET: Optional[str] = Field(
description='GitHub client secret key for OAuth',
default=None,
)

GOOGLE_CLIENT_ID: Optional[str] = Field(
description='Google client id for OAuth',
default=None,
)

Google_CLIENT_SECRET: Optional[str] = Field(
description='Google client secret key for OAuth',
default=None,
)


class FeatureConfigs(
OauthConfigs,
OAuthConfigs,
EndpointConfigs,
HttpConfigs,
LoggingConfigs,
Expand Down

0 comments on commit b62eb3a

Please sign in to comment.