Skip to content

Commit

Permalink
Remove unused _get_provider_oauth_handler from executor.manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Sep 27, 2024
1 parent 478b59c commit fda2cf6
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions autogpt_platform/backend/backend/executor/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,26 +877,6 @@ def _validate_node_input_credentials(self, graph: Graph, user_id: str):
# ------- UTILITIES ------- #


def _get_provider_oauth_handler(provider_name: str) -> BaseOAuthHandler:
if provider_name not in HANDLERS_BY_NAME:
raise KeyError(f"Unknown provider '{provider_name}'")

client_id = getattr(settings.secrets, f"{provider_name}_client_id")
client_secret = getattr(settings.secrets, f"{provider_name}_client_secret")
if not (client_id and client_secret):
raise Exception( # TODO: ConfigError
f"Integration with provider '{provider_name}' is not configured",
)

handler_class = HANDLERS_BY_NAME[provider_name]
frontend_base_url = settings.config.frontend_base_url
return handler_class(
client_id=client_id,
client_secret=client_secret,
redirect_uri=f"{frontend_base_url}/auth/integrations/oauth_callback",
)


def get_agent_server_client() -> "AgentServer":
from backend.server.rest_api import AgentServer

Expand Down

0 comments on commit fda2cf6

Please sign in to comment.