hyperpocket 0.3.4__py3-none-any.whl → 0.3.6__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- hyperpocket/auth/activeloop/README.md +8 -0
- hyperpocket/auth/activeloop/__init__.py +0 -0
- hyperpocket/auth/activeloop/context.py +15 -0
- hyperpocket/auth/activeloop/token_context.py +11 -0
- hyperpocket/auth/activeloop/token_handler.py +92 -0
- hyperpocket/auth/activeloop/token_schema.py +9 -0
- hyperpocket/auth/adobe/README.md +8 -0
- hyperpocket/auth/adobe/__init__.py +0 -0
- hyperpocket/auth/adobe/context.py +15 -0
- hyperpocket/auth/adobe/token_context.py +11 -0
- hyperpocket/auth/adobe/token_handler.py +89 -0
- hyperpocket/auth/adobe/token_schema.py +11 -0
- hyperpocket/auth/affinity/README.md +18 -0
- hyperpocket/auth/affinity/__init__.py +0 -0
- hyperpocket/auth/affinity/context.py +15 -0
- hyperpocket/auth/affinity/token_context.py +11 -0
- hyperpocket/auth/affinity/token_handler.py +92 -0
- hyperpocket/auth/affinity/token_schema.py +11 -0
- hyperpocket/auth/agentql/README.md +8 -0
- hyperpocket/auth/agentql/__init__.py +0 -0
- hyperpocket/auth/agentql/context.py +15 -0
- hyperpocket/auth/agentql/token_context.py +11 -0
- hyperpocket/auth/agentql/token_handler.py +92 -0
- hyperpocket/auth/agentql/token_schema.py +9 -0
- hyperpocket/auth/ahrefs/README.md +8 -0
- hyperpocket/auth/ahrefs/__init__.py +0 -0
- hyperpocket/auth/ahrefs/context.py +15 -0
- hyperpocket/auth/ahrefs/token_context.py +11 -0
- hyperpocket/auth/ahrefs/token_handler.py +89 -0
- hyperpocket/auth/ahrefs/token_schema.py +11 -0
- hyperpocket/auth/airtable/README.md +8 -0
- hyperpocket/auth/airtable/__init__.py +0 -0
- hyperpocket/auth/airtable/context.py +15 -0
- hyperpocket/auth/airtable/token_context.py +11 -0
- hyperpocket/auth/airtable/token_handler.py +92 -0
- hyperpocket/auth/airtable/token_schema.py +11 -0
- hyperpocket/auth/alchemy/README.md +8 -0
- hyperpocket/auth/alchemy/__init__.py +0 -0
- hyperpocket/auth/alchemy/context.py +15 -0
- hyperpocket/auth/alchemy/token_context.py +11 -0
- hyperpocket/auth/alchemy/token_handler.py +92 -0
- hyperpocket/auth/alchemy/token_schema.py +11 -0
- hyperpocket/auth/altoviz/README.md +8 -0
- hyperpocket/auth/altoviz/__init__.py +0 -0
- hyperpocket/auth/altoviz/context.py +15 -0
- hyperpocket/auth/altoviz/token_context.py +11 -0
- hyperpocket/auth/altoviz/token_handler.py +92 -0
- hyperpocket/auth/altoviz/token_schema.py +11 -0
- hyperpocket/auth/asana/README.md +13 -0
- hyperpocket/auth/asana/__init__.py +0 -0
- hyperpocket/auth/asana/context.py +15 -0
- hyperpocket/auth/asana/oauth2_context.py +36 -0
- hyperpocket/auth/asana/oauth2_handler.py +158 -0
- hyperpocket/auth/asana/oauth2_schema.py +18 -0
- hyperpocket/auth/bamboohr/README.md +9 -0
- hyperpocket/auth/bamboohr/__init__.py +0 -0
- hyperpocket/auth/bamboohr/context.py +15 -0
- hyperpocket/auth/bamboohr/token_context.py +11 -0
- hyperpocket/auth/bamboohr/token_handler.py +92 -0
- hyperpocket/auth/bamboohr/token_schema.py +11 -0
- hyperpocket/auth/bitbucket/README.md +13 -0
- hyperpocket/auth/bitbucket/__init__.py +0 -0
- hyperpocket/auth/bitbucket/context.py +15 -0
- hyperpocket/auth/bitbucket/oauth2_context.py +33 -0
- hyperpocket/auth/bitbucket/oauth2_handler.py +146 -0
- hyperpocket/auth/bitbucket/oauth2_schema.py +18 -0
- hyperpocket/auth/bitwarden/README.md +9 -0
- hyperpocket/auth/bitwarden/__init__.py +0 -0
- hyperpocket/auth/bitwarden/context.py +15 -0
- hyperpocket/auth/bitwarden/token_context.py +11 -0
- hyperpocket/auth/bitwarden/token_handler.py +92 -0
- hyperpocket/auth/bitwarden/token_schema.py +11 -0
- hyperpocket/auth/brevo/README.md +9 -0
- hyperpocket/auth/brevo/__init__.py +0 -0
- hyperpocket/auth/brevo/context.py +15 -0
- hyperpocket/auth/brevo/token_context.py +11 -0
- hyperpocket/auth/brevo/token_handler.py +89 -0
- hyperpocket/auth/brevo/token_schema.py +11 -0
- hyperpocket/auth/brex/README.md +9 -0
- hyperpocket/auth/brex/__init__.py +0 -0
- hyperpocket/auth/brex/context.py +15 -0
- hyperpocket/auth/brex/token_context.py +11 -0
- hyperpocket/auth/brex/token_handler.py +87 -0
- hyperpocket/auth/brex/token_schema.py +11 -0
- hyperpocket/auth/cal/README.md +9 -0
- hyperpocket/auth/cal/__init__.py +0 -0
- hyperpocket/auth/cal/context.py +15 -0
- hyperpocket/auth/cal/token_context.py +11 -0
- hyperpocket/auth/cal/token_handler.py +85 -0
- hyperpocket/auth/cal/token_schema.py +11 -0
- hyperpocket/auth/calendly/README.md +13 -0
- hyperpocket/auth/canvas/README.md +9 -0
- hyperpocket/auth/canvas/__init__.py +0 -0
- hyperpocket/auth/canvas/context.py +15 -0
- hyperpocket/auth/canvas/token_context.py +11 -0
- hyperpocket/auth/canvas/token_handler.py +89 -0
- hyperpocket/auth/canvas/token_schema.py +11 -0
- hyperpocket/auth/clickup/README.md +9 -0
- hyperpocket/auth/clickup/__init__.py +0 -0
- hyperpocket/auth/clickup/context.py +15 -0
- hyperpocket/auth/clickup/token_context.py +11 -0
- hyperpocket/auth/clickup/token_handler.py +92 -0
- hyperpocket/auth/clickup/token_schema.py +11 -0
- hyperpocket/auth/cloudflare/README.md +9 -0
- hyperpocket/auth/cloudflare/__init__.py +0 -0
- hyperpocket/auth/cloudflare/context.py +15 -0
- hyperpocket/auth/cloudflare/token_context.py +11 -0
- hyperpocket/auth/cloudflare/token_handler.py +92 -0
- hyperpocket/auth/cloudflare/token_schema.py +11 -0
- hyperpocket/auth/dailybot/README.md +9 -0
- hyperpocket/auth/dailybot/__init__.py +0 -0
- hyperpocket/auth/dailybot/context.py +15 -0
- hyperpocket/auth/dailybot/token_context.py +11 -0
- hyperpocket/auth/dailybot/token_handler.py +92 -0
- hyperpocket/auth/dailybot/token_schema.py +11 -0
- hyperpocket/auth/datadog/README.md +9 -0
- hyperpocket/auth/datadog/__init__.py +0 -0
- hyperpocket/auth/datadog/context.py +15 -0
- hyperpocket/auth/datadog/token_context.py +11 -0
- hyperpocket/auth/datadog/token_handler.py +92 -0
- hyperpocket/auth/datadog/token_schema.py +11 -0
- hyperpocket/auth/discord/README.md +14 -0
- hyperpocket/auth/discord/__init__.py +0 -0
- hyperpocket/auth/discord/context.py +15 -0
- hyperpocket/auth/discord/oauth2_context.py +35 -0
- hyperpocket/auth/discord/oauth2_handler.py +133 -0
- hyperpocket/auth/discord/oauth2_schema.py +18 -0
- hyperpocket/auth/discord/token_context.py +11 -0
- hyperpocket/auth/discord/token_handler.py +92 -0
- hyperpocket/auth/discord/token_schema.py +11 -0
- hyperpocket/auth/discordbot/README.md +14 -0
- hyperpocket/auth/discordbot/__init__.py +0 -0
- hyperpocket/auth/discordbot/context.py +15 -0
- hyperpocket/auth/discordbot/token_context.py +11 -0
- hyperpocket/auth/discordbot/token_handler.py +92 -0
- hyperpocket/auth/discordbot/token_schema.py +11 -0
- hyperpocket/auth/elevenlabs/README.md +9 -0
- hyperpocket/auth/elevenlabs/__init__.py +0 -0
- hyperpocket/auth/elevenlabs/context.py +15 -0
- hyperpocket/auth/elevenlabs/token_context.py +11 -0
- hyperpocket/auth/elevenlabs/token_handler.py +92 -0
- hyperpocket/auth/elevenlabs/token_schema.py +11 -0
- hyperpocket/auth/exa/README.md +9 -0
- hyperpocket/auth/exa/__init__.py +0 -0
- hyperpocket/auth/exa/context.py +15 -0
- hyperpocket/auth/exa/token_context.py +11 -0
- hyperpocket/auth/exa/token_handler.py +85 -0
- hyperpocket/auth/exa/token_schema.py +11 -0
- hyperpocket/auth/facebook/README.md +13 -0
- hyperpocket/auth/facebook/__init__.py +0 -0
- hyperpocket/auth/facebook/context.py +15 -0
- hyperpocket/auth/facebook/oauth2_context.py +33 -0
- hyperpocket/auth/facebook/oauth2_handler.py +134 -0
- hyperpocket/auth/facebook/oauth2_schema.py +17 -0
- hyperpocket/auth/finage/README.md +9 -0
- hyperpocket/auth/finage/__init__.py +0 -0
- hyperpocket/auth/finage/context.py +15 -0
- hyperpocket/auth/finage/token_context.py +11 -0
- hyperpocket/auth/finage/token_handler.py +89 -0
- hyperpocket/auth/finage/token_schema.py +11 -0
- hyperpocket/auth/github/README.md +14 -0
- hyperpocket/auth/google/README.md +13 -0
- hyperpocket/auth/gumloop/README.md +9 -0
- hyperpocket/auth/happyrobot/README.md +9 -0
- hyperpocket/auth/happyrobot/__init__.py +0 -0
- hyperpocket/auth/happyrobot/context.py +15 -0
- hyperpocket/auth/happyrobot/token_context.py +11 -0
- hyperpocket/auth/happyrobot/token_handler.py +92 -0
- hyperpocket/auth/happyrobot/token_schema.py +9 -0
- hyperpocket/auth/heygen/README.md +9 -0
- hyperpocket/auth/heygen/__init__.py +0 -0
- hyperpocket/auth/heygen/context.py +15 -0
- hyperpocket/auth/heygen/token_context.py +11 -0
- hyperpocket/auth/heygen/token_handler.py +89 -0
- hyperpocket/auth/heygen/token_schema.py +11 -0
- hyperpocket/auth/hubspot/README.md +14 -0
- hyperpocket/auth/hubspot/__init__.py +0 -0
- hyperpocket/auth/hubspot/context.py +15 -0
- hyperpocket/auth/hubspot/oauth2_context.py +35 -0
- hyperpocket/auth/hubspot/oauth2_handler.py +142 -0
- hyperpocket/auth/hubspot/oauth2_schema.py +17 -0
- hyperpocket/auth/hubspot/token_context.py +11 -0
- hyperpocket/auth/hubspot/token_handler.py +92 -0
- hyperpocket/auth/hubspot/token_schema.py +11 -0
- hyperpocket/auth/jira/README.md +14 -0
- hyperpocket/auth/jira/__init__.py +0 -0
- hyperpocket/auth/jira/context.py +15 -0
- hyperpocket/auth/jira/oauth2_context.py +35 -0
- hyperpocket/auth/jira/oauth2_handler.py +135 -0
- hyperpocket/auth/jira/oauth2_schema.py +17 -0
- hyperpocket/auth/jira/token_context.py +11 -0
- hyperpocket/auth/jira/token_handler.py +87 -0
- hyperpocket/auth/jira/token_schema.py +11 -0
- hyperpocket/auth/klaviyo/README.md +10 -0
- hyperpocket/auth/klaviyo/__init__.py +0 -0
- hyperpocket/auth/klaviyo/context.py +15 -0
- hyperpocket/auth/klaviyo/token_context.py +11 -0
- hyperpocket/auth/klaviyo/token_handler.py +92 -0
- hyperpocket/auth/klaviyo/token_schema.py +11 -0
- hyperpocket/auth/lever/README.md +9 -0
- hyperpocket/auth/lever/__init__.py +0 -0
- hyperpocket/auth/lever/context.py +15 -0
- hyperpocket/auth/lever/token_context.py +11 -0
- hyperpocket/auth/lever/token_handler.py +89 -0
- hyperpocket/auth/lever/token_schema.py +11 -0
- hyperpocket/auth/lever_sandbox/README.md +9 -0
- hyperpocket/auth/lever_sandbox/__init__.py +0 -0
- hyperpocket/auth/lever_sandbox/context.py +15 -0
- hyperpocket/auth/lever_sandbox/token_context.py +11 -0
- hyperpocket/auth/lever_sandbox/token_handler.py +94 -0
- hyperpocket/auth/lever_sandbox/token_schema.py +11 -0
- hyperpocket/auth/linear/README.md +17 -0
- hyperpocket/auth/linear/context.py +1 -1
- hyperpocket/auth/linear/oauth2_context.py +33 -0
- hyperpocket/auth/linear/oauth2_handler.py +155 -0
- hyperpocket/auth/linear/oauth2_schema.py +17 -0
- hyperpocket/auth/linkedin/README.md +16 -0
- hyperpocket/auth/linkedin/__init__.py +0 -0
- hyperpocket/auth/linkedin/context.py +15 -0
- hyperpocket/auth/linkedin/oauth2_context.py +33 -0
- hyperpocket/auth/linkedin/oauth2_handler.py +154 -0
- hyperpocket/auth/linkedin/oauth2_schema.py +18 -0
- hyperpocket/auth/listennotes/README.md +12 -0
- hyperpocket/auth/listennotes/__init__.py +0 -0
- hyperpocket/auth/listennotes/context.py +15 -0
- hyperpocket/auth/listennotes/token_context.py +11 -0
- hyperpocket/auth/listennotes/token_handler.py +92 -0
- hyperpocket/auth/listennotes/token_schema.py +11 -0
- hyperpocket/auth/mailchimp/README.md +16 -0
- hyperpocket/auth/mailchimp/__init__.py +0 -0
- hyperpocket/auth/mailchimp/context.py +15 -0
- hyperpocket/auth/mailchimp/oauth2_context.py +33 -0
- hyperpocket/auth/mailchimp/oauth2_handler.py +153 -0
- hyperpocket/auth/mailchimp/oauth2_schema.py +17 -0
- hyperpocket/auth/mem0/README.md +11 -0
- hyperpocket/auth/mem0/__init__.py +0 -0
- hyperpocket/auth/mem0/context.py +15 -0
- hyperpocket/auth/mem0/token_context.py +11 -0
- hyperpocket/auth/mem0/token_handler.py +87 -0
- hyperpocket/auth/mem0/token_schema.py +11 -0
- hyperpocket/auth/microsoft_clarity/README.md +12 -0
- hyperpocket/auth/microsoft_clarity/__init__.py +0 -0
- hyperpocket/auth/microsoft_clarity/context.py +15 -0
- hyperpocket/auth/microsoft_clarity/token_context.py +15 -0
- hyperpocket/auth/microsoft_clarity/token_handler.py +102 -0
- hyperpocket/auth/microsoft_clarity/token_schema.py +11 -0
- hyperpocket/auth/neon/README.md +11 -0
- hyperpocket/auth/neon/__init__.py +0 -0
- hyperpocket/auth/neon/context.py +15 -0
- hyperpocket/auth/neon/token_context.py +11 -0
- hyperpocket/auth/neon/token_handler.py +87 -0
- hyperpocket/auth/neon/token_schema.py +11 -0
- hyperpocket/auth/ngrok/README.md +12 -0
- hyperpocket/auth/ngrok/__init__.py +0 -0
- hyperpocket/auth/ngrok/context.py +15 -0
- hyperpocket/auth/ngrok/token_context.py +11 -0
- hyperpocket/auth/ngrok/token_handler.py +89 -0
- hyperpocket/auth/ngrok/token_schema.py +11 -0
- hyperpocket/auth/notion/README.md +10 -20
- hyperpocket/auth/notion/oauth2_context.py +33 -0
- hyperpocket/auth/notion/oauth2_handler.py +152 -0
- hyperpocket/auth/notion/oauth2_schema.py +22 -0
- hyperpocket/auth/oncehub/README.md +11 -0
- hyperpocket/auth/oncehub/__init__.py +0 -0
- hyperpocket/auth/oncehub/context.py +15 -0
- hyperpocket/auth/oncehub/token_context.py +11 -0
- hyperpocket/auth/oncehub/token_handler.py +92 -0
- hyperpocket/auth/oncehub/token_schema.py +11 -0
- hyperpocket/auth/pagerduty/README.md +12 -0
- hyperpocket/auth/pagerduty/__init__.py +0 -0
- hyperpocket/auth/pagerduty/context.py +15 -0
- hyperpocket/auth/pagerduty/token_context.py +11 -0
- hyperpocket/auth/pagerduty/token_handler.py +92 -0
- hyperpocket/auth/pagerduty/token_schema.py +11 -0
- hyperpocket/auth/pandadoc/README.md +12 -0
- hyperpocket/auth/pandadoc/__init__.py +0 -0
- hyperpocket/auth/pandadoc/context.py +15 -0
- hyperpocket/auth/pandadoc/token_context.py +11 -0
- hyperpocket/auth/pandadoc/token_handler.py +92 -0
- hyperpocket/auth/pandadoc/token_schema.py +11 -0
- hyperpocket/auth/pipedrive/README.md +12 -0
- hyperpocket/auth/pipedrive/__init__.py +0 -0
- hyperpocket/auth/pipedrive/context.py +15 -0
- hyperpocket/auth/pipedrive/token_context.py +11 -0
- hyperpocket/auth/pipedrive/token_handler.py +92 -0
- hyperpocket/auth/pipedrive/token_schema.py +11 -0
- hyperpocket/auth/posthog/README.md +12 -0
- hyperpocket/auth/posthog/__init__.py +0 -0
- hyperpocket/auth/posthog/context.py +15 -0
- hyperpocket/auth/posthog/token_context.py +11 -0
- hyperpocket/auth/posthog/token_handler.py +92 -0
- hyperpocket/auth/posthog/token_schema.py +11 -0
- hyperpocket/auth/provider.py +58 -0
- hyperpocket/auth/ravenseotools/README.md +12 -0
- hyperpocket/auth/ravenseotools/__init__.py +0 -0
- hyperpocket/auth/ravenseotools/context.py +15 -0
- hyperpocket/auth/ravenseotools/token_context.py +11 -0
- hyperpocket/auth/ravenseotools/token_handler.py +94 -0
- hyperpocket/auth/ravenseotools/token_schema.py +11 -0
- hyperpocket/auth/reddit/README.md +16 -0
- hyperpocket/auth/salesforce/README.md +16 -0
- hyperpocket/auth/salesforce/__init__.py +0 -0
- hyperpocket/auth/salesforce/context.py +15 -0
- hyperpocket/auth/salesforce/oauth2_context.py +33 -0
- hyperpocket/auth/salesforce/oauth2_handler.py +136 -0
- hyperpocket/auth/salesforce/oauth2_schema.py +21 -0
- hyperpocket/auth/semantic_scholar/__init__.py +0 -0
- hyperpocket/auth/semantic_scholar/context.py +12 -0
- hyperpocket/auth/semantic_scholar/token_context.py +11 -0
- hyperpocket/auth/semantic_scholar/token_handler.py +64 -0
- hyperpocket/auth/semantic_scholar/token_schema.py +7 -0
- hyperpocket/auth/sendgrid/README.md +12 -0
- hyperpocket/auth/sendgrid/__init__.py +0 -0
- hyperpocket/auth/sendgrid/context.py +15 -0
- hyperpocket/auth/sendgrid/token_context.py +11 -0
- hyperpocket/auth/sendgrid/token_handler.py +92 -0
- hyperpocket/auth/sendgrid/token_schema.py +11 -0
- hyperpocket/auth/serpapi/README.md +13 -0
- hyperpocket/auth/serpapi/token_context.py +2 -4
- hyperpocket/auth/serpapi/token_handler.py +44 -16
- hyperpocket/auth/slack/README.md +17 -0
- hyperpocket/auth/spotify/README.md +15 -0
- hyperpocket/auth/spotify/__init__.py +0 -0
- hyperpocket/auth/spotify/context.py +15 -0
- hyperpocket/auth/spotify/oauth2_context.py +33 -0
- hyperpocket/auth/spotify/oauth2_handler.py +163 -0
- hyperpocket/auth/spotify/oauth2_schema.py +18 -0
- hyperpocket/auth/stripe/README.md +12 -0
- hyperpocket/auth/stripe/__init__.py +0 -0
- hyperpocket/auth/stripe/context.py +15 -0
- hyperpocket/auth/stripe/token_context.py +11 -0
- hyperpocket/auth/stripe/token_handler.py +89 -0
- hyperpocket/auth/stripe/token_schema.py +11 -0
- hyperpocket/auth/supabase/README.md +11 -0
- hyperpocket/auth/supabase/__init__.py +0 -0
- hyperpocket/auth/supabase/context.py +15 -0
- hyperpocket/auth/supabase/token_context.py +11 -0
- hyperpocket/auth/supabase/token_handler.py +92 -0
- hyperpocket/auth/supabase/token_schema.py +11 -0
- hyperpocket/auth/tavily/README.md +11 -0
- hyperpocket/auth/tavily/__init__.py +0 -0
- hyperpocket/auth/tavily/context.py +15 -0
- hyperpocket/auth/tavily/token_context.py +11 -0
- hyperpocket/auth/tavily/token_handler.py +89 -0
- hyperpocket/auth/tavily/token_schema.py +11 -0
- hyperpocket/auth/timekit/README.md +11 -0
- hyperpocket/auth/timekit/__init__.py +0 -0
- hyperpocket/auth/timekit/context.py +15 -0
- hyperpocket/auth/timekit/token_context.py +11 -0
- hyperpocket/auth/timekit/token_handler.py +92 -0
- hyperpocket/auth/timekit/token_schema.py +11 -0
- hyperpocket/auth/trello/README.md +12 -0
- hyperpocket/auth/trello/__init__.py +0 -0
- hyperpocket/auth/trello/context.py +15 -0
- hyperpocket/auth/trello/token_context.py +11 -0
- hyperpocket/auth/trello/token_handler.py +89 -0
- hyperpocket/auth/trello/token_schema.py +11 -0
- hyperpocket/auth/wandb/README.md +11 -0
- hyperpocket/auth/wandb/__init__.py +0 -0
- hyperpocket/auth/wandb/context.py +15 -0
- hyperpocket/auth/wandb/token_context.py +11 -0
- hyperpocket/auth/wandb/token_handler.py +89 -0
- hyperpocket/auth/wandb/token_schema.py +9 -0
- hyperpocket/auth/workiom/README.md +12 -0
- hyperpocket/auth/workiom/__init__.py +0 -0
- hyperpocket/auth/workiom/context.py +15 -0
- hyperpocket/auth/workiom/token_context.py +11 -0
- hyperpocket/auth/workiom/token_handler.py +92 -0
- hyperpocket/auth/workiom/token_schema.py +11 -0
- hyperpocket/auth/x/README.md +15 -0
- hyperpocket/auth/zoom/README.md +16 -0
- hyperpocket/auth/zoom/__init__.py +0 -0
- hyperpocket/auth/zoom/context.py +15 -0
- hyperpocket/auth/zoom/oauth2_context.py +33 -0
- hyperpocket/auth/zoom/oauth2_handler.py +153 -0
- hyperpocket/auth/zoom/oauth2_schema.py +19 -0
- hyperpocket/cli/__main__.py +4 -1
- hyperpocket/cli/auth_oauth2.py +79 -38
- hyperpocket/cli/auth_token.py +28 -16
- hyperpocket/cli/codegen/auth/__init__.py +4 -1
- hyperpocket/cli/codegen/auth/auth_context_template.py +1 -1
- hyperpocket/cli/codegen/auth/auth_oauth2_context_template.py +5 -4
- hyperpocket/cli/codegen/auth/auth_oauth2_handler_template.py +20 -45
- hyperpocket/cli/codegen/auth/auth_oauth2_schema_template.py +4 -3
- hyperpocket/cli/codegen/auth/auth_token_context_template.py +6 -6
- hyperpocket/cli/codegen/auth/auth_token_handler_template.py +14 -14
- hyperpocket/cli/codegen/auth/auth_token_schema_template.py +3 -3
- hyperpocket/cli/codegen/auth/server_auth_template.py +20 -5
- hyperpocket/cli/codegen/tool/__init__.py +1 -1
- hyperpocket/cli/codegen/tool/tool_main_template.py +1 -0
- hyperpocket/cli/{tool.py → tool_create.py} +24 -19
- hyperpocket/cli/tool_export.py +240 -0
- hyperpocket/config/auth.py +78 -13
- hyperpocket/pocket_core.py +5 -3
- hyperpocket/server/auth/activeloop.py +25 -0
- hyperpocket/server/auth/adobe.py +14 -0
- hyperpocket/server/auth/affinity.py +14 -0
- hyperpocket/server/auth/agentql.py +25 -0
- hyperpocket/server/auth/ahrefs.py +14 -0
- hyperpocket/server/auth/airtable.py +14 -0
- hyperpocket/server/auth/alchemy.py +14 -0
- hyperpocket/server/auth/altoviz.py +14 -0
- hyperpocket/server/auth/asana.py +25 -0
- hyperpocket/server/auth/bamboohr.py +14 -0
- hyperpocket/server/auth/bitbucket.py +25 -0
- hyperpocket/server/auth/bitwarden.py +14 -0
- hyperpocket/server/auth/brevo.py +14 -0
- hyperpocket/server/auth/brex.py +14 -0
- hyperpocket/server/auth/cal.py +14 -0
- hyperpocket/server/auth/canvas.py +14 -0
- hyperpocket/server/auth/clickup.py +14 -0
- hyperpocket/server/auth/cloudflare.py +14 -0
- hyperpocket/server/auth/dailybot.py +14 -0
- hyperpocket/server/auth/datadog.py +14 -0
- hyperpocket/server/auth/discord.py +25 -0
- hyperpocket/server/auth/discordbot.py +14 -0
- hyperpocket/server/auth/elevenlabs.py +14 -0
- hyperpocket/server/auth/exa.py +14 -0
- hyperpocket/server/auth/facebook.py +25 -0
- hyperpocket/server/auth/finage.py +14 -0
- hyperpocket/server/auth/happyrobot.py +26 -0
- hyperpocket/server/auth/heygen.py +14 -0
- hyperpocket/server/auth/hubspot.py +26 -0
- hyperpocket/server/auth/jira.py +25 -0
- hyperpocket/server/auth/klaviyo.py +14 -0
- hyperpocket/server/auth/lever.py +14 -0
- hyperpocket/server/auth/lever_sandbox.py +14 -0
- hyperpocket/server/auth/linear.py +21 -2
- hyperpocket/server/auth/linkedin.py +25 -0
- hyperpocket/server/auth/listennotes.py +14 -0
- hyperpocket/server/auth/mailchimp.py +25 -0
- hyperpocket/server/auth/mem0.py +14 -0
- hyperpocket/server/auth/microsoft_clarity.py +14 -0
- hyperpocket/server/auth/neon.py +14 -0
- hyperpocket/server/auth/ngrok.py +14 -0
- hyperpocket/server/auth/notion.py +20 -1
- hyperpocket/server/auth/oncehub.py +14 -0
- hyperpocket/server/auth/pagerduty.py +14 -0
- hyperpocket/server/auth/pandadoc.py +14 -0
- hyperpocket/server/auth/pipedrive.py +14 -0
- hyperpocket/server/auth/posthog.py +14 -0
- hyperpocket/server/auth/ravenseotools.py +14 -0
- hyperpocket/server/auth/salesforce.py +25 -0
- hyperpocket/server/auth/semantic_scholar.py +27 -0
- hyperpocket/server/auth/sendgrid.py +14 -0
- hyperpocket/server/auth/serpapi.py +5 -5
- hyperpocket/server/auth/spotify.py +25 -0
- hyperpocket/server/auth/stripe.py +14 -0
- hyperpocket/server/auth/supabase.py +14 -0
- hyperpocket/server/auth/tavily.py +14 -0
- hyperpocket/server/auth/timekit.py +14 -0
- hyperpocket/server/auth/trello.py +14 -0
- hyperpocket/server/auth/wandb.py +25 -0
- hyperpocket/server/auth/workiom.py +14 -0
- hyperpocket/server/auth/zoom.py +25 -0
- hyperpocket/server/server.py +9 -6
- {hyperpocket-0.3.4.dist-info → hyperpocket-0.3.6.dist-info}/METADATA +1 -1
- hyperpocket-0.3.6.dist-info/RECORD +593 -0
- hyperpocket-0.3.4.dist-info/RECORD +0 -163
- {hyperpocket-0.3.4.dist-info → hyperpocket-0.3.6.dist-info}/WHEEL +0 -0
- {hyperpocket-0.3.4.dist-info → hyperpocket-0.3.6.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
from hyperpocket.auth.context import AuthContext
|
2
|
+
|
3
|
+
|
4
|
+
class SalesforceAuthContext(AuthContext):
|
5
|
+
_ACCESS_TOKEN_KEY: str = "SALESFORCE_TOKEN"
|
6
|
+
|
7
|
+
def to_dict(self) -> dict[str, str]:
|
8
|
+
return {
|
9
|
+
self._ACCESS_TOKEN_KEY: self.access_token,
|
10
|
+
}
|
11
|
+
|
12
|
+
def to_profiled_dict(self, profile: str) -> dict[str, str]:
|
13
|
+
return {
|
14
|
+
f"{profile.upper()}_{self._ACCESS_TOKEN_KEY}": self.access_token,
|
15
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from datetime import datetime, timedelta, timezone
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from pydantic import Field
|
5
|
+
|
6
|
+
from hyperpocket.auth.salesforce.context import SalesforceAuthContext
|
7
|
+
from hyperpocket.auth.salesforce.oauth2_schema import SalesforceOAuth2Response
|
8
|
+
|
9
|
+
|
10
|
+
class SalesforceOAuth2AuthContext(SalesforceAuthContext):
|
11
|
+
refresh_token: Optional[str] = Field(default=None, description="refresh token")
|
12
|
+
|
13
|
+
@classmethod
|
14
|
+
def from_salesforce_oauth2_response(cls, response: SalesforceOAuth2Response):
|
15
|
+
description = f"Salesforce OAuth2 Context logged in"
|
16
|
+
now = datetime.now(tz=timezone.utc)
|
17
|
+
|
18
|
+
access_token = response.access_token
|
19
|
+
refresh_token = response.refresh_token
|
20
|
+
expires_in = response.expires_in
|
21
|
+
|
22
|
+
if expires_in:
|
23
|
+
expires_at = now + timedelta(seconds=60 * 60) # 1 hour
|
24
|
+
else:
|
25
|
+
expires_at = None
|
26
|
+
|
27
|
+
return cls(
|
28
|
+
access_token=access_token,
|
29
|
+
refresh_token=refresh_token,
|
30
|
+
expires_at=expires_at,
|
31
|
+
description=description,
|
32
|
+
detail=response,
|
33
|
+
)
|
@@ -0,0 +1,136 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
from urllib.parse import urljoin, urlencode
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from hyperpocket.auth import AuthProvider
|
7
|
+
from hyperpocket.auth.context import AuthContext
|
8
|
+
from hyperpocket.auth.handler import AuthHandlerInterface
|
9
|
+
from hyperpocket.auth.salesforce.oauth2_context import SalesforceOAuth2AuthContext
|
10
|
+
from hyperpocket.auth.salesforce.oauth2_schema import (
|
11
|
+
SalesforceOAuth2Response,
|
12
|
+
SalesforceOAuth2Request,
|
13
|
+
)
|
14
|
+
from hyperpocket.config import config
|
15
|
+
from hyperpocket.futures import FutureStore
|
16
|
+
|
17
|
+
|
18
|
+
class SalesforceOAuth2AuthHandler(AuthHandlerInterface):
|
19
|
+
_SALESFORCE_OAUTH_URL: str = "{base_url}/services/oauth2/authorize"
|
20
|
+
_SALESFORCE_TOKEN_URL: str = "{base_url}/services/oauth2/token"
|
21
|
+
|
22
|
+
name: str = "salesforce-oauth2"
|
23
|
+
description: str = "This handler is used to authenticate users using the Salesforce OAuth2 authentication method."
|
24
|
+
scoped: bool = True
|
25
|
+
|
26
|
+
@staticmethod
|
27
|
+
def provider() -> AuthProvider:
|
28
|
+
return AuthProvider.SALESFORCE
|
29
|
+
|
30
|
+
@staticmethod
|
31
|
+
def provider_default() -> bool:
|
32
|
+
return True
|
33
|
+
|
34
|
+
@staticmethod
|
35
|
+
def recommended_scopes() -> set[str]:
|
36
|
+
return set()
|
37
|
+
|
38
|
+
def prepare(
|
39
|
+
self,
|
40
|
+
auth_req: SalesforceOAuth2Request,
|
41
|
+
thread_id: str,
|
42
|
+
profile: str,
|
43
|
+
future_uid: str,
|
44
|
+
*args,
|
45
|
+
**kwargs,
|
46
|
+
) -> str:
|
47
|
+
redirect_uri = urljoin(
|
48
|
+
config().public_base_url + "/",
|
49
|
+
f"{config().callback_url_rewrite_prefix}/auth/salesforce/oauth2/callback",
|
50
|
+
)
|
51
|
+
auth_url = self._make_auth_url(
|
52
|
+
req=auth_req, redirect_uri=redirect_uri, state=future_uid
|
53
|
+
)
|
54
|
+
|
55
|
+
FutureStore.create_future(
|
56
|
+
future_uid,
|
57
|
+
data={
|
58
|
+
"redirect_uri": redirect_uri,
|
59
|
+
"thread_id": thread_id,
|
60
|
+
"profile": profile,
|
61
|
+
},
|
62
|
+
)
|
63
|
+
|
64
|
+
return f"User needs to authenticate using the following URL: {auth_url}"
|
65
|
+
|
66
|
+
async def authenticate(
|
67
|
+
self, auth_req: SalesforceOAuth2Request, future_uid: str, *args, **kwargs
|
68
|
+
) -> AuthContext:
|
69
|
+
future_data = FutureStore.get_future(future_uid)
|
70
|
+
auth_code = await future_data.future
|
71
|
+
base_token_url = self._SALESFORCE_TOKEN_URL.format(
|
72
|
+
base_url=config().auth.salesforce.domain_url
|
73
|
+
)
|
74
|
+
async with httpx.AsyncClient() as client:
|
75
|
+
resp = await client.post(
|
76
|
+
url=base_token_url,
|
77
|
+
data={
|
78
|
+
"grant_type": "authorization_code",
|
79
|
+
"code": auth_code,
|
80
|
+
"client_id": auth_req.client_id,
|
81
|
+
"client_secret": auth_req.client_secret,
|
82
|
+
"redirect_uri": future_data.data["redirect_uri"],
|
83
|
+
},
|
84
|
+
)
|
85
|
+
resp.raise_for_status()
|
86
|
+
resp_json = resp.json()
|
87
|
+
resp_typed = SalesforceOAuth2Response(**resp_json)
|
88
|
+
return SalesforceOAuth2AuthContext.from_salesforce_oauth2_response(resp_typed)
|
89
|
+
|
90
|
+
async def refresh(
|
91
|
+
self, auth_req: SalesforceOAuth2Request, context: AuthContext, *args, **kwargs
|
92
|
+
) -> AuthContext:
|
93
|
+
salesforce_context: SalesforceOAuth2AuthContext = context
|
94
|
+
refresh_token = salesforce_context.refresh_token
|
95
|
+
|
96
|
+
async with httpx.AsyncClient() as client:
|
97
|
+
resp = await client.post(
|
98
|
+
url=self._SALESFORCE_TOKEN_URL,
|
99
|
+
data={
|
100
|
+
"client_id": auth_req.client_id,
|
101
|
+
"client_secret": auth_req.client_secret,
|
102
|
+
"grant_type": "refresh_token",
|
103
|
+
"refresh_token": refresh_token,
|
104
|
+
},
|
105
|
+
)
|
106
|
+
|
107
|
+
resp.raise_for_status()
|
108
|
+
resp_json = resp.json()
|
109
|
+
new_resp = SalesforceOAuth2Response(**resp_json)
|
110
|
+
|
111
|
+
return SalesforceOAuth2AuthContext.from_salesforce_oauth2_response(new_resp)
|
112
|
+
|
113
|
+
def _make_auth_url(
|
114
|
+
self, req: SalesforceOAuth2Request, redirect_uri: str, state: str
|
115
|
+
):
|
116
|
+
params = {
|
117
|
+
"scope": " ".join(req.auth_scopes),
|
118
|
+
"client_id": req.client_id,
|
119
|
+
"redirect_uri": redirect_uri,
|
120
|
+
"response_type": "code",
|
121
|
+
"state": state,
|
122
|
+
}
|
123
|
+
base_auth_url = self._SALESFORCE_OAUTH_URL.format(
|
124
|
+
base_url=config().auth.salesforce.domain_url
|
125
|
+
)
|
126
|
+
auth_url = f"{base_auth_url}?{urlencode(params)}"
|
127
|
+
return auth_url
|
128
|
+
|
129
|
+
def make_request(
|
130
|
+
self, auth_scopes: Optional[list[str]] = None, **kwargs
|
131
|
+
) -> SalesforceOAuth2Request:
|
132
|
+
return SalesforceOAuth2Request(
|
133
|
+
auth_scopes=auth_scopes,
|
134
|
+
client_id=config().auth.salesforce.client_id,
|
135
|
+
client_secret=config().auth.salesforce.client_secret,
|
136
|
+
)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
|
3
|
+
from pydantic import Field
|
4
|
+
|
5
|
+
from hyperpocket.auth.schema import AuthenticateRequest, AuthenticateResponse
|
6
|
+
|
7
|
+
|
8
|
+
class SalesforceOAuth2Request(AuthenticateRequest):
|
9
|
+
client_id: str
|
10
|
+
client_secret: str
|
11
|
+
|
12
|
+
|
13
|
+
class SalesforceOAuth2Response(AuthenticateResponse):
|
14
|
+
access_token: str
|
15
|
+
signature: str
|
16
|
+
scope: str
|
17
|
+
id_token: str
|
18
|
+
instance_url: str
|
19
|
+
token_type: str
|
20
|
+
issued_at: str
|
21
|
+
refresh_token: Optional[str] = Field(default=None)
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
from hyperpocket.auth.context import AuthContext
|
3
|
+
class SemanticScholarAuthContext(AuthContext):
|
4
|
+
_ACCESS_TOKEN_KEY: str = "SEMANTIC_SCHOLAR_TOKEN"
|
5
|
+
def to_dict(self) -> dict[str, str]:
|
6
|
+
return {
|
7
|
+
self._ACCESS_TOKEN_KEY: self.access_token,
|
8
|
+
}
|
9
|
+
def to_profiled_dict(self, profile: str) -> dict[str, str]:
|
10
|
+
return {
|
11
|
+
f"{profile.upper()}_{self._ACCESS_TOKEN_KEY}": self.access_token,
|
12
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from hyperpocket.auth.semantic_scholar.context import SemanticScholarAuthContext
|
2
|
+
from hyperpocket.auth.semantic_scholar.token_schema import SemanticScholarTokenResponse
|
3
|
+
class SemanticScholarTokenAuthContext(SemanticScholarAuthContext):
|
4
|
+
@classmethod
|
5
|
+
def from_semantic_scholar_token_response(cls, response: SemanticScholarTokenResponse):
|
6
|
+
description = f'SemanticScholar Token Context logged in'
|
7
|
+
return cls(
|
8
|
+
access_token=response.access_token,
|
9
|
+
description=description,
|
10
|
+
expires_at=None
|
11
|
+
)
|
@@ -0,0 +1,64 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
from urllib.parse import urljoin, urlencode
|
3
|
+
|
4
|
+
from hyperpocket.auth import AuthProvider
|
5
|
+
from hyperpocket.auth.context import AuthContext
|
6
|
+
from hyperpocket.auth.handler import AuthHandlerInterface, AuthenticateRequest
|
7
|
+
from hyperpocket.auth.semantic_scholar.token_context import SemanticScholarTokenAuthContext
|
8
|
+
from hyperpocket.auth.semantic_scholar.token_schema import SemanticScholarTokenResponse, SemanticScholarTokenRequest
|
9
|
+
from hyperpocket.config import config
|
10
|
+
from hyperpocket.futures import FutureStore
|
11
|
+
|
12
|
+
|
13
|
+
class SemanticScholarTokenAuthHandler(AuthHandlerInterface):
|
14
|
+
name: str = "semantic-scholar-token"
|
15
|
+
description: str = "This handler is used to authenticate users using the SemanticScholar token."
|
16
|
+
scoped: bool = False
|
17
|
+
|
18
|
+
_TOKEN_URL: str = urljoin(config().public_base_url + "/", f"{config().callback_url_rewrite_prefix}/auth/token")
|
19
|
+
|
20
|
+
@staticmethod
|
21
|
+
def provider() -> AuthProvider:
|
22
|
+
return AuthProvider.SEMANTIC_SCHOLAR
|
23
|
+
|
24
|
+
@staticmethod
|
25
|
+
def recommended_scopes() -> set[str]:
|
26
|
+
return set()
|
27
|
+
|
28
|
+
def prepare(self, auth_req: SemanticScholarTokenRequest, thread_id: str, profile: str,
|
29
|
+
future_uid: str, *args, **kwargs) -> str:
|
30
|
+
redirect_uri = urljoin(
|
31
|
+
config().public_base_url + "/",
|
32
|
+
f"{config().callback_url_rewrite_prefix}/auth/semantic_scholar/token/callback",
|
33
|
+
)
|
34
|
+
url = self._make_auth_url(auth_req=auth_req, redirect_uri=redirect_uri, state=future_uid)
|
35
|
+
FutureStore.create_future(future_uid, data={
|
36
|
+
"redirect_uri": redirect_uri,
|
37
|
+
"thread_id": thread_id,
|
38
|
+
"profile": profile,
|
39
|
+
})
|
40
|
+
|
41
|
+
return f'User needs to authenticate using the following URL: {url}'
|
42
|
+
|
43
|
+
async def authenticate(self, auth_req: SemanticScholarTokenRequest, future_uid: str, *args, **kwargs) -> AuthContext:
|
44
|
+
future_data = FutureStore.get_future(future_uid)
|
45
|
+
access_token = await future_data.future
|
46
|
+
|
47
|
+
response = SemanticScholarTokenResponse(access_token=access_token)
|
48
|
+
context = SemanticScholarTokenAuthContext.from_semantic_scholar_token_response(response)
|
49
|
+
|
50
|
+
return context
|
51
|
+
|
52
|
+
async def refresh(self, auth_req: SemanticScholarTokenRequest, context: AuthContext, *args, **kwargs) -> AuthContext:
|
53
|
+
raise Exception("SemanticScholar token doesn't support refresh")
|
54
|
+
|
55
|
+
def _make_auth_url(self, auth_req: SemanticScholarTokenRequest, redirect_uri: str, state: str):
|
56
|
+
params = {
|
57
|
+
"redirect_uri": redirect_uri,
|
58
|
+
"state": state,
|
59
|
+
}
|
60
|
+
auth_url = f"{self._TOKEN_URL}?{urlencode(params)}"
|
61
|
+
return auth_url
|
62
|
+
|
63
|
+
def make_request(self, auth_scopes: Optional[list[str]] = None, **kwargs) -> SemanticScholarTokenRequest:
|
64
|
+
return SemanticScholarTokenRequest()
|
@@ -0,0 +1,7 @@
|
|
1
|
+
from typing import List, Optional
|
2
|
+
from pydantic import BaseModel
|
3
|
+
from hyperpocket.auth.schema import AuthenticateRequest, AuthenticateResponse
|
4
|
+
class SemanticScholarTokenRequest(AuthenticateRequest):
|
5
|
+
pass
|
6
|
+
class SemanticScholarTokenResponse(AuthenticateResponse):
|
7
|
+
access_token: str
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Sendgrid Authentication
|
2
|
+
|
3
|
+
This document provides instructions on how to set up token-based authentication for Sendgrid using Hyperpocket.
|
4
|
+
|
5
|
+
## Supported Authentication Types
|
6
|
+
|
7
|
+
- Token
|
8
|
+
|
9
|
+
## Additional Resources
|
10
|
+
|
11
|
+
- [Official Documentation](https://sendgrid.com/docs)
|
12
|
+
- [Support](https://support.sendgrid.com)
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from hyperpocket.auth.context import AuthContext
|
2
|
+
|
3
|
+
|
4
|
+
class SendgridAuthContext(AuthContext):
|
5
|
+
_ACCESS_TOKEN_KEY: str = "SENDGRID_TOKEN"
|
6
|
+
|
7
|
+
def to_dict(self) -> dict[str, str]:
|
8
|
+
return {
|
9
|
+
self._ACCESS_TOKEN_KEY: self.access_token,
|
10
|
+
}
|
11
|
+
|
12
|
+
def to_profiled_dict(self, profile: str) -> dict[str, str]:
|
13
|
+
return {
|
14
|
+
f"{profile.upper()}_{self._ACCESS_TOKEN_KEY}": self.access_token,
|
15
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from hyperpocket.auth.sendgrid.context import SendgridAuthContext
|
2
|
+
from hyperpocket.auth.sendgrid.token_schema import SendgridTokenResponse
|
3
|
+
|
4
|
+
|
5
|
+
class SendgridTokenAuthContext(SendgridAuthContext):
|
6
|
+
@classmethod
|
7
|
+
def from_sendgrid_token_response(cls, response: SendgridTokenResponse):
|
8
|
+
description = f"Sendgrid Token Context logged in"
|
9
|
+
return cls(
|
10
|
+
access_token=response.access_token, description=description, expires_at=None
|
11
|
+
)
|
@@ -0,0 +1,92 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
from urllib.parse import urljoin, urlencode
|
3
|
+
|
4
|
+
from hyperpocket.auth import AuthProvider
|
5
|
+
from hyperpocket.auth.context import AuthContext
|
6
|
+
from hyperpocket.auth.handler import AuthHandlerInterface, AuthenticateRequest
|
7
|
+
from hyperpocket.auth.sendgrid.token_context import SendgridTokenAuthContext
|
8
|
+
from hyperpocket.auth.sendgrid.token_schema import (
|
9
|
+
SendgridTokenResponse,
|
10
|
+
SendgridTokenRequest,
|
11
|
+
)
|
12
|
+
from hyperpocket.config import config
|
13
|
+
from hyperpocket.futures import FutureStore
|
14
|
+
|
15
|
+
|
16
|
+
class SendgridTokenAuthHandler(AuthHandlerInterface):
|
17
|
+
name: str = "sendgrid-token"
|
18
|
+
description: str = (
|
19
|
+
"This handler is used to authenticate users using the Sendgrid token."
|
20
|
+
)
|
21
|
+
scoped: bool = False
|
22
|
+
|
23
|
+
_TOKEN_URL: str = urljoin(
|
24
|
+
config().public_base_url + "/",
|
25
|
+
f"{config().callback_url_rewrite_prefix}/auth/token",
|
26
|
+
)
|
27
|
+
|
28
|
+
@staticmethod
|
29
|
+
def provider() -> AuthProvider:
|
30
|
+
return AuthProvider.SENDGRID
|
31
|
+
|
32
|
+
@staticmethod
|
33
|
+
def recommended_scopes() -> set[str]:
|
34
|
+
return set()
|
35
|
+
|
36
|
+
def prepare(
|
37
|
+
self,
|
38
|
+
auth_req: SendgridTokenRequest,
|
39
|
+
thread_id: str,
|
40
|
+
profile: str,
|
41
|
+
future_uid: str,
|
42
|
+
*args,
|
43
|
+
**kwargs,
|
44
|
+
) -> str:
|
45
|
+
redirect_uri = urljoin(
|
46
|
+
config().public_base_url + "/",
|
47
|
+
f"{config().callback_url_rewrite_prefix}/auth/sendgrid/token/callback",
|
48
|
+
)
|
49
|
+
url = self._make_auth_url(
|
50
|
+
auth_req=auth_req, redirect_uri=redirect_uri, state=future_uid
|
51
|
+
)
|
52
|
+
FutureStore.create_future(
|
53
|
+
future_uid,
|
54
|
+
data={
|
55
|
+
"redirect_uri": redirect_uri,
|
56
|
+
"thread_id": thread_id,
|
57
|
+
"profile": profile,
|
58
|
+
},
|
59
|
+
)
|
60
|
+
|
61
|
+
return f"User needs to authenticate using the following URL: {url}"
|
62
|
+
|
63
|
+
async def authenticate(
|
64
|
+
self, auth_req: SendgridTokenRequest, future_uid: str, *args, **kwargs
|
65
|
+
) -> AuthContext:
|
66
|
+
future_data = FutureStore.get_future(future_uid)
|
67
|
+
access_token = await future_data.future
|
68
|
+
|
69
|
+
response = SendgridTokenResponse(access_token=access_token)
|
70
|
+
context = SendgridTokenAuthContext.from_sendgrid_token_response(response)
|
71
|
+
|
72
|
+
return context
|
73
|
+
|
74
|
+
async def refresh(
|
75
|
+
self, auth_req: SendgridTokenRequest, context: AuthContext, *args, **kwargs
|
76
|
+
) -> AuthContext:
|
77
|
+
raise Exception("Sendgrid token doesn't support refresh")
|
78
|
+
|
79
|
+
def _make_auth_url(
|
80
|
+
self, auth_req: SendgridTokenRequest, redirect_uri: str, state: str
|
81
|
+
):
|
82
|
+
params = {
|
83
|
+
"redirect_uri": redirect_uri,
|
84
|
+
"state": state,
|
85
|
+
}
|
86
|
+
auth_url = f"{self._TOKEN_URL}?{urlencode(params)}"
|
87
|
+
return auth_url
|
88
|
+
|
89
|
+
def make_request(
|
90
|
+
self, auth_scopes: Optional[list[str]] = None, **kwargs
|
91
|
+
) -> SendgridTokenRequest:
|
92
|
+
return SendgridTokenRequest()
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from typing import List, Optional
|
2
|
+
from pydantic import BaseModel
|
3
|
+
from hyperpocket.auth.schema import AuthenticateRequest, AuthenticateResponse
|
4
|
+
|
5
|
+
|
6
|
+
class SendgridTokenRequest(AuthenticateRequest):
|
7
|
+
pass
|
8
|
+
|
9
|
+
|
10
|
+
class SendgridTokenResponse(AuthenticateResponse):
|
11
|
+
access_token: str
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Serpapi Authentication
|
2
|
+
|
3
|
+
This document provides instructions on how to set up token-based authentication for Serpapi using Hyperpocket.
|
4
|
+
|
5
|
+
|
6
|
+
## Supported Authentication Types
|
7
|
+
|
8
|
+
- Token
|
9
|
+
|
10
|
+
## Additional Resources
|
11
|
+
|
12
|
+
- [Official Documentation](https://serpapi.com/docs)
|
13
|
+
- [Support](https://serpapi.com/contact)
|
@@ -5,9 +5,7 @@ from hyperpocket.auth.serpapi.token_schema import SerpapiTokenResponse
|
|
5
5
|
class SerpapiTokenAuthContext(SerpapiAuthContext):
|
6
6
|
@classmethod
|
7
7
|
def from_serpapi_token_response(cls, response: SerpapiTokenResponse):
|
8
|
-
description = f
|
8
|
+
description = f"Serpapi Token Context logged in"
|
9
9
|
return cls(
|
10
|
-
access_token=response.access_token,
|
11
|
-
description=description,
|
12
|
-
expires_at=None
|
10
|
+
access_token=response.access_token, description=description, expires_at=None
|
13
11
|
)
|
@@ -5,17 +5,25 @@ from hyperpocket.auth import AuthProvider
|
|
5
5
|
from hyperpocket.auth.context import AuthContext
|
6
6
|
from hyperpocket.auth.handler import AuthHandlerInterface, AuthenticateRequest
|
7
7
|
from hyperpocket.auth.serpapi.token_context import SerpapiTokenAuthContext
|
8
|
-
from hyperpocket.auth.serpapi.token_schema import
|
8
|
+
from hyperpocket.auth.serpapi.token_schema import (
|
9
|
+
SerpapiTokenResponse,
|
10
|
+
SerpapiTokenRequest,
|
11
|
+
)
|
9
12
|
from hyperpocket.config import config
|
10
13
|
from hyperpocket.futures import FutureStore
|
11
14
|
|
12
15
|
|
13
16
|
class SerpapiTokenAuthHandler(AuthHandlerInterface):
|
14
17
|
name: str = "serpapi-token"
|
15
|
-
description: str =
|
18
|
+
description: str = (
|
19
|
+
"This handler is used to authenticate users using the Serpapi token."
|
20
|
+
)
|
16
21
|
scoped: bool = False
|
17
22
|
|
18
|
-
_TOKEN_URL: str = urljoin(
|
23
|
+
_TOKEN_URL: str = urljoin(
|
24
|
+
config().public_base_url + "/",
|
25
|
+
f"{config().callback_url_rewrite_prefix}/auth/token",
|
26
|
+
)
|
19
27
|
|
20
28
|
@staticmethod
|
21
29
|
def provider_default() -> bool:
|
@@ -29,22 +37,36 @@ class SerpapiTokenAuthHandler(AuthHandlerInterface):
|
|
29
37
|
def recommended_scopes() -> set[str]:
|
30
38
|
return set()
|
31
39
|
|
32
|
-
def prepare(
|
33
|
-
|
40
|
+
def prepare(
|
41
|
+
self,
|
42
|
+
auth_req: SerpapiTokenRequest,
|
43
|
+
thread_id: str,
|
44
|
+
profile: str,
|
45
|
+
future_uid: str,
|
46
|
+
*args,
|
47
|
+
**kwargs,
|
48
|
+
) -> str:
|
34
49
|
redirect_uri = urljoin(
|
35
50
|
config().public_base_url + "/",
|
36
51
|
f"{config().callback_url_rewrite_prefix}/auth/serpapi/token/callback",
|
37
52
|
)
|
38
|
-
url = self._make_auth_url(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
53
|
+
url = self._make_auth_url(
|
54
|
+
auth_req=auth_req, redirect_uri=redirect_uri, state=future_uid
|
55
|
+
)
|
56
|
+
FutureStore.create_future(
|
57
|
+
future_uid,
|
58
|
+
data={
|
59
|
+
"redirect_uri": redirect_uri,
|
60
|
+
"thread_id": thread_id,
|
61
|
+
"profile": profile,
|
62
|
+
},
|
63
|
+
)
|
44
64
|
|
45
|
-
return f
|
65
|
+
return f"User needs to authenticate using the following URL: {url}"
|
46
66
|
|
47
|
-
async def authenticate(
|
67
|
+
async def authenticate(
|
68
|
+
self, auth_req: SerpapiTokenRequest, future_uid: str, *args, **kwargs
|
69
|
+
) -> AuthContext:
|
48
70
|
future_data = FutureStore.get_future(future_uid)
|
49
71
|
access_token = await future_data.future
|
50
72
|
|
@@ -53,10 +75,14 @@ class SerpapiTokenAuthHandler(AuthHandlerInterface):
|
|
53
75
|
|
54
76
|
return context
|
55
77
|
|
56
|
-
async def refresh(
|
78
|
+
async def refresh(
|
79
|
+
self, auth_req: SerpapiTokenRequest, context: AuthContext, *args, **kwargs
|
80
|
+
) -> AuthContext:
|
57
81
|
raise Exception("Serpapi token doesn't support refresh")
|
58
82
|
|
59
|
-
def _make_auth_url(
|
83
|
+
def _make_auth_url(
|
84
|
+
self, auth_req: SerpapiTokenRequest, redirect_uri: str, state: str
|
85
|
+
):
|
60
86
|
params = {
|
61
87
|
"redirect_uri": redirect_uri,
|
62
88
|
"state": state,
|
@@ -64,5 +90,7 @@ class SerpapiTokenAuthHandler(AuthHandlerInterface):
|
|
64
90
|
auth_url = f"{self._TOKEN_URL}?{urlencode(params)}"
|
65
91
|
return auth_url
|
66
92
|
|
67
|
-
def make_request(
|
93
|
+
def make_request(
|
94
|
+
self, auth_scopes: Optional[list[str]] = None, **kwargs
|
95
|
+
) -> SerpapiTokenRequest:
|
68
96
|
return SerpapiTokenRequest()
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Slack Authentication
|
2
|
+
|
3
|
+
This document provides instructions on how to set up OAuth2 authentication for Slack using Hyperpocket.
|
4
|
+
|
5
|
+
## Supported Authentication Types
|
6
|
+
|
7
|
+
- Token
|
8
|
+
- OAuth2
|
9
|
+
|
10
|
+
## How to Create an OAuth2 App
|
11
|
+
|
12
|
+
- See here: ]link](https://api.slack.com/authentication/oauth-v2)
|
13
|
+
|
14
|
+
## Additional Resources
|
15
|
+
|
16
|
+
- [Official Documentation](https://api.slack.com)
|
17
|
+
- [Support](https://slack.com/help)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Spotify Authentication
|
2
|
+
|
3
|
+
This document provides instructions on how to set up OAuth2 authentication for Spotify using Hyperpocket.
|
4
|
+
|
5
|
+
## Supported Authentication Types
|
6
|
+
|
7
|
+
- OAuth2
|
8
|
+
|
9
|
+
## How to Create an OAuth2 App
|
10
|
+
|
11
|
+
- See here: [link](https://developer.spotify.com/documentation/web-api/concepts/authorization)
|
12
|
+
|
13
|
+
## Additional Resources
|
14
|
+
|
15
|
+
- [Official Documentation](https://developer.spotify.com/documentation/web-api/)
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from hyperpocket.auth.context import AuthContext
|
2
|
+
|
3
|
+
|
4
|
+
class SpotifyAuthContext(AuthContext):
|
5
|
+
_ACCESS_TOKEN_KEY: str = "SPOTIFY_TOKEN"
|
6
|
+
|
7
|
+
def to_dict(self) -> dict[str, str]:
|
8
|
+
return {
|
9
|
+
self._ACCESS_TOKEN_KEY: self.access_token,
|
10
|
+
}
|
11
|
+
|
12
|
+
def to_profiled_dict(self, profile: str) -> dict[str, str]:
|
13
|
+
return {
|
14
|
+
f"{profile.upper()}_{self._ACCESS_TOKEN_KEY}": self.access_token,
|
15
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from datetime import datetime, timedelta, timezone
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from pydantic import Field
|
5
|
+
|
6
|
+
from hyperpocket.auth.spotify.context import SpotifyAuthContext
|
7
|
+
from hyperpocket.auth.spotify.oauth2_schema import SpotifyOAuth2Response
|
8
|
+
|
9
|
+
|
10
|
+
class SpotifyOAuth2AuthContext(SpotifyAuthContext):
|
11
|
+
refresh_token: Optional[str] = Field(default=None, description="refresh token")
|
12
|
+
|
13
|
+
@classmethod
|
14
|
+
def from_spotify_oauth2_response(cls, response: SpotifyOAuth2Response):
|
15
|
+
description = f"Spotify OAuth2 Context logged in"
|
16
|
+
now = datetime.now(tz=timezone.utc)
|
17
|
+
|
18
|
+
access_token = response.access_token
|
19
|
+
refresh_token = response.refresh_token
|
20
|
+
expires_in = response.expires_in
|
21
|
+
|
22
|
+
if expires_in:
|
23
|
+
expires_at = now + timedelta(seconds=response.expires_in)
|
24
|
+
else:
|
25
|
+
expires_at = None
|
26
|
+
|
27
|
+
return cls(
|
28
|
+
access_token=access_token,
|
29
|
+
refresh_token=refresh_token,
|
30
|
+
expires_at=expires_at,
|
31
|
+
description=description,
|
32
|
+
detail=response,
|
33
|
+
)
|