Module: OAuth2::Provider::Models::Client
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/oauth2/provider/models/client.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #allow_grant_type?(grant_type) ⇒ Boolean
- #allow_redirection?(uri) ⇒ Boolean
- #initialize(*args, &block) ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#allow_grant_type?(grant_type) ⇒ Boolean
21 22 23 |
# File 'lib/oauth2/provider/models/client.rb', line 21 def allow_grant_type?(grant_type) true end |
#allow_redirection?(uri) ⇒ Boolean
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/oauth2/provider/models/client.rb', line 25 def allow_redirection?(uri) uri_host = Addressable::URI.parse(uri).host if oauth_redirect_uri Addressable::URI.parse(oauth_redirect_uri).host == uri_host else !uri_host.nil? && true end rescue Addressable::URI::InvalidURIError false end |
#initialize(*args, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/oauth2/provider/models/client.rb', line 11 def initialize(*args, &block) super self.oauth_identifier ||= OAuth2::Provider::Random.base62(16) self.oauth_secret ||= OAuth2::Provider::Random.base62(32) end |
#to_param ⇒ Object
17 18 19 |
# File 'lib/oauth2/provider/models/client.rb', line 17 def to_param new_record? ? nil : oauth_identifier end |