Sha256: e3d2849cad5dfc7bcbd05784f6862e1ff268d7580f9c22fe26994ea98bf2ae4d

Contents?: true

Size: 464 Bytes

Versions: 5

Compression:

Stored size: 464 Bytes

Contents

module Doorkeeper
  module OAuth
    module Helpers
      module ScopeChecker
        def self.matches?(current_scopes, scopes)
          return false if current_scopes.nil? || scopes.nil?
          current_scopes.map(&:to_s).sort == scopes.split(" ").sort
        end

        def self.valid?(scope, server_scopes)
          scope.present? &&
          scope !~ /[\n|\r|\t]/ &&
          server_scopes.all_included?(scope)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
doorkeeper-0.3.4 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-0.3.3 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-0.3.2 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-0.3.1 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-0.3.0 lib/doorkeeper/oauth/helpers/scope_checker.rb