Class: Webhookdb::Oauth::Provider
- Inherits:
-
Object
- Object
- Webhookdb::Oauth::Provider
- Defined in:
- lib/webhookdb/oauth.rb
Overview
rubocop:disable Lint/UnusedMethodArgument
Direct Known Subclasses
Instance Method Summary collapse
-
#app_name ⇒ String
Name of the app to present to users.
-
#authorization_url(state:) ⇒ String
The Oauth URL to send users to to begin OAuth.
-
#build_marketplace_integrations(organization:, tokens:, scope:) ⇒ Object
Create the actual service integrations for the given org.
-
#exchange_authorization_code(code:) ⇒ Webhookdb::Oauth::Tokens
Exchange the access code (from the authorization url) for access and/or refresh tokens.
- #find_or_create_customer(tokens:, scope:) ⇒ Array{TrueClass, FalseClass, Webhookdb::Customer}
-
#key ⇒ String
Unique key to identify the provider.
-
#requires_webhookdb_auth? ⇒ Boolean
True if auth with this provider requires the user auth in WebhookDB, false if we can get their email from the Oauth process.
-
#supports_webhooks? ⇒ Boolean
This is similar to ‘supports_webhooks` in the Replicator descriptors, except that this is used to make the success page dynamic.
Instance Method Details
#app_name ⇒ String
Returns Name of the app to present to users.
20 |
# File 'lib/webhookdb/oauth.rb', line 20 def app_name = raise NotImplementedError |
#authorization_url(state:) ⇒ String
Returns The Oauth URL to send users to to begin OAuth.
36 |
# File 'lib/webhookdb/oauth.rb', line 36 def (state:) = raise NotImplementedError |
#build_marketplace_integrations(organization:, tokens:, scope:) ⇒ Object
Create the actual service integrations for the given org. # @param scope [Hash]
54 |
# File 'lib/webhookdb/oauth.rb', line 54 def build_marketplace_integrations(organization:, tokens:, scope:) = raise NotImplementedError |
#exchange_authorization_code(code:) ⇒ Webhookdb::Oauth::Tokens
Exchange the access code (from the authorization url) for access and/or refresh tokens.
40 |
# File 'lib/webhookdb/oauth.rb', line 40 def (code:) = raise NotImplementedError |
#find_or_create_customer(tokens:, scope:) ⇒ Array{TrueClass, FalseClass, Webhookdb::Customer}
45 46 47 48 |
# File 'lib/webhookdb/oauth.rb', line 45 def find_or_create_customer(tokens:, scope:) raise RuntimeError("should not be called") if self.requires_webhookdb_auth? raise NotImplementedError end |
#key ⇒ String
Returns Unique key to identify the provider.
17 |
# File 'lib/webhookdb/oauth.rb', line 17 def key = raise NotImplementedError |
#requires_webhookdb_auth? ⇒ Boolean
True if auth with this provider requires the user auth in WebhookDB, false if we can get their email from the Oauth process. If the access token can be used to get the ‘me’ user, we can usually use their email for the customer, but this may not be possible for some integrations.
27 |
# File 'lib/webhookdb/oauth.rb', line 27 def requires_webhookdb_auth? = raise NotImplementedError |
#supports_webhooks? ⇒ Boolean
This is similar to ‘supports_webhooks` in the Replicator descriptors, except that this is used to make the success page dynamic. True if this provider’s integrations support webhooks (real-time or user-built webhook payloads).
33 |
# File 'lib/webhookdb/oauth.rb', line 33 def supports_webhooks? = raise NotImplementedError |