Sha256: bb7b630a330650e0ab69e7d8ccccec94a92e92e41c064bd0f63273b1bc3aa4be

Contents?: true

Size: 549 Bytes

Versions: 24

Compression:

Stored size: 549 Bytes

Contents

class ExvoAuth::Autonomous::Provider < ExvoAuth::Autonomous::Base
  def initialize(params = {})
    super
    validate_params!(:app_id, :access_token)
  end
  
  def scopes
    @@cache.fetch(params) do
      scopes!
    end
  end
  
  def scopes!
    response = auth.get("/apps/provider/authorizations/#{URI.escape(params[:app_id])}.json",
      :query => { :access_token => params[:access_token] }
    )

    if scope = response["scope"] 
      @@cache.write(params, scope.split)
    else
      [] # only cache positive responses
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
exvo_auth-0.16.5 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.16.4 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.16.3 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.16.2 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.16.1 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.16.0 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.15.1 lib/exvo_auth/autonomous/provider.rb
exvo_auth-0.15.0 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.14.1 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.14.0 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.13.0 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.12.2 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.12.1 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.12.0 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.11.2 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.11.1 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.11.0 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.10.4 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.10.3 lib/exvo_auth/autonomous/provider.rb
exvo-auth-0.10.2 lib/exvo_auth/autonomous/provider.rb