auth_hash.rb 383 字节
Newer Older
P
Patricio Cano 已提交
1 2 3 4
module Gitlab
  module Saml
    class AuthHash < Gitlab::OAuth::AuthHash
      def groups
5
        Array.wrap(get_raw(Gitlab::Saml::Config.groups))
P
Patricio Cano 已提交
6 7 8 9 10
      end

      private

      def get_raw(key)
P
Patricio Cano 已提交
11
        # Needs to call `all` because of https://git.io/vVo4u
12 13
        # otherwise just the first value is returned
        auth_hash.extra[:raw_info].all[key]
P
Patricio Cano 已提交
14 15 16 17
      end
    end
  end
end