Sha256: 941c2da49fad3d6ed42117a211976645ccc012510e3d176750f46af674f726bb

Contents?: true

Size: 456 Bytes

Versions: 8

Compression:

Stored size: 456 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 == scopes
        end

        def self.valid?(scope, server_scopes)
          scope.present? &&
          scope !~ /[\n|\r|\t]/ &&
          server_scopes.has_scopes?(OAuth::Scopes.from_string(scope))
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
doorkeeper-1.4.2 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-2.0.1 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-1.4.1 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-2.0.0 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-2.0.0.rc3 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-2.0.0.rc2 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-2.0.0.alpha1 lib/doorkeeper/oauth/helpers/scope_checker.rb
doorkeeper-1.4.0 lib/doorkeeper/oauth/helpers/scope_checker.rb