Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /vendor
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'vendor')
-rw-r--r--vendor/gems/bundler-checksum/.gitlab-ci.yml28
-rw-r--r--vendor/gems/bundler-checksum/Gemfile5
-rw-r--r--vendor/gems/bundler-checksum/Gemfile.lock18
-rw-r--r--vendor/gems/bundler-checksum/LICENSE19
-rw-r--r--vendor/gems/bundler-checksum/README.md32
-rwxr-xr-xvendor/gems/bundler-checksum/bin/bundler-checksum6
-rw-r--r--vendor/gems/bundler-checksum/bundler-checksum.gemspec22
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler-checksum.rb1
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler/checksum.rb109
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler/checksum/command.rb27
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler/checksum/command/helper.rb28
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler/checksum/command/init.rb66
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler/checksum/command/verify.rb52
-rw-r--r--vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb8
-rw-r--r--vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile11
-rw-r--r--vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.checksum54
-rw-r--r--vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock139
-rwxr-xr-xvendor/gems/bundler-checksum/test/project_with_checksum_lock/scripts/test15
-rw-r--r--vendor/gems/ipynbdiff/Gemfile.lock2
-rw-r--r--vendor/gems/ipynbdiff/ipynbdiff.gemspec2
-rw-r--r--vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml32
-rw-r--r--vendor/gems/microsoft_graph_mailer/Gemfile5
-rw-r--r--vendor/gems/microsoft_graph_mailer/Gemfile.lock217
-rw-r--r--vendor/gems/microsoft_graph_mailer/LICENSE.txt21
-rw-r--r--vendor/gems/microsoft_graph_mailer/README.md104
-rw-r--r--vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer.rb16
-rw-r--r--vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/client.rb51
-rw-r--r--vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/delivery.rb49
-rw-r--r--vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/railtie.rb11
-rw-r--r--vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/version.rb5
-rw-r--r--vendor/gems/microsoft_graph_mailer/microsoft_graph_mailer.gemspec29
-rw-r--r--vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab.txt1
-rw-r--r--vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab_logo.pngbin0 -> 1528 bytes
-rw-r--r--vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/delivery_spec.rb128
-rw-r--r--vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/railtie_spec.rb140
-rw-r--r--vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer_spec.rb29
-rw-r--r--vendor/gems/microsoft_graph_mailer/spec/spec_helper.rb60
-rw-r--r--vendor/gems/omniauth-azure-oauth2/Gemfile.lock13
-rw-r--r--vendor/gems/omniauth-azure-oauth2/lib/omniauth/strategies/azure_oauth2.rb4
-rw-r--r--vendor/gems/omniauth-azure-oauth2/omniauth-azure-oauth2.gemspec2
-rw-r--r--vendor/gems/omniauth-cas3/Gemfile.lock21
-rw-r--r--vendor/gems/omniauth-cas3/lib/omniauth/strategies/cas3.rb11
-rw-r--r--vendor/gems/omniauth-cas3/omniauth-cas3.gemspec2
-rw-r--r--vendor/gems/omniauth-cas3/spec/omniauth/strategies/cas3_spec.rb20
-rw-r--r--vendor/gems/omniauth-gitlab/Gemfile.lock11
-rw-r--r--vendor/gems/omniauth-gitlab/lib/omniauth/strategies/gitlab.rb8
-rw-r--r--vendor/gems/omniauth-gitlab/omniauth-gitlab.gemspec2
-rw-r--r--vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb22
-rw-r--r--vendor/gems/omniauth-google-oauth2/.gitlab-ci.yml28
-rw-r--r--vendor/gems/omniauth-google-oauth2/CHANGELOG.md354
-rw-r--r--vendor/gems/omniauth-google-oauth2/Gemfile5
-rw-r--r--vendor/gems/omniauth-google-oauth2/Gemfile.lock87
-rw-r--r--vendor/gems/omniauth-google-oauth2/README.md368
-rw-r--r--vendor/gems/omniauth-google-oauth2/Rakefile8
-rw-r--r--vendor/gems/omniauth-google-oauth2/examples/Gemfile8
-rw-r--r--vendor/gems/omniauth-google-oauth2/examples/config.ru120
-rw-r--r--vendor/gems/omniauth-google-oauth2/examples/omni_auth.rb37
-rw-r--r--vendor/gems/omniauth-google-oauth2/lib/omniauth-google-oauth2.rb3
-rw-r--r--vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2.rb3
-rw-r--r--vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2/version.rb7
-rw-r--r--vendor/gems/omniauth-google-oauth2/lib/omniauth/strategies/google_oauth2.rb254
-rw-r--r--vendor/gems/omniauth-google-oauth2/omniauth-google-oauth2.gemspec31
-rw-r--r--vendor/gems/omniauth-google-oauth2/spec/omniauth/strategies/google_oauth2_spec.rb850
-rw-r--r--vendor/gems/omniauth-google-oauth2/spec/spec_helper.rb4
-rw-r--r--vendor/gems/omniauth-salesforce/.gitlab-ci.yml28
-rwxr-xr-xvendor/gems/omniauth-salesforce/Gemfile12
-rw-r--r--vendor/gems/omniauth-salesforce/Gemfile.lock124
-rwxr-xr-xvendor/gems/omniauth-salesforce/Guardfile10
-rw-r--r--vendor/gems/omniauth-salesforce/LICENSE.md5
-rwxr-xr-xvendor/gems/omniauth-salesforce/README.md60
-rwxr-xr-xvendor/gems/omniauth-salesforce/Rakefile12
-rwxr-xr-xvendor/gems/omniauth-salesforce/lib/omniauth-salesforce.rb2
-rwxr-xr-xvendor/gems/omniauth-salesforce/lib/omniauth-salesforce/version.rb5
-rwxr-xr-xvendor/gems/omniauth-salesforce/lib/omniauth/strategies/salesforce.rb97
-rwxr-xr-xvendor/gems/omniauth-salesforce/omniauth-salesforce.gemspec24
-rwxr-xr-xvendor/gems/omniauth-salesforce/spec/omniauth/strategies/salesforce_spec.rb219
-rwxr-xr-xvendor/gems/omniauth-salesforce/spec/spec_helper.rb16
-rw-r--r--vendor/gems/omniauth_crowd/Gemfile.lock9
-rwxr-xr-xvendor/gems/omniauth_crowd/lib/omniauth/strategies/crowd.rb10
-rw-r--r--vendor/gems/omniauth_crowd/omniauth_crowd.gemspec2
-rwxr-xr-xvendor/gems/omniauth_crowd/spec/omniauth/strategies/crowd_spec.rb88
-rw-r--r--vendor/project_templates/cluster_management.tar.gzbin14184 -> 14040 bytes
82 files changed, 4438 insertions, 110 deletions
diff --git a/vendor/gems/bundler-checksum/.gitlab-ci.yml b/vendor/gems/bundler-checksum/.gitlab-ci.yml
new file mode 100644
index 00000000000..f6bdb73a039
--- /dev/null
+++ b/vendor/gems/bundler-checksum/.gitlab-ci.yml
@@ -0,0 +1,28 @@
+workflow:
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+
+.test:
+ cache:
+ key: bundler-checksum
+ paths:
+ - vendor/gems/bundler-checksum/vendor/ruby
+ before_script:
+ - cd vendor/gems/bundler-checksum
+ - ruby -v # Print out ruby version for debugging
+ - gem install bundler --no-document # Bundler is not installed with the image
+ - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby
+ - bundle config set with 'development'
+ - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI
+ - bundle config # Show bundler configuration
+ - bundle install -j $(nproc)
+ script:
+ - pushd test/project_with_checksum_lock && scripts/test
+
+test-2.7:
+ image: "ruby:2.7"
+ extends: .test
+
+test-3.0:
+ image: "ruby:3.0"
+ extends: .test
diff --git a/vendor/gems/bundler-checksum/Gemfile b/vendor/gems/bundler-checksum/Gemfile
new file mode 100644
index 00000000000..9a78debe9a3
--- /dev/null
+++ b/vendor/gems/bundler-checksum/Gemfile
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+source 'https://rubygems.org/'
+
+gemspec
diff --git a/vendor/gems/bundler-checksum/Gemfile.lock b/vendor/gems/bundler-checksum/Gemfile.lock
new file mode 100644
index 00000000000..8ae053f0105
--- /dev/null
+++ b/vendor/gems/bundler-checksum/Gemfile.lock
@@ -0,0 +1,18 @@
+PATH
+ remote: .
+ specs:
+ bundler-checksum (0.1.0)
+ bundler
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler-checksum!
+
+BUNDLED WITH
+ 2.3.17
diff --git a/vendor/gems/bundler-checksum/LICENSE b/vendor/gems/bundler-checksum/LICENSE
new file mode 100644
index 00000000000..7f53e1576a1
--- /dev/null
+++ b/vendor/gems/bundler-checksum/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2022-present GitLab B.V.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/gems/bundler-checksum/README.md b/vendor/gems/bundler-checksum/README.md
new file mode 100644
index 00000000000..1420dc49b94
--- /dev/null
+++ b/vendor/gems/bundler-checksum/README.md
@@ -0,0 +1,32 @@
+# bundler-checksum
+
+Bundler patch for verifying local gem checksums
+
+## Install
+
+Add the following to your Gemfile:
+
+```
+if ENV['BUNDLER_CHECKSUM_VERIFICATION_OPT_IN'] # this verification is still experimental
+ require 'bundler-checksum'
+ Bundler::Checksum.patch!
+end
+```
+
+## Usage
+
+Once the gem is installed, bundler-checksum will verify gems before
+installation.
+
+If a new or updated gem is to be installed, the remote checksum of that gem is stored in `Gemfile.checksum`.
+Checksum entries for other versions of the gem are removed from `Gemfile.checksum`.
+
+If a version of a gem is to be installed that is already present in `Gemfile.checksum`, the remote and local
+checksums are compared and an error is prompted if they do not match.
+
+Gem checksums for all platforms are stored in `Gemfile.checksum`.
+When `bundler-checksum` runs it will only verify the checksum for the platform that `bundle` wants to download.
+
+
+## Development
+
diff --git a/vendor/gems/bundler-checksum/bin/bundler-checksum b/vendor/gems/bundler-checksum/bin/bundler-checksum
new file mode 100755
index 00000000000..2d0aea827bc
--- /dev/null
+++ b/vendor/gems/bundler-checksum/bin/bundler-checksum
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+
+require 'bundler-checksum'
+require 'bundler/checksum/command'
+
+Bundler::Checksum::Command.execute(ARGV)
diff --git a/vendor/gems/bundler-checksum/bundler-checksum.gemspec b/vendor/gems/bundler-checksum/bundler-checksum.gemspec
new file mode 100644
index 00000000000..c04312480b6
--- /dev/null
+++ b/vendor/gems/bundler-checksum/bundler-checksum.gemspec
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require_relative 'lib/bundler/checksum/version'
+
+Gem::Specification.new do |spec|
+ spec.name = 'bundler-checksum'
+ spec.version = Bundler::Checksum::VERSION
+ spec.authors = ['dustinmm80']
+ spec.email = ['dcollins@gitlab.com']
+
+ spec.summary = 'Track checksums locally with Bundler'
+ spec.description = 'Track checksums locally with Bundler'
+ spec.homepage = 'https://gitlab.com/gitlab-org/gitlab/-/tree/master/vendor/gems/bundler-checksum'
+ spec.license = 'MIT'
+
+ spec.files = Dir['bin/*', 'lib/**/*.rb']
+ spec.bindir = 'bin'
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
+ spec.require_paths = ['lib']
+
+ spec.add_dependency 'bundler'
+end
diff --git a/vendor/gems/bundler-checksum/lib/bundler-checksum.rb b/vendor/gems/bundler-checksum/lib/bundler-checksum.rb
new file mode 100644
index 00000000000..600cd4f7107
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler-checksum.rb
@@ -0,0 +1 @@
+require 'bundler/checksum'
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum.rb
new file mode 100644
index 00000000000..c8d78eba111
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler/checksum.rb
@@ -0,0 +1,109 @@
+# frozen_string_literal: true
+
+require 'bundler'
+require 'bundler/checksum/version'
+require 'json'
+
+module Bundler
+ module Patches
+ # This module monkey-patches Bundler to check Gemfile.checksum
+ # when installing gems that are from RubyGems
+ module RubyGemsInstallerPatch
+ def pre_install_checks
+ super && validate_local_package_checksum
+ end
+
+ private
+
+ def validate_local_package_checksum
+ cached_checksum = fetch_checksum_from_file(spec)
+
+ if cached_checksum.nil?
+ raise SecurityError, "Cached checksum for #{spec.full_name} not found. Please (re-)generate Gemfile.checksum"
+ end
+
+ validate_file_checksum(cached_checksum)
+ end
+
+ def fetch_checksum_from_file(spec)
+ ::Bundler::Checksum.checksum_for(spec.name, spec.version.to_s, spec.platform.to_s)
+ end
+
+ # Modified from
+ # https://github.com/rubygems/rubygems/blob/243173279e79a38f03e318eea8825d1c8824e119/bundler/lib/bundler/rubygems_gem_installer.rb#L116
+ def validate_file_checksum(checksum)
+ return true if Bundler.settings[:disable_checksum_validation]
+
+ source = @package.instance_variable_get(:@gem)
+
+ # Contary to upstream, we raise instead of silently returning
+ raise "#{@package.inspect} does not have :@gem" unless source
+ raise "#{source.inspect} does not respond to :with_read_io" unless source.respond_to?(:with_read_io)
+
+ digest = source.with_read_io do |io|
+ digest = SharedHelpers.digest(:SHA256).new
+ digest << io.read(16_384) until io.eof?
+ io.rewind
+ send(checksum_type(checksum), digest)
+ end
+ unless digest == checksum
+ raise SecurityError, <<-MESSAGE
+ Bundler cannot continue installing #{spec.name} (#{spec.version}).
+ The checksum for the downloaded `#{spec.full_name}.gem` does not match \
+ the checksum from the checksum file. This means the contents of the downloaded \
+ gem is different from what was recorded in the checksum file, and could be potential security issue.
+ gem is different from what was uploaded to the server, and could be a potential security issue.
+
+ To resolve this issue:
+ 1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
+ 2. run `bundle install`
+
+ If you wish to continue installing the downloaded gem, and are certain it does not pose a \
+ security issue despite the mismatching checksum, do the following:
+ 1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
+ 2. run `bundle install`
+
+ (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
+ checksum for the downloaded gem was #{digest.inspect}.)
+ MESSAGE
+ end
+ true
+ end
+ end
+ end
+end
+
+module Bundler
+ module Checksum
+ class << self
+ def checksum_file
+ @checksum_file ||= File.join(File.dirname(Bundler.default_gemfile), 'Gemfile.checksum')
+ end
+
+ def checksums_from_file
+ @checksums_from_file ||= JSON.parse(File.open(checksum_file).read, symbolize_names: true)
+ rescue JSON::ParserError => e
+ raise "Invalid checksum file: #{e.message}"
+ end
+
+ def checksum_for(gem_name, gem_version, gem_platform)
+ item = checksums_from_file.detect do |item|
+ item[:name] == gem_name &&
+ item[:platform] == gem_platform &&
+ item[:version] == gem_version
+ end
+
+ item&.fetch(:checksum)
+ end
+
+ def patch!
+ return if defined?(@patched) && @patched
+ @patched = true
+
+ Bundler.ui.info "Patching bundler with bundler-checksum..."
+ require 'bundler/rubygems_gem_installer'
+ ::Bundler::RubyGemsGemInstaller.prepend(Bundler::Patches::RubyGemsInstallerPatch)
+ end
+ end
+ end
+end
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum/command.rb
new file mode 100644
index 00000000000..438f41f6e69
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler/checksum/command.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module Bundler::Checksum
+ module Command
+ autoload :Init, File.expand_path("command/init", __dir__)
+ autoload :Verify, File.expand_path("command/verify", __dir__)
+ autoload :Helper, File.expand_path("command/helper", __dir__)
+
+ def self.execute(args)
+ if args.empty?
+ $stderr.puts 'A command must be given [init,update,verify]'
+ end
+
+ if args.first == 'init'
+ Init.execute
+ elsif args.first == 'update'
+ $stderr.puts 'Not implemented, please use init'
+ elsif args.first == 'verify'
+ verified = Verify.execute
+
+ unless verified
+ exit 1
+ end
+ end
+ end
+ end
+end
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/helper.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum/command/helper.rb
new file mode 100644
index 00000000000..fa06bfe3da4
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler/checksum/command/helper.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+require 'json'
+require 'net/http'
+
+module Bundler::Checksum::Command
+ module Helper
+ extend self
+
+ def remote_checksums_for_gem(gem_name, gem_version)
+ response = Net::HTTP.get_response(URI(
+ "https://rubygems.org/api/v1/versions/#{gem_name}.json"
+ ))
+
+ return [] unless response.code == '200'
+
+ gem_candidates = JSON.parse(response.body, symbolize_names: true)
+ gem_candidates.select! { |g| g[:number] == gem_version.to_s }
+
+ gem_candidates.map {
+ |g| {:name => gem_name, :version => gem_version, :platform => g[:platform], :checksum => g[:sha]}
+ }
+
+ rescue JSON::ParserError
+ []
+ end
+ end
+end
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/init.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum/command/init.rb
new file mode 100644
index 00000000000..fed0e11080f
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler/checksum/command/init.rb
@@ -0,0 +1,66 @@
+# frozen_string_literal: true
+
+require 'openssl'
+
+module Bundler::Checksum::Command
+ module Init
+ extend self
+
+ def execute
+ $stderr.puts "Initializing checksum file #{checksum_file}"
+
+ checksums = []
+
+ compact_index_cache = Bundler::Fetcher::CompactIndex
+ .new(nil, Bundler::Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil)
+ .send(:compact_index_client)
+ .instance_variable_get(:@cache)
+
+ seen = []
+ Bundler.definition.resolve.sort_by(&:name).each do |spec|
+ next unless spec.source.is_a?(Bundler::Source::Rubygems)
+
+ next if seen.include?(spec.name)
+ seen << spec.name
+
+ $stderr.puts "Adding #{spec.name}==#{spec.version}"
+
+ compact_index_dependencies = compact_index_cache.dependencies(spec.name).select { |item| item.first == spec.version.to_s }
+
+ if !compact_index_dependencies.empty?
+ compact_index_checksums = compact_index_dependencies.map do |version, platform, dependencies, requirements|
+ {
+ name: spec.name,
+ version: spec.version.to_s,
+ platform: Gem::Platform.new(platform).to_s,
+ checksum: requirements.detect { |requirement| requirement.first == 'checksum' }.flatten[1]
+ }
+ end
+
+ checksums += compact_index_checksums.sort_by { |hash| hash.values }
+ else
+ remote_checksum = Helper.remote_checksums_for_gem(spec.name, spec.version)
+
+ if remote_checksum.empty?
+ raise "#{spec.name} #{spec.version} not found on Rubygems!"
+ end
+
+ checksums += remote_checksum.sort_by { |hash| hash.values }
+ end
+ end
+
+ File.write(checksum_file, JSON.generate(checksums, array_nl: "\n") + "\n")
+ end
+
+ private
+
+ def checksum_file
+ ::Bundler::Checksum.checksum_file
+ end
+
+ def lockfile
+ lockfile_path = Bundler.default_lockfile
+ lockfile = Bundler::LockfileParser.new(Bundler.read_file(lockfile_path))
+ end
+ end
+end
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/command/verify.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum/command/verify.rb
new file mode 100644
index 00000000000..ba2eea6ea0c
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler/checksum/command/verify.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+module Bundler::Checksum::Command
+ module Verify
+ extend self
+
+ def execute
+ $stderr.puts 'Verifying bundle checksums'
+
+ verified = true
+
+ local_checksums.each do |gem|
+ name = gem.fetch(:name)
+ version = gem.fetch(:version)
+ platform = gem.fetch(:platform)
+ checksum = gem.fetch(:checksum)
+
+ $stderr.puts "Verifying #{name}==#{version} #{platform}"
+ unless validate_gem_checksum(name, version, platform, checksum)
+ verified = false
+ end
+ end
+
+ verified
+ end
+
+ private
+
+ def local_checksums
+ ::Bundler::Checksum.checksums_from_file
+ end
+
+ def validate_gem_checksum(gem_name, gem_version, gem_platform, local_checksum)
+ remote_checksums = Helper.remote_checksums_for_gem(gem_name, gem_version)
+ if remote_checksums.empty?
+ $stderr.puts "#{gem_name} #{gem_version} not found on Rubygems, skipping"
+ return false
+ end
+
+ remote_platform_checksum = remote_checksums.find { |g| g[:name] == gem_name && g[:platform] == gem_platform.to_s }
+
+ if local_checksum == remote_platform_checksum[:checksum]
+ true
+ else
+ $stderr.puts "Gem #{gem_name} #{gem_version} #{gem_platform} failed checksum verification"
+ $stderr.puts "LOCAL: #{local_checksum}"
+ $stderr.puts "REMOTE: #{remote_platform_checksum[:checksum]}"
+ return false
+ end
+ end
+ end
+end
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb
new file mode 100644
index 00000000000..41e958b2db9
--- /dev/null
+++ b/vendor/gems/bundler-checksum/lib/bundler/checksum/version.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+module Bundler
+ module Checksum
+ # bundler-checksum version
+ VERSION = '0.1.0'
+ end
+end
diff --git a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile
new file mode 100644
index 00000000000..238bd09669f
--- /dev/null
+++ b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+source 'https://rubygems.org'
+
+if ENV['BUNDLER_CHECKSUM_VERIFICATION_OPT_IN'] # this verification is still experimental
+ $:.unshift(File.expand_path('../../lib', __dir__))
+ require 'bundler-checksum'
+ Bundler::Checksum.patch!
+end
+
+gem 'rails', '~> 6.1.6.1'
diff --git a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.checksum b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.checksum
new file mode 100644
index 00000000000..cf70611c97a
--- /dev/null
+++ b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.checksum
@@ -0,0 +1,54 @@
+[
+{"name":"actioncable","version":"6.1.6.1","platform":"ruby","checksum":"11f079141cf032026881e4a79ae0cc93753351089c1b6ca1ed30a8a6a21f961b"},
+{"name":"actionmailbox","version":"6.1.6.1","platform":"ruby","checksum":"a4cc16fe634c9de4e22669fc4bf20d5b84f65039c7e3d7308c804b82726d03d2"},
+{"name":"actionmailer","version":"6.1.6.1","platform":"ruby","checksum":"13964bff4a75efd705304cb7aeb71380a4b11d404c7304b67f3bc3208cde12a7"},
+{"name":"actionpack","version":"6.1.6.1","platform":"ruby","checksum":"f3e0a82a62aa36fecadbacbb266e38338da032f18aaf97674f335671b420bdd4"},
+{"name":"actiontext","version":"6.1.6.1","platform":"ruby","checksum":"ff26b96769b6f4bdf3c0e74f613b232b2cdab7e46f1433c9cfa4fdcd081afac0"},
+{"name":"actionview","version":"6.1.6.1","platform":"ruby","checksum":"a87fc7d2c4fe9b6357492a3ee361be8169f3f319f47bf70fda1b1718b944d06b"},
+{"name":"activejob","version":"6.1.6.1","platform":"ruby","checksum":"9efee4499d31aaaab73b843a09564d4a2aabcd51c2088361a92e08766ab0db65"},
+{"name":"activemodel","version":"6.1.6.1","platform":"ruby","checksum":"239953365a7da4bcb9a3819b8ac2557a58a3ba89ddd36bee9bb3eca818e4a3e2"},
+{"name":"activerecord","version":"6.1.6.1","platform":"ruby","checksum":"82f74804ab34ea549fd593e5ced68c32426564786127d2de9b933ba78467d0b0"},
+{"name":"activestorage","version":"6.1.6.1","platform":"ruby","checksum":"3fbf4c355a69a46e14676004ad8e06245bdce7f96858e72782715218326aafc5"},
+{"name":"activesupport","version":"6.1.6.1","platform":"ruby","checksum":"5fc9fd6fe6f755e7523bb3aaf4370fb91a8416b39e3202939fd8bded4fec606d"},
+{"name":"builder","version":"3.2.4","platform":"ruby","checksum":"99caf08af60c8d7f3a6b004029c4c3c0bdaebced6c949165fe98f1db27fbbc10"},
+{"name":"concurrent-ruby","version":"1.1.10","platform":"ruby","checksum":"244cb1ca0d91ec2c15ca2209507c39fb163336994428e16fbd3f465c87bd8e68"},
+{"name":"crass","version":"1.0.6","platform":"ruby","checksum":"dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d"},
+{"name":"erubi","version":"1.11.0","platform":"ruby","checksum":"fda72d577feaf3bdcd646d33fa630be5f92f48e179a9278e4175a9cec20e7f85"},
+{"name":"globalid","version":"1.0.0","platform":"ruby","checksum":"1253641b1dc3392721c964351773755d75135d3d3c5cc65d88b0a3880a60bed8"},
+{"name":"i18n","version":"1.12.0","platform":"ruby","checksum":"91e3cc1b97616d308707eedee413d82ee021d751c918661fb82152793e64aced"},
+{"name":"loofah","version":"2.18.0","platform":"ruby","checksum":"61975a247a6aeb8f09ac5a3430305451efc4525c0b9b79c05feaec35a8b9d5a3"},
+{"name":"mail","version":"2.7.1","platform":"ruby","checksum":"ec2a3d489f7510b90d8eaa3f6abaad7038cf1d663cdf8ee66d0214a0bdf99c03"},
+{"name":"marcel","version":"1.0.2","platform":"ruby","checksum":"a013b677ef46cbcb49fd5c59b3d35803d2ee04dd75d8bfdc43533fc5a31f7e4e"},
+{"name":"method_source","version":"1.0.0","platform":"ruby","checksum":"d779455a2b5666a079ce58577bfad8534f571af7cec8107f4dce328f0981dede"},
+{"name":"mini_mime","version":"1.1.2","platform":"ruby","checksum":"a54aec0cc7438a03a850adb00daca2bdb60747f839e28186994df057cea87151"},
+{"name":"minitest","version":"5.16.2","platform":"ruby","checksum":"c1be0c6b57fab451faa08e74ffa71e7d6a259b90f4bacb881c7f4808ec8b4991"},
+{"name":"nio4r","version":"2.5.8","platform":"java","checksum":"b2b1800f6bf7ce4b797ca8b639ad278a99c9c904fb087a91d944f38e4bd71401"},
+{"name":"nio4r","version":"2.5.8","platform":"ruby","checksum":"3becb4ad95ab8ac0a9bd2e1b16466869402be62848082bf6329ae9091f276676"},
+{"name":"nokogiri","version":"1.13.8","platform":"aarch64-linux","checksum":"d6b2c45a57738f12fe27783939fe1394e7049246288c7770d3b1fee7f49432a6"},
+{"name":"nokogiri","version":"1.13.8","platform":"arm64-darwin","checksum":"00217e48a6995e81dd83014325c0ea0b015023a8922c7bdb2ef1416aa87c1f43"},
+{"name":"nokogiri","version":"1.13.8","platform":"java","checksum":"9d04c616900e2b5118e501436ebb9bc48520d08f3695d012a314006e28082f72"},
+{"name":"nokogiri","version":"1.13.8","platform":"ruby","checksum":"79c279298b2f22fd4e760f49990c7930436bac1b1cfeff7bacff192f30edea3c"},
+{"name":"nokogiri","version":"1.13.8","platform":"x64-mingw-ucrt","checksum":"98f7dac7583f07a84ec3fcc01dc03a66fce10f412cd363fce7de749acdb2a42d"},
+{"name":"nokogiri","version":"1.13.8","platform":"x64-mingw32","checksum":"117a71b37f2e1d774a9f031d393e72d5d04b92af8036e0c1a8dd509c247b2013"},
+{"name":"nokogiri","version":"1.13.8","platform":"x86-linux","checksum":"6d04342456edfb8fbc041d0c2cf5a59baaa7aacdda414b2333100b02f85d441d"},
+{"name":"nokogiri","version":"1.13.8","platform":"x86-mingw32","checksum":"0529d558b4280a55bc7af500d3d4d590b7c059c814a0cea52e4e18cb30c25d15"},
+{"name":"nokogiri","version":"1.13.8","platform":"x86_64-darwin","checksum":"8966d79e687b271df87a4b240456597c43cd98584e3f783fc35de4f066486421"},
+{"name":"nokogiri","version":"1.13.8","platform":"x86_64-linux","checksum":"344f1bc66feac787e5b2053c6e9095d1f33605083e58ddf2b8d4eef257bccc5f"},
+{"name":"racc","version":"1.6.0","platform":"java","checksum":"d449a3c279026451b9fd5f34e829dc5f6e0ef6b9b472b7ff89fd3877fe8fe8cf"},
+{"name":"racc","version":"1.6.0","platform":"ruby","checksum":"2dede3b136eeabd0f7b8c9356b958b3d743c00158e2615acab431af141354551"},
+{"name":"rack","version":"2.2.4","platform":"ruby","checksum":"ea2232b638cbd919129c8c8ad8012ecaccc09f848152a7e705d2139d0137ac2b"},
+{"name":"rack-test","version":"2.0.2","platform":"ruby","checksum":"adadd0e957f63a34199a9fdf905a920a0b0a50795735095b4ac4bd3c13385466"},
+{"name":"rails","version":"6.1.6.1","platform":"ruby","checksum":"17024921a3913fb341f584542b06adf6bb12977a8b92d5fce093c3996c963686"},
+{"name":"rails-dom-testing","version":"2.0.3","platform":"ruby","checksum":"b140c4f39f6e609c8113137b9a60dfc2ecb89864e496f87f23a68b3b8f12d8d1"},
+{"name":"rails-html-sanitizer","version":"1.4.3","platform":"ruby","checksum":"2ebba6ad9a0b100f79fda853a46851e7664febe1728223f9734281e0d55940d6"},
+{"name":"railties","version":"6.1.6.1","platform":"ruby","checksum":"bafecdf2dcbe4ea44e1ab7081fd797aa87ae9bbcd0f3a4372b662a1b93949733"},
+{"name":"rake","version":"13.0.6","platform":"ruby","checksum":"5ce4bf5037b4196c24ac62834d8db1ce175470391026bd9e557d669beeb19097"},
+{"name":"sprockets","version":"4.1.1","platform":"ruby","checksum":"68b10b0e574fc2a080e4779d025bf39bc7a20bc8659e32f827cccce9581348e2"},
+{"name":"sprockets-rails","version":"3.4.2","platform":"ruby","checksum":"36d6327757ccf7460a00d1d52b2d5ef0019a4670503046a129fa1fb1300931ad"},
+{"name":"thor","version":"1.2.1","platform":"ruby","checksum":"b1752153dc9c6b8d3fcaa665e9e1a00a3e73f28da5e238b81c404502e539d446"},
+{"name":"tzinfo","version":"2.0.5","platform":"ruby","checksum":"c5352fd901544d396745d013f46a04ae2ed081ce806d942099825b7c2b09a167"},
+{"name":"websocket-driver","version":"0.7.5","platform":"java","checksum":"fffa83aa188e9ac90e32a385832ec9d26acdf019538e1c7d703f2c8a323b39c8"},
+{"name":"websocket-driver","version":"0.7.5","platform":"ruby","checksum":"a280c3f44dcbb0323d58bc78dc49350c05d589ab7d13267fcff08d9d5ae76b28"},
+{"name":"websocket-extensions","version":"0.1.5","platform":"ruby","checksum":"1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241"},
+{"name":"zeitwerk","version":"2.6.0","platform":"ruby","checksum":"6cb2ee4645c6e597640d6f2d8cc91a59a6699ab38896a5c3fac3eefeb5c84d76"}
+]
diff --git a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock
new file mode 100644
index 00000000000..8f4bb5fa40d
--- /dev/null
+++ b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/Gemfile.lock
@@ -0,0 +1,139 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actioncable (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ nio4r (~> 2.0)
+ websocket-driver (>= 0.6.1)
+ actionmailbox (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activestorage (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ mail (>= 2.7.1)
+ actionmailer (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ actionview (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 2.0)
+ actionpack (6.1.6.1)
+ actionview (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ rack (~> 2.0, >= 2.0.9)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activestorage (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ nokogiri (>= 1.8.5)
+ actionview (6.1.6.1)
+ activesupport (= 6.1.6.1)
+ builder (~> 3.1)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (6.1.6.1)
+ activesupport (= 6.1.6.1)
+ globalid (>= 0.3.6)
+ activemodel (6.1.6.1)
+ activesupport (= 6.1.6.1)
+ activerecord (6.1.6.1)
+ activemodel (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ activestorage (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ marcel (~> 1.0)
+ mini_mime (>= 1.1.0)
+ activesupport (6.1.6.1)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ zeitwerk (~> 2.3)
+ builder (3.2.4)
+ concurrent-ruby (1.1.10)
+ crass (1.0.6)
+ erubi (1.11.0)
+ globalid (1.0.0)
+ activesupport (>= 5.0)
+ i18n (1.12.0)
+ concurrent-ruby (~> 1.0)
+ loofah (2.18.0)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ marcel (1.0.2)
+ method_source (1.0.0)
+ mini_mime (1.1.2)
+ minitest (5.16.2)
+ nio4r (2.5.8)
+ nokogiri (1.13.8-arm64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.13.8-x86_64-linux)
+ racc (~> 1.4)
+ racc (1.6.0)
+ rack (2.2.4)
+ rack-test (2.0.2)
+ rack (>= 1.3)
+ rails (6.1.6.1)
+ actioncable (= 6.1.6.1)
+ actionmailbox (= 6.1.6.1)
+ actionmailer (= 6.1.6.1)
+ actionpack (= 6.1.6.1)
+ actiontext (= 6.1.6.1)
+ actionview (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activemodel (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activestorage (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ bundler (>= 1.15.0)
+ railties (= 6.1.6.1)
+ sprockets-rails (>= 2.0.0)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
+ rails-html-sanitizer (1.4.3)
+ loofah (~> 2.3)
+ railties (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ method_source
+ rake (>= 12.2)
+ thor (~> 1.0)
+ rake (13.0.6)
+ sprockets (4.1.1)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.4.2)
+ actionpack (>= 5.2)
+ activesupport (>= 5.2)
+ sprockets (>= 3.0.0)
+ thor (1.2.1)
+ tzinfo (2.0.5)
+ concurrent-ruby (~> 1.0)
+ websocket-driver (0.7.5)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.5)
+ zeitwerk (2.6.0)
+
+PLATFORMS
+ arm64-darwin-21
+ x86_64-linux
+
+DEPENDENCIES
+ rails (~> 6.1.6.1)
+
+BUNDLED WITH
+ 2.3.19
diff --git a/vendor/gems/bundler-checksum/test/project_with_checksum_lock/scripts/test b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/scripts/test
new file mode 100755
index 00000000000..bb256449226
--- /dev/null
+++ b/vendor/gems/bundler-checksum/test/project_with_checksum_lock/scripts/test
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -x
+set -e
+
+# Check there's no differences after re-initialising
+ruby -I ../../lib ../../bin/bundler-checksum init
+git diff --exit-code Gemfile.checksum
+
+# Verify against rubygems.org
+ruby -I ../../lib ../../bin/bundler-checksum verify
+
+# Test installing with bundler-checksum
+export BUNDLER_CHECKSUM_VERIFICATION_OPT_IN=1
+bundle install
diff --git a/vendor/gems/ipynbdiff/Gemfile.lock b/vendor/gems/ipynbdiff/Gemfile.lock
index 1c2fd81e3b4..6a8d3750602 100644
--- a/vendor/gems/ipynbdiff/Gemfile.lock
+++ b/vendor/gems/ipynbdiff/Gemfile.lock
@@ -2,7 +2,7 @@ PATH
remote: .
specs:
ipynbdiff (0.4.7)
- diffy (~> 3.3)
+ diffy (~> 3.4)
oj (~> 3.13.16)
GEM
diff --git a/vendor/gems/ipynbdiff/ipynbdiff.gemspec b/vendor/gems/ipynbdiff/ipynbdiff.gemspec
index 3054118ea47..014005029ef 100644
--- a/vendor/gems/ipynbdiff/ipynbdiff.gemspec
+++ b/vendor/gems/ipynbdiff/ipynbdiff.gemspec
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
- s.add_runtime_dependency 'diffy', '~> 3.3'
+ s.add_runtime_dependency 'diffy', '~> 3.4'
s.add_runtime_dependency 'oj', '~> 3.13.16'
s.add_development_dependency 'bundler', '~> 2.2'
diff --git a/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml b/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml
new file mode 100644
index 00000000000..1b10debb1b9
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml
@@ -0,0 +1,32 @@
+workflow:
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+
+.rspec:
+ cache:
+ key: microsoft_graph_mailer-ruby
+ paths:
+ - vendor/gems/microsoft_graph_mailer/vendor/ruby
+ before_script:
+ - cd vendor/gems/microsoft_graph_mailer
+ - ruby -v # Print out ruby version for debugging
+ - gem install bundler --no-document # Bundler is not installed with the image
+ - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby
+ - bundle config set with 'development'
+ - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI
+ - bundle config # Show bundler configuration
+ - bundle install -j $(nproc)
+ script:
+ - bundle exec rspec
+
+rspec-2.7:
+ image: "ruby:2.7"
+ extends: .rspec
+
+rspec-3.0:
+ image: "ruby:3.0"
+ extends: .rspec
+
+rspec-3.1:
+ image: "ruby:3.1"
+ extends: .rspec
diff --git a/vendor/gems/microsoft_graph_mailer/Gemfile b/vendor/gems/microsoft_graph_mailer/Gemfile
new file mode 100644
index 00000000000..be173b205f7
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/Gemfile
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+source "https://rubygems.org"
+
+gemspec
diff --git a/vendor/gems/microsoft_graph_mailer/Gemfile.lock b/vendor/gems/microsoft_graph_mailer/Gemfile.lock
new file mode 100644
index 00000000000..d6bb01eba73
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/Gemfile.lock
@@ -0,0 +1,217 @@
+PATH
+ remote: .
+ specs:
+ microsoft_graph_mailer (0.1.0)
+ mail (~> 2.7)
+ oauth2 (>= 1.4.4, < 3)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actioncable (7.0.4)
+ actionpack (= 7.0.4)
+ activesupport (= 7.0.4)
+ nio4r (~> 2.0)
+ websocket-driver (>= 0.6.1)
+ actionmailbox (7.0.4)
+ actionpack (= 7.0.4)
+ activejob (= 7.0.4)
+ activerecord (= 7.0.4)
+ activestorage (= 7.0.4)
+ activesupport (= 7.0.4)
+ mail (>= 2.7.1)
+ net-imap
+ net-pop
+ net-smtp
+ actionmailer (7.0.4)
+ actionpack (= 7.0.4)
+ actionview (= 7.0.4)
+ activejob (= 7.0.4)
+ activesupport (= 7.0.4)
+ mail (~> 2.5, >= 2.5.4)
+ net-imap
+ net-pop
+ net-smtp
+ rails-dom-testing (~> 2.0)
+ actionpack (7.0.4)
+ actionview (= 7.0.4)
+ activesupport (= 7.0.4)
+ rack (~> 2.0, >= 2.2.0)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (7.0.4)
+ actionpack (= 7.0.4)
+ activerecord (= 7.0.4)
+ activestorage (= 7.0.4)
+ activesupport (= 7.0.4)
+ globalid (>= 0.6.0)
+ nokogiri (>= 1.8.5)
+ actionview (7.0.4)
+ activesupport (= 7.0.4)
+ builder (~> 3.1)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (7.0.4)
+ activesupport (= 7.0.4)
+ globalid (>= 0.3.6)
+ activemodel (7.0.4)
+ activesupport (= 7.0.4)
+ activerecord (7.0.4)
+ activemodel (= 7.0.4)
+ activesupport (= 7.0.4)
+ activestorage (7.0.4)
+ actionpack (= 7.0.4)
+ activejob (= 7.0.4)
+ activerecord (= 7.0.4)
+ activesupport (= 7.0.4)
+ marcel (~> 1.0)
+ mini_mime (>= 1.1.0)
+ activesupport (7.0.4)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ addressable (2.8.1)
+ public_suffix (>= 2.0.2, < 6.0)
+ builder (3.2.4)
+ concurrent-ruby (1.1.10)
+ crack (0.4.5)
+ rexml
+ crass (1.0.6)
+ debug (1.6.2)
+ irb (>= 1.3.6)
+ reline (>= 0.3.1)
+ diff-lcs (1.5.0)
+ digest (3.1.0)
+ erubi (1.11.0)
+ faraday (2.5.2)
+ faraday-net_http (>= 2.0, < 3.1)
+ ruby2_keywords (>= 0.0.4)
+ faraday-net_http (3.0.0)
+ globalid (1.0.0)
+ activesupport (>= 5.0)
+ hashdiff (1.0.1)
+ hashie (5.0.0)
+ i18n (1.12.0)
+ concurrent-ruby (~> 1.0)
+ io-console (0.5.11)
+ irb (1.4.1)
+ reline (>= 0.3.0)
+ jwt (2.5.0)
+ loofah (2.19.0)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ marcel (1.0.2)
+ method_source (1.0.0)
+ mini_mime (1.1.2)
+ mini_portile2 (2.8.0)
+ minitest (5.16.3)
+ multi_xml (0.6.0)
+ net-imap (0.2.3)
+ digest
+ net-protocol
+ strscan
+ net-pop (0.1.1)
+ digest
+ net-protocol
+ timeout
+ net-protocol (0.1.3)
+ timeout
+ net-smtp (0.3.1)
+ digest
+ net-protocol
+ timeout
+ nio4r (2.5.8)
+ nokogiri (1.13.8)
+ mini_portile2 (~> 2.8.0)
+ racc (~> 1.4)
+ oauth2 (2.0.8)
+ faraday (>= 0.17.3, < 3.0)
+ jwt (>= 1.0, < 3.0)
+ multi_xml (~> 0.5)
+ rack (>= 1.2, < 3)
+ snaky_hash (~> 2.0)
+ version_gem (~> 1.1)
+ public_suffix (5.0.0)
+ racc (1.6.0)
+ rack (2.2.4)
+ rack-test (2.0.2)
+ rack (>= 1.3)
+ rails (7.0.4)
+ actioncable (= 7.0.4)
+ actionmailbox (= 7.0.4)
+ actionmailer (= 7.0.4)
+ actionpack (= 7.0.4)
+ actiontext (= 7.0.4)
+ actionview (= 7.0.4)
+ activejob (= 7.0.4)
+ activemodel (= 7.0.4)
+ activerecord (= 7.0.4)
+ activestorage (= 7.0.4)
+ activesupport (= 7.0.4)
+ bundler (>= 1.15.0)
+ railties (= 7.0.4)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
+ rails-html-sanitizer (1.4.3)
+ loofah (~> 2.3)
+ railties (7.0.4)
+ actionpack (= 7.0.4)
+ activesupport (= 7.0.4)
+ method_source
+ rake (>= 12.2)
+ thor (~> 1.0)
+ zeitwerk (~> 2.5)
+ rake (13.0.6)
+ reline (0.3.1)
+ io-console (~> 0.5)
+ rexml (3.2.5)
+ rspec (3.11.0)
+ rspec-core (~> 3.11.0)
+ rspec-expectations (~> 3.11.0)
+ rspec-mocks (~> 3.11.0)
+ rspec-core (3.11.0)
+ rspec-support (~> 3.11.0)
+ rspec-expectations (3.11.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.11.0)
+ rspec-mocks (3.11.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.11.0)
+ rspec-support (3.11.1)
+ ruby2_keywords (0.0.5)
+ snaky_hash (2.0.0)
+ hashie
+ version_gem (~> 1.1)
+ strscan (3.0.4)
+ thor (1.2.1)
+ timeout (0.3.0)
+ tzinfo (2.0.5)
+ concurrent-ruby (~> 1.0)
+ version_gem (1.1.0)
+ webmock (3.18.1)
+ addressable (>= 2.8.0)
+ crack (>= 0.3.2)
+ hashdiff (>= 0.4.0, < 2.0.0)
+ websocket-driver (0.7.5)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.5)
+ zeitwerk (2.6.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ debug (>= 1.0.0)
+ microsoft_graph_mailer!
+ rails
+ rspec (~> 3.11.0)
+ webmock (~> 3.18.1)
+
+BUNDLED WITH
+ 2.3.22
diff --git a/vendor/gems/microsoft_graph_mailer/LICENSE.txt b/vendor/gems/microsoft_graph_mailer/LICENSE.txt
new file mode 100644
index 00000000000..7ed79aa0423
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2022 GitLab B.V.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/gems/microsoft_graph_mailer/README.md b/vendor/gems/microsoft_graph_mailer/README.md
new file mode 100644
index 00000000000..dd9dfecfc56
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/README.md
@@ -0,0 +1,104 @@
+# microsoft_graph_mailer
+
+This gem allows delivery of emails using [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/api/user-sendmail) with [OAuth 2.0 client credentials flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow).
+
+## The reason for this gem
+
+See [https://gitlab.com/groups/gitlab-org/-/epics/8259](https://gitlab.com/groups/gitlab-org/-/epics/8259).
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+```ruby
+gem 'microsoft_graph_mailer'
+```
+
+And then execute:
+
+```shell
+bundle
+```
+
+Or install it yourself as:
+
+```shell
+gem install microsoft_graph_mailer
+```
+
+## Settings
+
+To use the Microsoft Graph API to send mails, you will
+need to create an application in the Azure Active Directory. See the
+[Microsoft instructions](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app) for more details:
+
+1. Sign in to the [Azure portal](https://portal.azure.com).
+1. Search for and select `Azure Active Directory`.
+1. Under `Manage`, select `App registrations` > `New registration`.
+1. Enter a `Name` for your application, such as `MicrosoftGraphMailer`. Users of your app might see this name, and you can change it later.
+1. If `Supported account types` is listed, select the appropriate option.
+1. Leave `Redirect URI` blank. This is not needed.
+1. Select `Register`.
+1. Under `Manage`, select `Certificates & secrets`.
+1. Under `Client secrets`, select `New client secret`, and enter a name.
+1. Under `Expires`, select `Never`, unless you plan on updating the credentials every time it expires.
+1. Select `Add`. Record the secret value in a safe location for use in a later step.
+1. Under `Manage`, select `API Permissions` > `Add a permission`. Select `Microsoft Graph`.
+1. Select `Application permissions`.
+1. Under the `Mail` node, select `Mail.Send`. Then select Add permissions.
+1. If `User.Read` is listed in the permission list, you can delete this.
+1. Click `Grant admin consent` for these permissions.
+
+- `user_id` - The unique identifier for the user. To use Microsoft Graph on behalf of the user.
+- `tenant` - The directory tenant the application plans to operate against, in GUID or domain-name format.
+- `client_id` - The application ID that's assigned to your app. You can find this information in the portal where you registered your app.
+- `client_secret` - The client secret that you generated for your app in the app registration portal.
+
+## Usage
+
+```ruby
+require "microsoft_graph_mailer"
+
+microsoft_graph_mailer = MicrosoftGraphMailer::Delivery.new(
+ {
+ user_id: "YOUR-USER-ID",
+ tenant: "YOUR-TENANT-ID",
+ client_id: "YOUR-CLIENT-ID",
+ client_secret: "YOUR-CLIENT-SECRET-ID"
+ # Defaults to "https://login.microsoftonline.com".
+ azure_ad_endpoint: "https://login.microsoftonline.us",
+ # Defaults to "https://graph.microsoft.com".
+ graph_endpoint: "https://graph.microsoft.us"
+ }
+)
+
+message = Mail.new do
+ from "about@gitlab.com"
+ to "to@example.com"
+ subject "GitLab Mission"
+
+ html_part do
+ content_type "text/html; charset=UTF-8"
+ body "It is GitLab's mission to make it so that <strong>everyone can contribute</strong>."
+ end
+end
+
+microsoft_graph_mailer.deliver!(message)
+```
+
+## Usage with ActionMailer
+
+```ruby
+ActionMailer::Base.delivery_method = :microsoft_graph
+
+ActionMailer::Base.microsoft_graph_settings = {
+ user_id: "YOUR-USER-ID",
+ tenant: "YOUR-TENANT-ID",
+ client_id: "YOUR-CLIENT-ID",
+ client_secret: "YOUR-CLIENT-SECRET-ID"
+ # Defaults to "https://login.microsoftonline.com".
+ azure_ad_endpoint: "https://login.microsoftonline.us",
+ # Defaults to "https://graph.microsoft.com".
+ graph_endpoint: "https://graph.microsoft.us"
+}
+```
diff --git a/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer.rb b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer.rb
new file mode 100644
index 00000000000..8bd252aac94
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+require_relative "microsoft_graph_mailer/delivery"
+require_relative "microsoft_graph_mailer/railtie" if defined?(Rails::Railtie)
+require_relative "microsoft_graph_mailer/version"
+
+module MicrosoftGraphMailer
+ class Error < StandardError
+ end
+
+ class ConfigurationError < Error
+ end
+
+ class DeliveryError < Error
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/client.rb b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/client.rb
new file mode 100644
index 00000000000..b779bb28c39
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/client.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+require "oauth2"
+
+module MicrosoftGraphMailer
+ class Client
+ attr_accessor :user_id, :tenant, :client_id, :client_secret, :azure_ad_endpoint, :graph_endpoint
+
+ def initialize(user_id:, tenant:, client_id:, client_secret:, azure_ad_endpoint:, graph_endpoint:)
+ @user_id = user_id
+ @tenant = tenant
+ @client_id = client_id
+ @client_secret = client_secret
+ @azure_ad_endpoint = azure_ad_endpoint
+ @graph_endpoint = graph_endpoint
+ end
+
+ def send_mail(message_in_mime_format)
+ # https://docs.microsoft.com/en-us/graph/api/user-sendmail
+ token.post(
+ send_mail_url,
+ headers: { "Content-type" => "text/plain" },
+ body: Base64.encode64(message_in_mime_format)
+ )
+ end
+
+ private
+
+ def token
+ # https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow
+ OAuth2::Client.new(
+ client_id,
+ client_secret,
+ site: azure_ad_endpoint,
+ token_url: "/#{tenant}/oauth2/v2.0/token"
+ ).client_credentials.get_token({ scope: scope })
+ end
+
+ def scope
+ "#{graph_endpoint}/.default"
+ end
+
+ def base_url
+ "#{graph_endpoint}/v1.0/users/#{user_id}"
+ end
+
+ def send_mail_url
+ "#{base_url}/sendMail"
+ end
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/delivery.rb b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/delivery.rb
new file mode 100644
index 00000000000..c807ee4319e
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/delivery.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+require_relative "client"
+
+module MicrosoftGraphMailer
+ class Delivery
+ attr_reader :microsoft_graph_settings
+
+ def initialize(microsoft_graph_settings)
+ @microsoft_graph_settings = microsoft_graph_settings
+
+ [:user_id, :tenant, :client_id, :client_secret].each do |setting|
+ unless microsoft_graph_settings[setting]
+ raise MicrosoftGraphMailer::ConfigurationError, "'#{setting}' is missing"
+ end
+ end
+
+ @microsoft_graph_settings[:azure_ad_endpoint] ||= "https://login.microsoftonline.com"
+ @microsoft_graph_settings[:graph_endpoint] ||= "https://graph.microsoft.com"
+ end
+
+ def deliver!(message)
+ # https://github.com/mikel/mail/pull/872
+ if message[:bcc]
+ previous_message_bcc_include_in_headers = message[:bcc].include_in_headers
+ message[:bcc].include_in_headers = true
+ end
+
+ message_in_mime_format = message.encoded
+
+ client = MicrosoftGraphMailer::Client.new(
+ user_id: microsoft_graph_settings[:user_id],
+ tenant: microsoft_graph_settings[:tenant],
+ client_id: microsoft_graph_settings[:client_id],
+ client_secret: microsoft_graph_settings[:client_secret],
+ azure_ad_endpoint: microsoft_graph_settings[:azure_ad_endpoint],
+ graph_endpoint: microsoft_graph_settings[:graph_endpoint]
+ )
+
+ response = client.send_mail(message_in_mime_format)
+
+ raise MicrosoftGraphMailer::DeliveryError unless response.status == 202
+
+ response
+ ensure
+ message[:bcc].include_in_headers = previous_message_bcc_include_in_headers if message[:bcc]
+ end
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/railtie.rb b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/railtie.rb
new file mode 100644
index 00000000000..607d68cc454
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/railtie.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+require_relative "delivery"
+
+module MicrosoftGraphMailer
+ class Railtie < Rails::Railtie
+ ActiveSupport.on_load(:action_mailer) do
+ add_delivery_method :microsoft_graph, MicrosoftGraphMailer::Delivery
+ end
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/version.rb b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/version.rb
new file mode 100644
index 00000000000..057aebdad2b
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/lib/microsoft_graph_mailer/version.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+module MicrosoftGraphMailer
+ VERSION = "0.1.0"
+end
diff --git a/vendor/gems/microsoft_graph_mailer/microsoft_graph_mailer.gemspec b/vendor/gems/microsoft_graph_mailer/microsoft_graph_mailer.gemspec
new file mode 100644
index 00000000000..af9fb5987ca
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/microsoft_graph_mailer.gemspec
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require_relative "lib/microsoft_graph_mailer/version"
+
+Gem::Specification.new do |spec|
+ spec.name = "microsoft_graph_mailer"
+ spec.version = MicrosoftGraphMailer::VERSION
+ spec.authors = ["Bogdan Denkovych"]
+ spec.email = ["bdenkovych@gitlab.com"]
+
+ spec.summary = "Allows delivery of emails using Microsoft Graph API with OAuth 2.0 client credentials flow"
+ spec.homepage = "https://gitlab.com/gitlab-org/gitlab/-/tree/master/vendor/gems/microsoft_graph_mailer"
+ spec.license = "MIT"
+ spec.required_ruby_version = ">= 2.7.0"
+
+ spec.metadata["homepage_uri"] = spec.homepage
+ spec.metadata["source_code_uri"] = "https://gitlab.com/gitlab-org/gitlab/-/tree/master/vendor/gems/microsoft_graph_mailer"
+
+ spec.files = Dir["lib/**/*.rb"] + ["LICENSE.txt", "README.md"]
+ spec.require_paths = ["lib"]
+
+ spec.add_runtime_dependency "mail", "~> 2.7"
+ spec.add_runtime_dependency "oauth2", [">= 1.4.4", "< 3"]
+
+ spec.add_development_dependency "debug", ">= 1.0.0"
+ spec.add_development_dependency "rails"
+ spec.add_development_dependency "rspec", "~> 3.11.0"
+ spec.add_development_dependency "webmock", "~> 3.18.1"
+end
diff --git a/vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab.txt b/vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab.txt
new file mode 100644
index 00000000000..1df29200042
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab.txt
@@ -0,0 +1 @@
+GitLab
diff --git a/vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab_logo.png b/vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab_logo.png
new file mode 100644
index 00000000000..12525056939
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/spec/fixtures/attachments/gitlab_logo.png
Binary files differ
diff --git a/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/delivery_spec.rb b/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/delivery_spec.rb
new file mode 100644
index 00000000000..23096e75b76
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/delivery_spec.rb
@@ -0,0 +1,128 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+require "securerandom"
+
+RSpec.describe MicrosoftGraphMailer::Delivery do
+ let(:microsoft_graph_settings) do
+ {
+ user_id: SecureRandom.hex,
+ tenant: SecureRandom.hex,
+ client_id: SecureRandom.hex,
+ client_secret: SecureRandom.hex,
+ azure_ad_endpoint: "https://test-azure_ad_endpoint",
+ graph_endpoint: "https://test-graph_endpoint"
+ }
+ end
+
+ subject { described_class.new(microsoft_graph_settings) }
+
+ describe ".new" do
+ it "sets #microsoft_graph_settings" do
+ expect(subject.microsoft_graph_settings).to eq(microsoft_graph_settings)
+ end
+
+ [:user_id, :tenant, :client_id, :client_secret].each do |setting|
+ it "raises MicrosoftGraphMailer::ConfigurationError when '#{setting}' is missing" do
+ microsoft_graph_settings[setting] = nil
+
+ expect { subject }
+ .to raise_error(MicrosoftGraphMailer::ConfigurationError, "'#{setting}' is missing")
+ end
+ end
+
+ it "sets azure_ad_endpoint setting to 'https://login.microsoftonline.com' when it is missing" do
+ microsoft_graph_settings[:azure_ad_endpoint] = nil
+
+ expect(subject.microsoft_graph_settings[:azure_ad_endpoint]).to eq("https://login.microsoftonline.com")
+ end
+
+ it "sets graph_endpoint setting to 'https://graph.microsoft.com' when it is missing" do
+ microsoft_graph_settings[:graph_endpoint] = nil
+
+ expect(subject.microsoft_graph_settings[:graph_endpoint]).to eq("https://graph.microsoft.com")
+ end
+ end
+
+ describe "#deliver!" do
+ let(:access_token) { SecureRandom.hex }
+
+ let(:message) do
+ Mail.new do
+ from "about@gitlab.com"
+
+ to "to@example.com"
+
+ cc "cc@example.com"
+
+ subject "GitLab Mission"
+
+ text_part do
+ body "It is GitLab's mission to make it so that everyone can contribute."
+ end
+
+ html_part do
+ content_type "text/html; charset=UTF-8"
+ body "It is GitLab's mission to make it so that <strong>everyone can contribute</strong>."
+ end
+
+ add_file fixture_path("attachments", "gitlab.txt")
+
+ add_file fixture_path("attachments", "gitlab_logo.png")
+ end
+ end
+
+ context "when token request is successful" do
+ before do
+ stub_token_request(microsoft_graph_settings: subject.microsoft_graph_settings, access_token: access_token, response_status: 200)
+ end
+
+ context "when send mail request returns response status 202" do
+ it "sends mail and returns an instance of OAuth2::Response" do
+ stub_send_mail_request(microsoft_graph_settings: subject.microsoft_graph_settings, access_token: access_token, message: message, response_status: 202)
+
+ expect(subject.deliver!(message)).to be_an_instance_of(OAuth2::Response)
+ end
+
+ it "sends mail including bcc field" do
+ message.bcc = "bcc@example.com"
+
+ stub_send_mail_request(microsoft_graph_settings: subject.microsoft_graph_settings, access_token: access_token, message: message, response_status: 202)
+
+ subject.deliver!(message)
+ end
+
+ it "does not change message[:bcc].include_in_headers" do
+ message.bcc = "bcc@example.com"
+ expected_message_bcc_include_in_headers = "42"
+ message[:bcc].include_in_headers = expected_message_bcc_include_in_headers
+
+ stub_send_mail_request(microsoft_graph_settings: subject.microsoft_graph_settings, access_token: access_token, message: message, response_status: 202)
+
+ subject.deliver!(message)
+
+ expect(message[:bcc].include_in_headers).to eq(expected_message_bcc_include_in_headers)
+ end
+ end
+
+ context "when send mail request returns response status other than 202" do
+ it "raises MicrosoftGraphMailer::DeliveryError" do
+ stub_send_mail_request(microsoft_graph_settings: subject.microsoft_graph_settings, access_token: access_token, message: message, response_status: 200)
+
+ expect { subject.deliver!(message) }.to raise_error(MicrosoftGraphMailer::DeliveryError)
+ end
+ end
+ end
+
+ context "when token request is not successful" do
+ before do
+ stub_token_request(microsoft_graph_settings: subject.microsoft_graph_settings, access_token: access_token, response_status: 503)
+ end
+
+ it "raises OAuth2::Error" do
+ expect { subject.deliver!(message) }.to raise_error(OAuth2::Error)
+ end
+ end
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/railtie_spec.rb b/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/railtie_spec.rb
new file mode 100644
index 00000000000..d1a60522cdf
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer/railtie_spec.rb
@@ -0,0 +1,140 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+require "securerandom"
+
+class TestMailer < ActionMailer::Base
+ def gitlab_mission(to:, cc: [])
+ mail(from: "about@gitlab.com", to: to, cc: cc, subject: "GitLab Mission") do |format|
+ format.text { render plain: "It is GitLab's mission to make it so that everyone can contribute." }
+ format.html { render html: "It is GitLab's mission to make it so that <strong>everyone can contribute</strong>.".html_safe }
+ end
+
+ mail.attachments["gitlab.txt"] = File.read(fixture_path("attachments", "gitlab.txt"))
+
+ mail.attachments["gitlab_logo.png"] = File.read(fixture_path("attachments", "gitlab_logo.png"))
+ end
+end
+
+RSpec.describe MicrosoftGraphMailer::Railtie do
+ let(:microsoft_graph_settings) do
+ {
+ user_id: SecureRandom.hex,
+ tenant: SecureRandom.hex,
+ client_id: SecureRandom.hex,
+ client_secret: SecureRandom.hex,
+ azure_ad_endpoint: "https://test-azure_ad_endpoint",
+ graph_endpoint: "https://test-graph_endpoint"
+ }
+ end
+
+ let(:message) { TestMailer.gitlab_mission(to: "to@example.com", cc: "cc@example.com") }
+
+ before do
+ ActionMailer::Base.delivery_method = :microsoft_graph
+ ActionMailer::Base.microsoft_graph_settings = microsoft_graph_settings
+ end
+
+ it "its superclass is Rails::Railtie" do
+ expect(MicrosoftGraphMailer::Railtie.superclass).to eq(Rails::Railtie)
+ end
+
+ describe "settings" do
+ describe "ActionMailer::Base.delivery_methods[:microsoft_graph]" do
+ it "returns MicrosoftGraphMailer::Delivery" do
+ expect(ActionMailer::Base.delivery_methods[:microsoft_graph]).to eq(MicrosoftGraphMailer::Delivery)
+ end
+ end
+
+ describe "ActionMailer::Base.microsoft_graph_settings" do
+ it "returns microsoft_graph_settings" do
+ expect(ActionMailer::Base.microsoft_graph_settings).to eq(microsoft_graph_settings)
+ end
+ end
+
+ it "sets #microsoft_graph_settings" do
+ expect(message.delivery_method.microsoft_graph_settings).to eq(microsoft_graph_settings)
+ end
+
+ [:user_id, :tenant, :client_id, :client_secret].each do |setting|
+ it "raises MicrosoftGraphMailer::ConfigurationError when '#{setting}' is missing" do
+ microsoft_graph_settings[setting] = nil
+ ActionMailer::Base.microsoft_graph_settings = microsoft_graph_settings
+
+ expect { message.delivery_method }
+ .to raise_error(MicrosoftGraphMailer::ConfigurationError, "'#{setting}' is missing")
+ end
+ end
+
+ it "sets azure_ad_endpoint setting to 'https://login.microsoftonline.com' when it is missing" do
+ microsoft_graph_settings[:azure_ad_endpoint] = nil
+ ActionMailer::Base.microsoft_graph_settings = microsoft_graph_settings
+
+ expect(message.delivery_method.microsoft_graph_settings[:azure_ad_endpoint]).to eq("https://login.microsoftonline.com")
+ end
+
+ it "sets graph_endpoint setting to 'https://graph.microsoft.com' when it is missing" do
+ microsoft_graph_settings[:graph_endpoint] = nil
+ ActionMailer::Base.microsoft_graph_settings = microsoft_graph_settings
+
+ expect(message.delivery_method.microsoft_graph_settings[:graph_endpoint]).to eq("https://graph.microsoft.com")
+ end
+ end
+
+ describe "ActionMailer::MessageDelivery#deliver_now" do
+ let(:access_token) { SecureRandom.hex }
+
+ context "when token request is successful" do
+ before do
+ stub_token_request(microsoft_graph_settings: microsoft_graph_settings, access_token: access_token, response_status: 200)
+ end
+
+ context "when send mail request returns response status 202" do
+ it "sends and returns mail" do
+ stub_send_mail_request(microsoft_graph_settings: microsoft_graph_settings, access_token: access_token, message: message, response_status: 202)
+
+ expect(message.deliver_now).to eq(message)
+ end
+
+ it "sends mail including bcc field" do
+ message.bcc = "bcc@example.com"
+
+ stub_send_mail_request(microsoft_graph_settings: microsoft_graph_settings, access_token: access_token, message: message, response_status: 202)
+
+ message.deliver_now
+ end
+
+ it "does not change message[:bcc].include_in_headers" do
+ message.bcc = "bcc@example.com"
+ expected_message_bcc_include_in_headers = "42"
+ message[:bcc].include_in_headers = expected_message_bcc_include_in_headers
+
+ stub_send_mail_request(microsoft_graph_settings: microsoft_graph_settings, access_token: access_token, message: message, response_status: 202)
+
+ message.deliver_now
+
+ expect(message[:bcc].include_in_headers).to eq(expected_message_bcc_include_in_headers)
+ end
+ end
+
+ context "when send mail request returns response status other than 202" do
+ it "raises MicrosoftGraphMailer::DeliveryError" do
+ stub_send_mail_request(microsoft_graph_settings: microsoft_graph_settings, access_token: access_token, message: message, response_status: 200)
+
+ expect { message.deliver_now }.to raise_error(MicrosoftGraphMailer::DeliveryError)
+ end
+ end
+ end
+
+ context "when token request is not successful" do
+ before do
+ stub_token_request(microsoft_graph_settings: microsoft_graph_settings, access_token: access_token, response_status: 503)
+ end
+
+ it "raises OAuth2::Error" do
+ expect { message.deliver_now }.to raise_error(OAuth2::Error)
+ end
+ end
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer_spec.rb b/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer_spec.rb
new file mode 100644
index 00000000000..3306e91db38
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/spec/lib/microsoft_graph_mailer_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+RSpec.describe MicrosoftGraphMailer do
+ describe "::VERSION" do
+ it "returns a version number" do
+ expect(MicrosoftGraphMailer::VERSION).to eq("0.1.0")
+ end
+ end
+
+ describe "::Error" do
+ it "its superclass is StandardError" do
+ expect(MicrosoftGraphMailer::Error.superclass).to eq(StandardError)
+ end
+ end
+
+ describe "::ConfigurationError" do
+ it "its superclass is MicrosoftGraphMailer::Error" do
+ expect(MicrosoftGraphMailer::ConfigurationError.superclass).to eq(MicrosoftGraphMailer::Error)
+ end
+ end
+
+ describe "::DeliveryError" do
+ it "its superclass is MicrosoftGraphMailer::Error" do
+ expect(MicrosoftGraphMailer::DeliveryError.superclass).to eq(MicrosoftGraphMailer::Error)
+ end
+ end
+end
diff --git a/vendor/gems/microsoft_graph_mailer/spec/spec_helper.rb b/vendor/gems/microsoft_graph_mailer/spec/spec_helper.rb
new file mode 100644
index 00000000000..ac5dd817904
--- /dev/null
+++ b/vendor/gems/microsoft_graph_mailer/spec/spec_helper.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+require "rails"
+require "action_mailer/railtie"
+
+require "microsoft_graph_mailer"
+
+require "mail"
+
+require "webmock/rspec"
+
+RSpec.configure do |config|
+end
+
+def fixture_path(*path)
+ File.join(__dir__, "fixtures", path)
+end
+
+def stub_token_request(microsoft_graph_settings:, access_token:, response_status:)
+ stub_request(
+ :post,
+ "#{microsoft_graph_settings[:azure_ad_endpoint]}/#{microsoft_graph_settings[:tenant]}/oauth2/v2.0/token"
+ ).with(
+ body: {
+ "grant_type" => "client_credentials",
+ "scope" => "#{microsoft_graph_settings[:graph_endpoint]}/.default"
+ }
+ ).to_return(
+ body: {
+ "token_type" => "Bearer",
+ "expires_in" => "3599",
+ "access_token" => access_token
+ }.to_json,
+ status: response_status,
+ headers: { "content-type" => "application/json; charset=utf-8" }
+ )
+end
+
+def stub_send_mail_request(microsoft_graph_settings:, access_token:, message:, response_status:)
+ if message[:bcc]
+ previous_message_bcc_include_in_headers = message[:bcc].include_in_headers
+ message[:bcc].include_in_headers = true
+ end
+
+ stub_request(
+ :post,
+ "#{microsoft_graph_settings[:graph_endpoint]}/v1.0/users/#{microsoft_graph_settings[:user_id]}/sendMail"
+ ).with(
+ body: Base64.encode64(message.encoded),
+ headers: {
+ "Authorization" => "Bearer #{access_token}",
+ "Content-Type" => "text/plain"
+ }
+ ).to_return(
+ body: "",
+ status: response_status
+ )
+ensure
+ message[:bcc].include_in_headers = previous_message_bcc_include_in_headers if message[:bcc]
+end
diff --git a/vendor/gems/omniauth-azure-oauth2/Gemfile.lock b/vendor/gems/omniauth-azure-oauth2/Gemfile.lock
index 0bd5d401175..d2bbe3e8d2f 100644
--- a/vendor/gems/omniauth-azure-oauth2/Gemfile.lock
+++ b/vendor/gems/omniauth-azure-oauth2/Gemfile.lock
@@ -3,7 +3,7 @@ PATH
specs:
omniauth-azure-oauth2 (0.0.10)
jwt (>= 1.0, < 3.0)
- omniauth (~> 1.0, < 3)
+ omniauth (~> 2.0)
omniauth-oauth2 (~> 1.4)
GEM
@@ -19,16 +19,17 @@ GEM
multi_xml (0.6.0)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
- oauth2 (2.0.6)
+ oauth2 (2.0.3)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
rash_alt (>= 0.4, < 1)
- version_gem (~> 1.1)
- omniauth (1.9.1)
+ version_gem (~> 1.0)
+ omniauth (2.1.0)
hashie (>= 3.4.6)
- rack (>= 1.6.2, < 3)
+ rack (>= 2.2.3)
+ rack-protection
omniauth-oauth2 (1.7.3)
oauth2 (>= 1.4, < 3)
omniauth (>= 1.9, < 3)
@@ -70,4 +71,4 @@ DEPENDENCIES
sinatra
BUNDLED WITH
- 2.3.20
+ 2.3.21
diff --git a/vendor/gems/omniauth-azure-oauth2/lib/omniauth/strategies/azure_oauth2.rb b/vendor/gems/omniauth-azure-oauth2/lib/omniauth/strategies/azure_oauth2.rb
index f18babc0619..d71911b9876 100644
--- a/vendor/gems/omniauth-azure-oauth2/lib/omniauth/strategies/azure_oauth2.rb
+++ b/vendor/gems/omniauth-azure-oauth2/lib/omniauth/strategies/azure_oauth2.rb
@@ -59,8 +59,10 @@ module OmniAuth
super.merge(resource: azure_resource || options.resource)
end
+ # for compatibility with OmniAuth 2.0
+ # see https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/pull/6
def callback_url
- full_host + script_name + callback_path
+ full_host + callback_path
end
def raw_info
diff --git a/vendor/gems/omniauth-azure-oauth2/omniauth-azure-oauth2.gemspec b/vendor/gems/omniauth-azure-oauth2/omniauth-azure-oauth2.gemspec
index 6e1bc583881..1299285b945 100644
--- a/vendor/gems/omniauth-azure-oauth2/omniauth-azure-oauth2.gemspec
+++ b/vendor/gems/omniauth-azure-oauth2/omniauth-azure-oauth2.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.version = OmniAuth::AzureOauth2::VERSION
gem.license = "MIT"
- gem.add_runtime_dependency 'omniauth', '~> 1.0', '< 3'
+ gem.add_runtime_dependency 'omniauth', '~> 2.0'
gem.add_dependency 'jwt', ['>= 1.0', '< 3.0']
gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.4'
diff --git a/vendor/gems/omniauth-cas3/Gemfile.lock b/vendor/gems/omniauth-cas3/Gemfile.lock
index 4c59eb05d50..a856e78f00f 100644
--- a/vendor/gems/omniauth-cas3/Gemfile.lock
+++ b/vendor/gems/omniauth-cas3/Gemfile.lock
@@ -4,29 +4,30 @@ PATH
omniauth-cas3 (1.1.4)
addressable (~> 2.3)
nokogiri (~> 1.7, >= 1.7.1)
- omniauth (~> 1.2, < 3)
+ omniauth (~> 2.0)
GEM
remote: https://rubygems.org/
specs:
- addressable (2.8.0)
- public_suffix (>= 2.0.2, < 5.0)
+ addressable (2.8.1)
+ public_suffix (>= 2.0.2, < 6.0)
awesome_print (1.9.2)
crack (0.4.5)
rexml
diff-lcs (1.5.0)
hashdiff (1.0.1)
hashie (5.0.0)
- mini_portile2 (2.8.0)
nokogiri (1.13.7)
- mini_portile2 (~> 2.8.0)
racc (~> 1.4)
- omniauth (1.9.1)
+ omniauth (2.1.0)
hashie (>= 3.4.6)
- rack (>= 1.6.2, < 3)
- public_suffix (4.0.7)
+ rack (>= 2.2.3)
+ rack-protection
+ public_suffix (5.0.0)
racc (1.6.0)
rack (2.2.4)
+ rack-protection (2.2.2)
+ rack
rack-test (0.8.3)
rack (>= 1.0, < 3)
rake (10.5.0)
@@ -44,7 +45,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
- webmock (3.14.0)
+ webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -61,4 +62,4 @@ DEPENDENCIES
webmock
BUNDLED WITH
- 2.3.18
+ 2.3.21
diff --git a/vendor/gems/omniauth-cas3/lib/omniauth/strategies/cas3.rb b/vendor/gems/omniauth-cas3/lib/omniauth/strategies/cas3.rb
index 7271621c564..441529b67d8 100644
--- a/vendor/gems/omniauth-cas3/lib/omniauth/strategies/cas3.rb
+++ b/vendor/gems/omniauth-cas3/lib/omniauth/strategies/cas3.rb
@@ -62,9 +62,14 @@ module OmniAuth
end
extra do
- prune!(
- raw_info.delete_if{ |k,v| AuthHashSchemaKeys.include?(k) }
- )
+ hash = {}
+
+ unless skip_info?
+ hash = raw_info.dup
+ hash.delete_if { |k, _v| AuthHashSchemaKeys.include?(k) }
+ end
+
+ prune! hash
end
uid do
diff --git a/vendor/gems/omniauth-cas3/omniauth-cas3.gemspec b/vendor/gems/omniauth-cas3/omniauth-cas3.gemspec
index abbcaa268d0..c976d85df99 100644
--- a/vendor/gems/omniauth-cas3/omniauth-cas3.gemspec
+++ b/vendor/gems/omniauth-cas3/omniauth-cas3.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = Omniauth::Cas3::VERSION
- gem.add_dependency 'omniauth', '~> 1.2', '< 3'
+ gem.add_dependency 'omniauth', '~> 2.0'
gem.add_dependency 'nokogiri', '~> 1.7', '>= 1.7.1'
gem.add_dependency 'addressable', '~> 2.3'
diff --git a/vendor/gems/omniauth-cas3/spec/omniauth/strategies/cas3_spec.rb b/vendor/gems/omniauth-cas3/spec/omniauth/strategies/cas3_spec.rb
index fd61fc79580..f434d711f02 100644
--- a/vendor/gems/omniauth-cas3/spec/omniauth/strategies/cas3_spec.rb
+++ b/vendor/gems/omniauth-cas3/spec/omniauth/strategies/cas3_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
+require 'securerandom'
describe OmniAuth::Strategies::CAS3, type: :strategy do
include Rack::Test::Methods
@@ -15,17 +16,32 @@ describe OmniAuth::Strategies::CAS3, type: :strategy do
}.to_app
end
+ let(:csrf_token) { SecureRandom.base64(32) }
+ let(:base_env) { { 'rack.session' => { csrf: csrf_token }, 'rack.input' => StringIO.new("authenticity_token=#{escaped_token}") } }
+ let(:post_env) { make_env('/auth/cas3', base_env.merge(request_env)) }
+ let(:escaped_token) { URI.encode_www_form_component(csrf_token, Encoding::UTF_8) }
+
+ def make_env(path = '/auth/cas3', props = {})
+ {
+ 'REQUEST_METHOD' => 'POST',
+ 'PATH_INFO' => path,
+ 'rack.session' => {},
+ 'rack.input' => StringIO.new('test=true')
+ }.merge(props)
+ end
+
# TODO: Verify that these are even useful tests
shared_examples_for 'a CAS redirect response' do
let(:redirect_params) { 'service=' + Rack::Utils.escape("http://example.org/auth/cas3/callback?url=#{Rack::Utils.escape(return_url)}") }
- before { get url, nil, request_env }
+ before { post url, nil, post_env }
subject { last_response }
it { should be_redirect }
it 'redirects to the CAS server' do
+ expect(subject.status).to eq(302)
expect(subject.headers).to include 'Location' => "http://cas.example.org:8080/login?#{redirect_params}"
end
end
@@ -78,7 +94,7 @@ describe OmniAuth::Strategies::CAS3, type: :strategy do
it { should include('ssl' => true) }
end
- describe 'GET /auth/cas3' do
+ describe 'POST /auth/cas3' do
let(:return_url) { 'http://myapp.com/admin/foo' }
context 'with a referer' do
diff --git a/vendor/gems/omniauth-gitlab/Gemfile.lock b/vendor/gems/omniauth-gitlab/Gemfile.lock
index b5979104080..b59ba59b95b 100644
--- a/vendor/gems/omniauth-gitlab/Gemfile.lock
+++ b/vendor/gems/omniauth-gitlab/Gemfile.lock
@@ -2,7 +2,7 @@ PATH
remote: .
specs:
omniauth-gitlab (4.0.0)
- omniauth (~> 1.0)
+ omniauth (~> 2.0)
omniauth-oauth2 (~> 1.7.1)
GEM
@@ -24,13 +24,16 @@ GEM
rack (>= 1.2, < 3)
rash_alt (>= 0.4, < 1)
version_gem (~> 1.0)
- omniauth (1.9.1)
+ omniauth (2.1.0)
hashie (>= 3.4.6)
- rack (>= 1.6.2, < 3)
+ rack (>= 2.2.3)
+ rack-protection
omniauth-oauth2 (1.7.3)
oauth2 (>= 1.4, < 3)
omniauth (>= 1.9, < 3)
- rack (2.2.3.1)
+ rack (2.2.4)
+ rack-protection (2.2.2)
+ rack
rake (13.0.6)
rash_alt (0.4.12)
hashie (>= 3.4)
diff --git a/vendor/gems/omniauth-gitlab/lib/omniauth/strategies/gitlab.rb b/vendor/gems/omniauth-gitlab/lib/omniauth/strategies/gitlab.rb
index 19ee02e78c4..3c23d8e2b19 100644
--- a/vendor/gems/omniauth-gitlab/lib/omniauth/strategies/gitlab.rb
+++ b/vendor/gems/omniauth-gitlab/lib/omniauth/strategies/gitlab.rb
@@ -30,15 +30,15 @@ module OmniAuth
@raw_info ||= access_token.get(user_endpoint_url).parsed
end
+ def callback_url
+ options.redirect_url || (full_host + callback_path)
+ end
+
private
def user_endpoint_url
options.client_options.site.match(API_SUFFIX_REGEX) ? 'user' : 'api/v4/user'
end
-
- def callback_url
- options.redirect_url || (full_host + script_name + callback_path)
- end
end
end
end
diff --git a/vendor/gems/omniauth-gitlab/omniauth-gitlab.gemspec b/vendor/gems/omniauth-gitlab/omniauth-gitlab.gemspec
index be25cb50af6..ca4b8d904f0 100644
--- a/vendor/gems/omniauth-gitlab/omniauth-gitlab.gemspec
+++ b/vendor/gems/omniauth-gitlab/omniauth-gitlab.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
gem.test_files = Dir['spec/**/*.rb']
gem.require_paths = ['lib']
- gem.add_dependency 'omniauth', '~> 1.0'
+ gem.add_dependency 'omniauth', '~> 2.0'
gem.add_dependency 'omniauth-oauth2', '~> 1.7.1'
gem.add_development_dependency 'rspec', '~> 3.1'
gem.add_development_dependency 'rspec-its', '~> 1.0'
diff --git a/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb b/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb
index a599386b26c..e9fd38f474b 100644
--- a/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb
+++ b/vendor/gems/omniauth-gitlab/spec/omniauth/strategies/gitlab_spec.rb
@@ -77,4 +77,26 @@ describe OmniAuth::Strategies::GitLab do
end
end
end
+
+ describe '#callback_url' do
+ let(:base_url) { 'https://example.com' }
+
+ context 'no script name present' do
+ it 'has the correct default callback path' do
+ allow(subject).to receive(:full_host) { base_url }
+ allow(subject).to receive(:script_name) { '' }
+ allow(subject).to receive(:query_string) { '' }
+ expect(subject.callback_url).to eq(base_url + '/auth/gitlab/callback')
+ end
+ end
+
+ context 'script name' do
+ it 'should set the callback path with script_name' do
+ allow(subject).to receive(:full_host) { base_url }
+ allow(subject).to receive(:script_name) { '/v1' }
+ allow(subject).to receive(:query_string) { '' }
+ expect(subject.callback_url).to eq(base_url + '/v1/auth/gitlab/callback')
+ end
+ end
+ end
end
diff --git a/vendor/gems/omniauth-google-oauth2/.gitlab-ci.yml b/vendor/gems/omniauth-google-oauth2/.gitlab-ci.yml
new file mode 100644
index 00000000000..dbc4a7c16b1
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/.gitlab-ci.yml
@@ -0,0 +1,28 @@
+workflow:
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+
+.rspec:
+ cache:
+ key: omniauth-google-oauth2
+ paths:
+ - vendor/gems/omniauth-google-oauth2/vendor/ruby
+ before_script:
+ - cd vendor/gems/omniauth-google-oauth2
+ - ruby -v # Print out ruby version for debugging
+ - gem install bundler --no-document # Bundler is not installed with the image
+ - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby
+ - bundle config set with 'development'
+ - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI
+ - bundle config # Show bundler configuration
+ - bundle install -j $(nproc)
+ script:
+ - bundle exec rspec
+
+rspec-2.7:
+ image: "ruby:2.7"
+ extends: .rspec
+
+rspec-3.0:
+ image: "ruby:3.0"
+ extends: .rspec
diff --git a/vendor/gems/omniauth-google-oauth2/CHANGELOG.md b/vendor/gems/omniauth-google-oauth2/CHANGELOG.md
new file mode 100644
index 00000000000..5b252048fd6
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/CHANGELOG.md
@@ -0,0 +1,354 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+## 1.0.1 - 2022-03-10
+
+### Added
+- Output granted scopes in credentials block of the auth hash.
+- Migrated to GitHub actions.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Overriding the `redirect_uri` via params or JSON request body.
+
+## 1.0.0 - 2021-03-14
+
+### Added
+- Support for Omniauth 2.x!
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Support for Omniauth 1.x.
+
+### Fixed
+- Nothing.
+
+## 0.8.2 - 2021-03-14
+
+### Added
+- Constrains the version to Omniauth 1.x.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Nothing.
+
+## 0.8.1 - 2020-12-12
+
+### Added
+- Support reading the access token from a json request body.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- No longer verify the iat claim for JWT.
+
+### Fixed
+- A few minor issues with .rubocop.yml.
+- Issues with image resizing code when the image came with size information from Google.
+
+## 0.8.0 - 2019-08-21
+
+### Added
+- Updated omniauth-oauth2 to v1.6.0 for security fixes.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Ruby 2.1 support.
+
+### Fixed
+- Nothing.
+
+## 0.7.0 - 2019-06-03
+
+### Added
+- Ensure `info[:email]` is always verified, and include `unverified_email`
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Nothing.
+
+## 0.6.1 - 2019-03-07
+
+### Added
+- Return `email` and `email_verified` keys in response.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Nothing.
+
+## 0.6.0 - 2018-12-28
+
+### Added
+- Support for JWT 2.x.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Support for JWT 1.x.
+- Support for `raw_friend_info` and `raw_image_info`.
+- Stop using Google+ API endpoints.
+
+### Fixed
+- Nothing.
+
+## 0.5.4 - 2018-12-07
+
+### Added
+- New recommended endpoints for Google OAuth.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Nothing.
+
+## 0.5.3 - 2018-01-25
+
+### Added
+- Added support for the JWT 2.x gem.
+- Now fully qualifies the `JWT` class to prevent conflicts with the `Omniauth::JWT` strategy.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Removed the `multijson` dependency.
+- Support for versions of `omniauth-oauth2` < 1.5.
+
+### Fixed
+- Nothing.
+
+## 0.5.2 - 2017-07-30
+
+### Added
+- Nothing.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- New `authorize_url` and `token_url` endpoints are reverted until JWT 2.0 ships.
+
+### Fixed
+- Nothing.
+
+## 0.5.1 - 2017-07-19
+
+### Added
+- *Breaking* JWT iss verification can be enabled/disabled with the `verify_iss` flag - see the README for more details.
+- Authorize options now includes `device_id` and `device_name` for private ip ranges.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Updated `authorize_url` and `token_url` to new endpoints.
+
+## 0.5.0 - 2017-05-29
+
+### Added
+- Rubocop checks to specs.
+- Defaulted dev environment to ruby 2.3.4.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Testing support for older versions of ruby not supported by OmniAuth 1.5.
+- Key `[:urls]['Google']` no longer exists, it has been renamed to `[:urls][:google]`.
+
+### Fixed
+- Updated all code to rubocop conventions. This includes the Ruby 1.9 hash syntax when appropriate.
+- Example javascript flow now picks up ENV vars for google key and secret.
+
+## 0.4.1 - 2016-03-14
+
+### Added
+- Nothing.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Fixed JWT iat leeway by requiring ruby-jwt 1.5.2
+
+## 0.4.0 - 2016-03-11
+
+### Added
+- Addedd ability to specify multiple hosted domains.
+- Added a default leeway of 1 minute to JWT token validation.
+- Now requires ruby-jwt 1.5.x.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Removed support for ruby 1.9.3 as ruby-jwt 1.5.x does not support it.
+
+### Fixed
+- Nothing.
+
+## 0.3.1 - 2016-01-28
+
+### Added
+- Verify Hosted Domain if hd is set in options.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Dependency on addressable.
+
+### Fixed
+- Nothing.
+
+## 0.3.0 - 2016-01-09
+
+### Added
+- Updated verify_token to use the v3 tokeninfo endpoint.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Compatibility with omniauth-oauth2 1.4.0
+
+## 0.2.10 - 2015-11-05
+
+### Added
+- Nothing.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Removed some checks on the id_token. Now only parses the id_token in the JWT processing.
+
+### Fixed
+- Nothing.
+
+## 0.2.9 - 2015-10-29
+
+### Added
+- Nothing.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Issue with omniauth-oauth2 where redirect_uri was handled improperly. We now lock the dependency to ~> 1.3.1
+
+## 0.2.8 - 2015-10-01
+
+### Added
+- Added skip_jwt option to bypass JWT decoding in case you get decoding errors.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Resolved JWT::InvalidIatError. https://github.com/zquestz/omniauth-google-oauth2/issues/195
+
+## 0.2.7 - 2015-09-25
+
+### Added
+- Now strips out the 'sz' parameter from profile image urls.
+- Now uses 'addressable' gem for URI actions.
+- Added image data to extras hash.
+- Override validation on JWT token for open_id token.
+- Handle authorization codes coming from an installed applications.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Fixes double slashes in google image urls.
+
+## 0.2.6 - 2014-10-26
+
+### Added
+- Nothing.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Hybrid authorization issues due to bad method alias.
+
+## 0.2.5 - 2014-07-09
+
+### Added
+- Support for versions of omniauth past 1.0.x.
+
+### Deprecated
+- Nothing.
+
+### Removed
+- Nothing.
+
+### Fixed
+- Nothing.
+
+## 0.2.4 - 2014-04-25
+
+### Added
+- Now requiring the "Contacts API" and "Google+ API" to be enabled in your Google API console.
+
+### Deprecated
+- The old Google OAuth API support was removed without deprecation.
+
+### Removed
+- Support for the old Google OAuth API. `OAuth2::Error` will be thrown and state that access is not configured when you attempt to authenticate using the old API. See Added section for this release.
+
+### Fixed
+- Nothing.
diff --git a/vendor/gems/omniauth-google-oauth2/Gemfile b/vendor/gems/omniauth-google-oauth2/Gemfile
new file mode 100644
index 00000000000..7f4f5e950d1
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/Gemfile
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+source 'https://rubygems.org'
+
+gemspec
diff --git a/vendor/gems/omniauth-google-oauth2/Gemfile.lock b/vendor/gems/omniauth-google-oauth2/Gemfile.lock
new file mode 100644
index 00000000000..6c3f5ff3f68
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/Gemfile.lock
@@ -0,0 +1,87 @@
+PATH
+ remote: .
+ specs:
+ omniauth-google-oauth2 (1.0.1)
+ jwt (>= 2.0)
+ oauth2 (~> 2.0)
+ omniauth (~> 2.0)
+ omniauth-oauth2 (~> 1.7.1)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ ast (2.4.2)
+ diff-lcs (1.5.0)
+ faraday (2.5.2)
+ faraday-net_http (>= 2.0, < 3.1)
+ ruby2_keywords (>= 0.0.4)
+ faraday-net_http (3.0.0)
+ hashie (5.0.0)
+ jwt (2.4.1)
+ multi_xml (0.6.0)
+ oauth2 (2.0.3)
+ faraday (>= 0.17.3, < 3.0)
+ jwt (>= 1.0, < 3.0)
+ multi_xml (~> 0.5)
+ rack (>= 1.2, < 3)
+ rash_alt (>= 0.4, < 1)
+ version_gem (~> 1.0)
+ omniauth (2.1.0)
+ hashie (>= 3.4.6)
+ rack (>= 2.2.3)
+ rack-protection
+ omniauth-oauth2 (1.7.3)
+ oauth2 (>= 1.4, < 3)
+ omniauth (>= 1.9, < 3)
+ parallel (1.22.1)
+ parser (3.1.2.0)
+ ast (~> 2.4.1)
+ rack (2.2.4)
+ rack-protection (2.2.2)
+ rack
+ rainbow (3.1.1)
+ rake (12.3.3)
+ rash_alt (0.4.12)
+ hashie (>= 3.4)
+ regexp_parser (2.5.0)
+ rexml (3.2.5)
+ rspec (3.11.0)
+ rspec-core (~> 3.11.0)
+ rspec-expectations (~> 3.11.0)
+ rspec-mocks (~> 3.11.0)
+ rspec-core (3.11.0)
+ rspec-support (~> 3.11.0)
+ rspec-expectations (3.11.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.11.0)
+ rspec-mocks (3.11.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.11.0)
+ rspec-support (3.11.0)
+ rubocop (0.93.1)
+ parallel (~> 1.10)
+ parser (>= 2.7.1.5)
+ rainbow (>= 2.2.2, < 4.0)
+ regexp_parser (>= 1.8)
+ rexml
+ rubocop-ast (>= 0.6.0)
+ ruby-progressbar (~> 1.7)
+ unicode-display_width (>= 1.4.0, < 2.0)
+ rubocop-ast (1.19.1)
+ parser (>= 3.1.1.0)
+ ruby-progressbar (1.11.0)
+ ruby2_keywords (0.0.5)
+ unicode-display_width (1.8.0)
+ version_gem (1.1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ omniauth-google-oauth2!
+ rake (~> 12.0)
+ rspec (~> 3.6)
+ rubocop (~> 0.49)
+
+BUNDLED WITH
+ 2.3.21
diff --git a/vendor/gems/omniauth-google-oauth2/README.md b/vendor/gems/omniauth-google-oauth2/README.md
new file mode 100644
index 00000000000..80c611392ca
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/README.md
@@ -0,0 +1,368 @@
+[![Gem Version](https://badge.fury.io/rb/omniauth-google-oauth2.svg)](https://badge.fury.io/rb/omniauth-google-oauth2)
+
+# OmniAuth Google OAuth2 Strategy
+
+Strategy to authenticate with Google via OAuth2 in OmniAuth.
+
+Get your API key at: https://code.google.com/apis/console/ Note the Client ID and the Client Secret.
+
+For more details, read the Google docs: https://developers.google.com/accounts/docs/OAuth2
+
+## Installation
+
+Add to your `Gemfile`:
+
+```ruby
+gem 'omniauth-google-oauth2'
+```
+
+Then `bundle install`.
+
+## Google API Setup
+
+* Go to 'https://console.developers.google.com'
+* Select your project.
+* Go to Credentials, then select the "OAuth consent screen" tab on top, and provide an 'EMAIL ADDRESS' and a 'PRODUCT NAME'
+* Wait 10 minutes for changes to take effect.
+
+## Usage
+
+Here's an example for adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
+
+```ruby
+Rails.application.config.middleware.use OmniAuth::Builder do
+ provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET']
+end
+OmniAuth.config.allowed_request_methods = %i[get]
+```
+
+You can now access the OmniAuth Google OAuth2 URL: `/auth/google_oauth2`
+
+For more examples please check out `examples/omni_auth.rb`
+
+NOTE: While developing your application, if you change the scope in the initializer you will need to restart your app server. Remember that either the 'email' or 'profile' scope is required!
+
+## Configuration
+
+You can configure several options, which you pass in to the `provider` method via a hash:
+
+* `scope`: A comma-separated list of permissions you want to request from the user. See the [Google OAuth 2.0 Playground](https://developers.google.com/oauthplayground/) for a full list of available permissions. Caveats:
+ * The `email` and `profile` scopes are used by default. By defining your own `scope`, you override these defaults, but Google requires at least one of `email` or `profile`, so make sure to add at least one of them to your scope!
+ * Scopes starting with `https://www.googleapis.com/auth/` do not need that prefix specified. So while you can use the smaller scope `books` since that permission starts with the mentioned prefix, you should use the full scope URL `https://docs.google.com/feeds/` to access a user's docs, for example.
+
+* `redirect_uri`: Override the redirect_uri used by the gem.
+
+* `prompt`: A space-delimited list of string values that determines whether the user is re-prompted for authentication and/or consent. Possible values are:
+ * `none`: No authentication or consent pages will be displayed; it will return an error if the user is not already authenticated and has not pre-configured consent for the requested scopes. This can be used as a method to check for existing authentication and/or consent.
+ * `consent`: The user will always be prompted for consent, even if they have previously allowed access a given set of scopes.
+ * `select_account`: The user will always be prompted to select a user account. This allows a user who has multiple current account sessions to select one amongst them.
+
+ If no value is specified, the user only sees the authentication page if they are not logged in and only sees the consent page the first time they authorize a given set of scopes.
+
+* `image_aspect_ratio`: The shape of the user's profile picture. Possible values are:
+ * `original`: Picture maintains its original aspect ratio.
+ * `square`: Picture presents equal width and height.
+
+ Defaults to `original`.
+
+* `image_size`: The size of the user's profile picture. The image returned will have width equal to the given value and variable height, according to the `image_aspect_ratio` chosen. Additionally, a picture with specific width and height can be requested by setting this option to a hash with `width` and `height` as keys. If only `width` or `height` is specified, a picture whose width or height is closest to the requested size and requested aspect ratio will be returned. Defaults to the original width and height of the picture.
+
+* `name`: The name of the strategy. The default name is `google_oauth2` but it can be changed to any value, for example `google`. The OmniAuth URL will thus change to `/auth/google` and the `provider` key in the auth hash will then return `google`.
+
+* `access_type`: Defaults to `offline`, so a refresh token is sent to be used when the user is not present at the browser. Can be set to `online`. More about [offline access](https://developers.google.com/identity/protocols/OAuth2WebServer#offline)
+
+* `hd`: (Optional) Limit sign-in to a particular Google Apps hosted domain. This can be simply string `'domain.com'` or an array `%w(domain.com domain.co)`. More information at: https://developers.google.com/accounts/docs/OpenIDConnect#hd-param
+
+* `jwt_leeway`: Number of seconds passed to the JWT library as leeway. Defaults to 60 seconds. Note this only works if you use jwt 2.1, as the leeway option was removed in later versions.
+
+* `skip_jwt`: Skip JWT processing. This is for users who are seeing JWT decoding errors with the `iat` field. Always try adjusting the leeway before disabling JWT processing.
+
+* `login_hint`: When your app knows which user it is trying to authenticate, it can provide this parameter as a hint to the authentication server. Passing this hint suppresses the account chooser and either pre-fill the email box on the sign-in form, or select the proper session (if the user is using multiple sign-in), which can help you avoid problems that occur if your app logs in the wrong user account. The value can be either an email address or the sub string, which is equivalent to the user's Google+ ID.
+
+* `include_granted_scopes`: If this is provided with the value true, and the authorization request is granted, the authorization will include any previous authorizations granted to this user/application combination for other scopes. See Google's [Incremental Authorization](https://developers.google.com/accounts/docs/OAuth2WebServer#incrementalAuth) for additional details.
+
+* `openid_realm`: Set the OpenID realm value, to allow upgrading from OpenID based authentication to OAuth 2 based authentication. When this is set correctly an `openid_id` value will be set in `['extra']['id_info']` in the authentication hash with the value of the user's OpenID ID URL.
+
+* `provider_ignores_state`: You will need to set this to `true` when using the `One-time Code Flow` below. In this flow there is no server side redirect that would set the state.
+
+Here's an example of a possible configuration where the strategy name is changed, the user is asked for extra permissions, the user is always prompted to select their account when logging in and the user's profile picture is returned as a thumbnail:
+
+```ruby
+Rails.application.config.middleware.use OmniAuth::Builder do
+ provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'],
+ {
+ scope: 'userinfo.email, userinfo.profile, http://gdata.youtube.com',
+ prompt: 'select_account',
+ image_aspect_ratio: 'square',
+ image_size: 50
+ }
+end
+```
+
+## Auth Hash
+
+Here's an example of an authentication hash available in the callback by accessing `request.env['omniauth.auth']`:
+
+```ruby
+{
+ "provider" => "google_oauth2",
+ "uid" => "100000000000000000000",
+ "info" => {
+ "name" => "John Smith",
+ "email" => "john@example.com",
+ "first_name" => "John",
+ "last_name" => "Smith",
+ "image" => "https://lh4.googleusercontent.com/photo.jpg",
+ "urls" => {
+ "google" => "https://plus.google.com/+JohnSmith"
+ }
+ },
+ "credentials" => {
+ "token" => "TOKEN",
+ "refresh_token" => "REFRESH_TOKEN",
+ "expires_at" => 1496120719,
+ "expires" => true
+ },
+ "extra" => {
+ "id_token" => "ID_TOKEN",
+ "id_info" => {
+ "azp" => "APP_ID",
+ "aud" => "APP_ID",
+ "sub" => "100000000000000000000",
+ "email" => "john@example.com",
+ "email_verified" => true,
+ "at_hash" => "HK6E_P6Dh8Y93mRNtsDB1Q",
+ "iss" => "accounts.google.com",
+ "iat" => 1496117119,
+ "exp" => 1496120719
+ },
+ "raw_info" => {
+ "sub" => "100000000000000000000",
+ "name" => "John Smith",
+ "given_name" => "John",
+ "family_name" => "Smith",
+ "profile" => "https://plus.google.com/+JohnSmith",
+ "picture" => "https://lh4.googleusercontent.com/photo.jpg?sz=50",
+ "email" => "john@example.com",
+ "email_verified" => "true",
+ "locale" => "en",
+ "hd" => "company.com"
+ }
+ }
+}
+```
+
+### Devise
+
+First define your application id and secret in `config/initializers/devise.rb`. Do not use the snippet mentioned in the [Usage](https://github.com/zquestz/omniauth-google-oauth2#usage) section.
+
+Configuration options can be passed as the last parameter here as key/value pairs.
+
+```ruby
+config.omniauth :google_oauth2, 'GOOGLE_CLIENT_ID', 'GOOGLE_CLIENT_SECRET', {}
+```
+NOTE: If you are using this gem with devise with above snippet in `config/initializers/devise.rb` then do not create `config/initializers/omniauth.rb` which will conflict with devise configurations.
+
+Then add the following to 'config/routes.rb' so the callback routes are defined.
+
+```ruby
+devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
+```
+
+Make sure your model is omniauthable. Generally this is "/app/models/user.rb"
+
+```ruby
+devise :omniauthable, omniauth_providers: [:google_oauth2]
+```
+
+Then make sure your callbacks controller is setup.
+
+```ruby
+# app/controllers/users/omniauth_callbacks_controller.rb:
+
+class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
+ def google_oauth2
+ # You need to implement the method below in your model (e.g. app/models/user.rb)
+ @user = User.from_omniauth(request.env['omniauth.auth'])
+
+ if @user.persisted?
+ flash[:notice] = I18n.t 'devise.omniauth_callbacks.success', kind: 'Google'
+ sign_in_and_redirect @user, event: :authentication
+ else
+ session['devise.google_data'] = request.env['omniauth.auth'].except('extra') # Removing extra as it can overflow some session stores
+ redirect_to new_user_registration_url, alert: @user.errors.full_messages.join("\n")
+ end
+ end
+end
+```
+
+and bind to or create the user
+
+```ruby
+def self.from_omniauth(access_token)
+ data = access_token.info
+ user = User.where(email: data['email']).first
+
+ # Uncomment the section below if you want users to be created if they don't exist
+ # unless user
+ # user = User.create(name: data['name'],
+ # email: data['email'],
+ # password: Devise.friendly_token[0,20]
+ # )
+ # end
+ user
+end
+```
+
+For your views you can login using:
+
+```erb
+<%# omniauth-google-oauth2 1.0.x uses OmniAuth 2 and requires using HTTP Post to initiate authentication: %>
+<%= link_to "Sign in with Google", user_google_oauth2_omniauth_authorize_path, method: :post %>
+
+<%# omniauth-google-oauth2 prior 1.0.0: %>
+<%= link_to "Sign in with Google", user_google_oauth2_omniauth_authorize_path %>
+
+<%# Devise prior 4.1.0: %>
+<%= link_to "Sign in with Google", user_omniauth_authorize_path(:google_oauth2) %>
+```
+
+An overview is available at https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
+
+### One-time Code Flow (Hybrid Authentication)
+
+Google describes the One-time Code Flow [here](https://developers.google.com/identity/sign-in/web/server-side-flow). This hybrid authentication flow has significant functional and security advantages over a pure server-side or pure client-side flow. The following steps occur in this flow:
+
+1. The client (web browser) authenticates the user directly via Google's JS API. During this process assorted modals may be rendered by Google.
+2. On successful authentication, Google returns a one-time use code, which requires the Google client secret (which is only available server-side).
+3. Using a AJAX request, the code is POSTed to the Omniauth Google OAuth2 callback.
+4. The Omniauth Google OAuth2 gem will validate the code via a server-side request to Google. If the code is valid, then Google will return an access token and, if this is the first time this user is authenticating against this application, a refresh token. Both of these should be stored on the server. The response to the AJAX request indicates the success or failure of this process.
+
+This flow is immune to replay attacks, and conveys no useful information to a man in the middle.
+
+The omniauth-google-oauth2 gem supports this mode of operation when `provider_ignores_state` is set to `true`. Implementors simply need to add the appropriate JavaScript to their web page, and they can take advantage of this flow. An example JavaScript snippet follows.
+
+```javascript
+// Basic hybrid auth example following the pattern at:
+// https://developers.google.com/identity/sign-in/web/reference
+
+<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
+
+...
+
+function init() {
+ gapi.load('auth2', function() {
+ // Ready.
+ $('.google-login-button').click(function(e) {
+ e.preventDefault();
+
+ gapi.auth2.authorize({
+ client_id: 'YOUR_CLIENT_ID',
+ cookie_policy: 'single_host_origin',
+ scope: 'email profile',
+ response_type: 'code'
+ }, function(response) {
+ if (response && !response.error) {
+ // google authentication succeed, now post data to server.
+ jQuery.ajax({type: 'POST', url: '/auth/google_oauth2/callback', data: response,
+ success: function(data) {
+ // response from server
+ }
+ });
+ } else {
+ // google authentication failed
+ }
+ });
+ });
+ });
+};
+```
+
+#### Note about mobile clients (iOS, Android)
+
+The documentation at https://developers.google.com/identity/sign-in/ios/offline-access specifies the _REDIRECT_URI_ to be either a set value or an EMPTY string for mobile logins to work. Else, you will run into _redirect_uri_mismatch_ errors.
+
+In that case, ensure to send an additional parameter `redirect_uri=` (empty string) to the `/auth/google_oauth2/callback` URL from your mobile device.
+
+#### Note about CORS
+
+If you're making POST requests to `/auth/google_oauth2/callback` from another domain, then you need to make sure `'X-Requested-With': 'XMLHttpRequest'` header is included with your request, otherwise your server might respond with `OAuth2::Error, : Invalid Value` error.
+
+#### Getting around the `redirect_uri_mismatch` error (See [Issue #365](https://github.com/zquestz/omniauth-google-oauth2/issues/365))
+
+If you are struggling with a persistent `redirect_uri_mismatch`, you can instead pass the `access_token` from [`getAuthResponse`](https://developers.google.com/identity/sign-in/web/reference#googleusergetauthresponseincludeauthorizationdata) directly to the `auth/google_oauth2/callback` endpoint, like so:
+
+```javascript
+// Initialize the GoogleAuth object
+let googleAuth;
+gapi.load('client:auth2', async () => {
+ await gapi.client.init({ scope: '...', client_id: '...' });
+ googleAuth = gapi.auth2.getAuthInstance();
+});
+
+// Call this when the Google Sign In button is clicked
+async function signInGoogle() {
+ const googleUser = await googleAuth.signIn(); // wait for the user to authorize through the modal
+ const { access_token } = googleUser.getAuthResponse();
+
+ const data = new FormData();
+ data.append('access_token', access_token);
+
+ const response = await api.post('/auth/google_oauth2/callback', data)
+ console.log(response);
+}
+```
+
+#### Using Axios
+If you're making a GET resquests from another domain using `access_token`.
+```
+axios
+ .get(
+ 'url(path to your callback}',
+ { params: { access_token: 'token' } },
+ headers....
+ )
+```
+
+If you're making a POST resquests from another domain using `access_token`.
+```
+axios
+ .post(
+ 'url(path to your callback}',
+ { access_token: 'token' },
+ headers....
+ )
+
+--OR--
+
+axios
+ .post(
+ 'url(path to your callback}',
+ null,
+ {
+ params: {
+ access_token: 'token'
+ },
+ headers....
+ }
+ )
+```
+
+## Fixing Protocol Mismatch for `redirect_uri` in Rails
+
+Just set the `full_host` in OmniAuth based on the Rails.env.
+
+```
+# config/initializers/omniauth.rb
+OmniAuth.config.full_host = Rails.env.production? ? 'https://domain.com' : 'http://localhost:3000'
+```
+
+## License
+
+Copyright (c) 2018 by Josh Ellithorpe
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/gems/omniauth-google-oauth2/Rakefile b/vendor/gems/omniauth-google-oauth2/Rakefile
new file mode 100644
index 00000000000..db36369bc12
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/Rakefile
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+require File.join('bundler', 'gem_tasks')
+require File.join('rspec', 'core', 'rake_task')
+
+RSpec::Core::RakeTask.new(:spec)
+
+task default: :spec
diff --git a/vendor/gems/omniauth-google-oauth2/examples/Gemfile b/vendor/gems/omniauth-google-oauth2/examples/Gemfile
new file mode 100644
index 00000000000..ba019344a67
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/examples/Gemfile
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+source 'https://rubygems.org'
+
+gem 'omniauth-google-oauth2', '~> 0.8.1'
+gem 'rubocop'
+gem 'sinatra', '~> 1.4'
+gem 'webrick'
diff --git a/vendor/gems/omniauth-google-oauth2/examples/config.ru b/vendor/gems/omniauth-google-oauth2/examples/config.ru
new file mode 100644
index 00000000000..ee17929094c
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/examples/config.ru
@@ -0,0 +1,120 @@
+# frozen_string_literal: true
+
+# Sample app for Google OAuth2 Strategy
+# Make sure to setup the ENV variables GOOGLE_KEY and GOOGLE_SECRET
+# Run with "bundle exec rackup"
+
+require 'rubygems'
+require 'bundler'
+require 'sinatra'
+require 'omniauth'
+require 'omniauth-google-oauth2'
+
+# Do not use for production code.
+# This is only to make setup easier when running through the sample.
+#
+# If you do have issues with certs in production code, this could help:
+# http://railsapps.github.io/openssl-certificate-verify-failed.html
+OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
+
+# Main example app for omniauth-google-oauth2
+class App < Sinatra::Base
+ get '/' do
+ <<-HTML
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Google OAuth2 Example</title>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
+ <script>
+ jQuery(function() {
+ return $.ajax({
+ url: 'https://apis.google.com/js/client:plus.js?onload=gpAsyncInit',
+ dataType: 'script',
+ cache: true
+ });
+ });
+
+ window.gpAsyncInit = function() {
+ gapi.auth.authorize({
+ immediate: true,
+ response_type: 'code',
+ cookie_policy: 'single_host_origin',
+ client_id: '#{ENV['GOOGLE_KEY']}',
+ scope: 'email profile'
+ }, function(response) {
+ return;
+ });
+ $('.googleplus-login').click(function(e) {
+ e.preventDefault();
+ gapi.auth.authorize({
+ immediate: false,
+ response_type: 'code',
+ cookie_policy: 'single_host_origin',
+ client_id: '#{ENV['GOOGLE_KEY']}',
+ scope: 'email profile'
+ }, function(response) {
+ if (response && !response.error) {
+ // google authentication succeed, now post data to server.
+ jQuery.ajax({type: 'POST', url: "/auth/google_oauth2/callback", data: response,
+ success: function(data) {
+ // Log the data returning from google.
+ console.log(data)
+ }
+ });
+ } else {
+ // google authentication failed.
+ console.log("FAILED")
+ }
+ });
+ });
+ };
+ </script>
+ </head>
+ <body>
+ <ul>
+ <li><a href='/auth/google_oauth2'>Sign in with Google</a></li>
+ <li><a href='#' class="googleplus-login">Sign in with Google via AJAX</a></li>
+ </ul>
+ </body>
+ </html>
+ HTML
+ end
+
+ post '/auth/:provider/callback' do
+ content_type 'text/plain'
+ begin
+ request.env['omniauth.auth'].to_hash.inspect
+ rescue StandardError
+ 'No Data'
+ end
+ end
+
+ get '/auth/:provider/callback' do
+ content_type 'text/plain'
+ begin
+ request.env['omniauth.auth'].to_hash.inspect
+ rescue StandardError
+ 'No Data'
+ end
+ end
+
+ get '/auth/failure' do
+ content_type 'text/plain'
+ begin
+ request.env['omniauth.auth'].to_hash.inspect
+ rescue StandardError
+ 'No Data'
+ end
+ end
+end
+
+use Rack::Session::Cookie, secret: ENV['RACK_COOKIE_SECRET']
+
+use OmniAuth::Builder do
+ # For additional provider examples please look at 'omni_auth.rb'
+ # The key provider_ignores_state is only for AJAX flows. It is not recommended for normal logins.
+ provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], access_type: 'offline', prompt: 'consent', provider_ignores_state: true, scope: 'email,profile,calendar'
+end
+
+run App.new
diff --git a/vendor/gems/omniauth-google-oauth2/examples/omni_auth.rb b/vendor/gems/omniauth-google-oauth2/examples/omni_auth.rb
new file mode 100644
index 00000000000..0a94164d766
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/examples/omni_auth.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+# Google's OAuth2 docs. Make sure you are familiar with all the options
+# before attempting to configure this gem.
+# https://developers.google.com/accounts/docs/OAuth2Login
+
+Rails.application.config.middleware.use OmniAuth::Builder do
+ # Default usage, this will give you offline access and a refresh token
+ # using default scopes 'email' and 'profile'
+ #
+ provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], scope: 'email,profile'
+
+ # Custom redirect_uri
+ #
+ # provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], scope: 'email,profile', redirect_uri: 'https://localhost:3000/redirect'
+
+ # Manual setup for offline access with a refresh token.
+ #
+ # provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], access_type: 'offline'
+
+ # Custom scope supporting youtube. If you are customizing scopes, remember
+ # to include the default scopes 'email' and 'profile'
+ #
+ # provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], scope: 'http://gdata.youtube.com,email,profile,plus.me'
+
+ # Custom scope for users only using Google for account creation/auth and do not require a refresh token.
+ #
+ # provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], access_type: 'online', prompt: ''
+
+ # To include information about people in your circles you must include the 'plus.login' scope.
+ #
+ # provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], skip_friends: false, scope: 'email,profile,plus.login'
+
+ # If you need to acquire whether user picture is a default one or uploaded by user.
+ #
+ # provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], skip_image_info: false
+end
diff --git a/vendor/gems/omniauth-google-oauth2/lib/omniauth-google-oauth2.rb b/vendor/gems/omniauth-google-oauth2/lib/omniauth-google-oauth2.rb
new file mode 100644
index 00000000000..a5cc57ab4c9
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/lib/omniauth-google-oauth2.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+require 'omniauth/google_oauth2'
diff --git a/vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2.rb b/vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2.rb
new file mode 100644
index 00000000000..594c9a4eed9
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+require 'omniauth/strategies/google_oauth2'
diff --git a/vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2/version.rb b/vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2/version.rb
new file mode 100644
index 00000000000..93ae5e9e990
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/lib/omniauth/google_oauth2/version.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module OmniAuth
+ module GoogleOauth2
+ VERSION = '1.0.1'
+ end
+end
diff --git a/vendor/gems/omniauth-google-oauth2/lib/omniauth/strategies/google_oauth2.rb b/vendor/gems/omniauth-google-oauth2/lib/omniauth/strategies/google_oauth2.rb
new file mode 100644
index 00000000000..4ce32eb80d1
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/lib/omniauth/strategies/google_oauth2.rb
@@ -0,0 +1,254 @@
+# frozen_string_literal: true
+
+require 'jwt'
+require 'oauth2'
+require 'omniauth/strategies/oauth2'
+require 'uri'
+
+module OmniAuth
+ module Strategies
+ # Main class for Google OAuth2 strategy.
+ class GoogleOauth2 < OmniAuth::Strategies::OAuth2
+ ALLOWED_ISSUERS = ['accounts.google.com', 'https://accounts.google.com'].freeze
+ BASE_SCOPE_URL = 'https://www.googleapis.com/auth/'
+ BASE_SCOPES = %w[profile email openid].freeze
+ DEFAULT_SCOPE = 'email,profile'
+ USER_INFO_URL = 'https://www.googleapis.com/oauth2/v3/userinfo'
+ IMAGE_SIZE_REGEXP = /(s\d+(-c)?)|(w\d+-h\d+(-c)?)|(w\d+(-c)?)|(h\d+(-c)?)|c/
+
+ option :name, 'google_oauth2'
+ option :skip_friends, true
+ option :skip_image_info, true
+ option :skip_jwt, false
+ option :jwt_leeway, 60
+ option :authorize_options, %i[access_type hd login_hint prompt request_visible_actions scope state redirect_uri include_granted_scopes openid_realm device_id device_name]
+ option :authorized_client_ids, []
+
+ option :client_options,
+ site: 'https://oauth2.googleapis.com',
+ authorize_url: 'https://accounts.google.com/o/oauth2/auth',
+ token_url: '/token'
+
+ def authorize_params
+ super.tap do |params|
+ options[:authorize_options].each do |k|
+ params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])
+ end
+
+ params[:scope] = get_scope(params)
+ params[:access_type] = 'offline' if params[:access_type].nil?
+ params['openid.realm'] = params.delete(:openid_realm) unless params[:openid_realm].nil?
+
+ session['omniauth.state'] = params[:state] if params[:state]
+ end
+ end
+
+ uid { raw_info['sub'] }
+
+ info do
+ prune!(
+ name: raw_info['name'],
+ email: verified_email,
+ unverified_email: raw_info['email'],
+ email_verified: raw_info['email_verified'],
+ first_name: raw_info['given_name'],
+ last_name: raw_info['family_name'],
+ image: image_url,
+ urls: {
+ google: raw_info['profile']
+ }
+ )
+ end
+
+ credentials do
+ # Tokens and expiration will be used from OAuth2 strategy credentials block
+ prune!({ 'scope' => token_info(access_token.token)['scope'] })
+ end
+
+ extra do
+ hash = {}
+ hash[:id_token] = access_token['id_token']
+ if !options[:skip_jwt] && !access_token['id_token'].nil?
+ decoded = ::JWT.decode(access_token['id_token'], nil, false).first
+
+ # We have to manually verify the claims because the third parameter to
+ # JWT.decode is false since no verification key is provided.
+ ::JWT::Verify.verify_claims(decoded,
+ verify_iss: true,
+ iss: ALLOWED_ISSUERS,
+ verify_aud: true,
+ aud: options.client_id,
+ verify_sub: false,
+ verify_expiration: true,
+ verify_not_before: true,
+ verify_iat: false,
+ verify_jti: false,
+ leeway: options[:jwt_leeway])
+
+ hash[:id_info] = decoded
+ end
+ hash[:raw_info] = raw_info unless skip_info?
+ prune! hash
+ end
+
+ def raw_info
+ @raw_info ||= access_token.get(USER_INFO_URL).parsed
+ end
+
+ def custom_build_access_token
+ access_token = get_access_token(request)
+
+ verify_hd(access_token)
+ access_token
+ end
+
+ alias build_access_token custom_build_access_token
+
+ private
+
+ def callback_url
+ options[:redirect_uri] || (full_host + callback_path)
+ end
+
+ def get_access_token(request)
+ verifier = request.params['code']
+ redirect_uri = request.params['redirect_uri']
+ access_token = request.params['access_token']
+ if verifier && request.xhr?
+ client_get_token(verifier, redirect_uri || 'postmessage')
+ elsif verifier
+ client_get_token(verifier, redirect_uri || callback_url)
+ elsif access_token && verify_token(access_token)
+ ::OAuth2::AccessToken.from_hash(client, request.params.dup)
+ elsif request.content_type =~ /json/i
+ begin
+ body = JSON.parse(request.body.read)
+ request.body.rewind # rewind request body for downstream middlewares
+ verifier = body && body['code']
+ access_token = body && body['access_token']
+ redirect_uri ||= body && body['redirect_uri']
+ if verifier
+ client_get_token(verifier, redirect_uri || 'postmessage')
+ elsif verify_token(access_token)
+ ::OAuth2::AccessToken.from_hash(client, body.dup)
+ end
+ rescue JSON::ParserError => e
+ warn "[omniauth google-oauth2] JSON parse error=#{e}"
+ end
+ end
+ end
+
+ def client_get_token(verifier, redirect_uri)
+ client.auth_code.get_token(verifier, get_token_options(redirect_uri), get_token_params)
+ end
+
+ def get_token_params
+ deep_symbolize(options.auth_token_params || {})
+ end
+
+ def get_scope(params)
+ raw_scope = params[:scope] || DEFAULT_SCOPE
+ scope_list = raw_scope.split(' ').map { |item| item.split(',') }.flatten
+ scope_list.map! { |s| s =~ %r{^https?://} || BASE_SCOPES.include?(s) ? s : "#{BASE_SCOPE_URL}#{s}" }
+ scope_list.join(' ')
+ end
+
+ def verified_email
+ raw_info['email_verified'] ? raw_info['email'] : nil
+ end
+
+ def get_token_options(redirect_uri = '')
+ { redirect_uri: redirect_uri }.merge(token_params.to_hash(symbolize_keys: true))
+ end
+
+ def prune!(hash)
+ hash.delete_if do |_, v|
+ prune!(v) if v.is_a?(Hash)
+ v.nil? || (v.respond_to?(:empty?) && v.empty?)
+ end
+ end
+
+ def image_url
+ return nil unless raw_info['picture']
+
+ u = URI.parse(raw_info['picture'].gsub('https:https', 'https'))
+
+ path_index = u.path.to_s.index('/photo.jpg')
+
+ if path_index && image_size_opts_passed?
+ u.path.insert(path_index, image_params)
+ u.path = u.path.gsub('//', '/')
+
+ # Check if the image is already sized!
+ split_path = u.path.split('/')
+ u.path = u.path.sub("/#{split_path[-3]}", '') if split_path[-3] =~ IMAGE_SIZE_REGEXP
+ end
+
+ u.query = strip_unnecessary_query_parameters(u.query)
+
+ u.to_s
+ end
+
+ def image_size_opts_passed?
+ options[:image_size] || options[:image_aspect_ratio]
+ end
+
+ def image_params
+ image_params = []
+ if options[:image_size].is_a?(Integer)
+ image_params << "s#{options[:image_size]}"
+ elsif options[:image_size].is_a?(Hash)
+ image_params << "w#{options[:image_size][:width]}" if options[:image_size][:width]
+ image_params << "h#{options[:image_size][:height]}" if options[:image_size][:height]
+ end
+ image_params << 'c' if options[:image_aspect_ratio] == 'square'
+
+ '/' + image_params.join('-')
+ end
+
+ def strip_unnecessary_query_parameters(query_parameters)
+ # strip `sz` parameter (defaults to sz=50) which overrides `image_size` options
+ return nil if query_parameters.nil?
+
+ params = CGI.parse(query_parameters)
+ stripped_params = params.delete_if { |key| key == 'sz' }
+
+ # don't return an empty Hash since that would result
+ # in URLs with a trailing ? character: http://image.url?
+ return nil if stripped_params.empty?
+
+ URI.encode_www_form(stripped_params)
+ end
+
+ def token_info(access_token)
+ return nil unless access_token
+
+ @token_info ||= Hash.new do |h, k|
+ h[k] = client.request(:get, 'https://www.googleapis.com/oauth2/v3/tokeninfo', params: { access_token: access_token }).parsed
+ end
+
+ @token_info[access_token]
+ end
+
+ def verify_token(access_token)
+ return false unless access_token
+
+ token_info = token_info(access_token)
+ token_info['aud'] == options.client_id || options.authorized_client_ids.include?(token_info['aud'])
+ end
+
+ def verify_hd(access_token)
+ return true unless options.hd
+
+ @raw_info ||= access_token.get(USER_INFO_URL).parsed
+
+ options.hd = options.hd.call if options.hd.is_a? Proc
+ allowed_hosted_domains = Array(options.hd)
+
+ raise CallbackError.new(:invalid_hd, 'Invalid Hosted Domain') unless allowed_hosted_domains.include?(@raw_info['hd']) || options.hd == '*'
+
+ true
+ end
+ end
+ end
+end
diff --git a/vendor/gems/omniauth-google-oauth2/omniauth-google-oauth2.gemspec b/vendor/gems/omniauth-google-oauth2/omniauth-google-oauth2.gemspec
new file mode 100644
index 00000000000..a50d67bc9a0
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/omniauth-google-oauth2.gemspec
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require File.expand_path(
+ File.join('..', 'lib', 'omniauth', 'google_oauth2', 'version'),
+ __FILE__
+)
+
+Gem::Specification.new do |gem|
+ gem.name = 'omniauth-google-oauth2'
+ gem.version = OmniAuth::GoogleOauth2::VERSION
+ gem.license = 'MIT'
+ gem.summary = %(A Google OAuth2 strategy for OmniAuth 1.x)
+ gem.description = %(A Google OAuth2 strategy for OmniAuth 1.x. This allows you to login to Google with your ruby app.)
+ gem.authors = ['Josh Ellithorpe', 'Yury Korolev']
+ gem.email = ['quest@mac.com']
+ gem.homepage = 'https://github.com/zquestz/omniauth-google-oauth2'
+
+ gem.files = Dir.glob("lib/**/*.*")
+ gem.require_paths = ['lib']
+
+ gem.required_ruby_version = '>= 2.2'
+
+ gem.add_runtime_dependency 'jwt', '>= 2.0'
+ gem.add_runtime_dependency 'oauth2', '~> 2.0'
+ gem.add_runtime_dependency 'omniauth', '~> 2.0'
+ gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.7.1'
+
+ gem.add_development_dependency 'rake', '~> 12.0'
+ gem.add_development_dependency 'rspec', '~> 3.6'
+ gem.add_development_dependency 'rubocop', '~> 0.49'
+end
diff --git a/vendor/gems/omniauth-google-oauth2/spec/omniauth/strategies/google_oauth2_spec.rb b/vendor/gems/omniauth-google-oauth2/spec/omniauth/strategies/google_oauth2_spec.rb
new file mode 100644
index 00000000000..3a2bcf07e54
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/spec/omniauth/strategies/google_oauth2_spec.rb
@@ -0,0 +1,850 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require 'json'
+require 'omniauth-google-oauth2'
+require 'stringio'
+
+describe OmniAuth::Strategies::GoogleOauth2 do
+ let(:request) { double('Request', params: {}, cookies: {}, env: {}) }
+ let(:app) do
+ lambda do
+ [200, {}, ['Hello.']]
+ end
+ end
+
+ subject do
+ OmniAuth::Strategies::GoogleOauth2.new(app, 'appid', 'secret', @options || {}).tap do |strategy|
+ allow(strategy).to receive(:request) do
+ request
+ end
+ end
+ end
+
+ before do
+ OmniAuth.config.test_mode = true
+ end
+
+ after do
+ OmniAuth.config.test_mode = false
+ end
+
+ describe '#client_options' do
+ it 'has correct site' do
+ expect(subject.client.site).to eq('https://oauth2.googleapis.com')
+ end
+
+ it 'has correct authorize_url' do
+ expect(subject.client.options[:authorize_url]).to eq('https://accounts.google.com/o/oauth2/auth')
+ end
+
+ it 'has correct token_url' do
+ expect(subject.client.options[:token_url]).to eq('/token')
+ end
+
+ describe 'overrides' do
+ context 'as strings' do
+ it 'should allow overriding the site' do
+ @options = { client_options: { 'site' => 'https://example.com' } }
+ expect(subject.client.site).to eq('https://example.com')
+ end
+
+ it 'should allow overriding the authorize_url' do
+ @options = { client_options: { 'authorize_url' => 'https://example.com' } }
+ expect(subject.client.options[:authorize_url]).to eq('https://example.com')
+ end
+
+ it 'should allow overriding the token_url' do
+ @options = { client_options: { 'token_url' => 'https://example.com' } }
+ expect(subject.client.options[:token_url]).to eq('https://example.com')
+ end
+ end
+
+ context 'as symbols' do
+ it 'should allow overriding the site' do
+ @options = { client_options: { site: 'https://example.com' } }
+ expect(subject.client.site).to eq('https://example.com')
+ end
+
+ it 'should allow overriding the authorize_url' do
+ @options = { client_options: { authorize_url: 'https://example.com' } }
+ expect(subject.client.options[:authorize_url]).to eq('https://example.com')
+ end
+
+ it 'should allow overriding the token_url' do
+ @options = { client_options: { token_url: 'https://example.com' } }
+ expect(subject.client.options[:token_url]).to eq('https://example.com')
+ end
+ end
+ end
+ end
+
+ describe '#authorize_options' do
+ %i[access_type hd login_hint prompt scope state device_id device_name].each do |k|
+ it "should support #{k}" do
+ @options = { k => 'http://someval' }
+ expect(subject.authorize_params[k.to_s]).to eq('http://someval')
+ end
+ end
+
+ describe 'redirect_uri' do
+ it 'should default to nil' do
+ @options = {}
+ expect(subject.authorize_params['redirect_uri']).to eq(nil)
+ end
+
+ it 'should set the redirect_uri parameter if present' do
+ @options = { redirect_uri: 'https://example.com' }
+ expect(subject.authorize_params['redirect_uri']).to eq('https://example.com')
+ end
+ end
+
+ describe 'access_type' do
+ it 'should default to "offline"' do
+ @options = {}
+ expect(subject.authorize_params['access_type']).to eq('offline')
+ end
+
+ it 'should set the access_type parameter if present' do
+ @options = { access_type: 'online' }
+ expect(subject.authorize_params['access_type']).to eq('online')
+ end
+ end
+
+ describe 'hd' do
+ it 'should default to nil' do
+ expect(subject.authorize_params['hd']).to eq(nil)
+ end
+
+ it 'should set the hd (hosted domain) parameter if present' do
+ @options = { hd: 'example.com' }
+ expect(subject.authorize_params['hd']).to eq('example.com')
+ end
+
+ it 'should set the hd parameter and work with nil hd (gmail)' do
+ @options = { hd: nil }
+ expect(subject.authorize_params['hd']).to eq(nil)
+ end
+
+ it 'should set the hd parameter to * if set (only allows G Suite emails)' do
+ @options = { hd: '*' }
+ expect(subject.authorize_params['hd']).to eq('*')
+ end
+ end
+
+ describe 'login_hint' do
+ it 'should default to nil' do
+ expect(subject.authorize_params['login_hint']).to eq(nil)
+ end
+
+ it 'should set the login_hint parameter if present' do
+ @options = { login_hint: 'john@example.com' }
+ expect(subject.authorize_params['login_hint']).to eq('john@example.com')
+ end
+ end
+
+ describe 'prompt' do
+ it 'should default to nil' do
+ expect(subject.authorize_params['prompt']).to eq(nil)
+ end
+
+ it 'should set the prompt parameter if present' do
+ @options = { prompt: 'consent select_account' }
+ expect(subject.authorize_params['prompt']).to eq('consent select_account')
+ end
+ end
+
+ describe 'request_visible_actions' do
+ it 'should default to nil' do
+ expect(subject.authorize_params['request_visible_actions']).to eq(nil)
+ end
+
+ it 'should set the request_visible_actions parameter if present' do
+ @options = { request_visible_actions: 'something' }
+ expect(subject.authorize_params['request_visible_actions']).to eq('something')
+ end
+ end
+
+ describe 'include_granted_scopes' do
+ it 'should default to nil' do
+ expect(subject.authorize_params['include_granted_scopes']).to eq(nil)
+ end
+
+ it 'should set the include_granted_scopes parameter if present' do
+ @options = { include_granted_scopes: 'true' }
+ expect(subject.authorize_params['include_granted_scopes']).to eq('true')
+ end
+ end
+
+ describe 'scope' do
+ it 'should expand scope shortcuts' do
+ @options = { scope: 'calendar' }
+ expect(subject.authorize_params['scope']).to eq('https://www.googleapis.com/auth/calendar')
+ end
+
+ it 'should leave base scopes as is' do
+ @options = { scope: 'profile' }
+ expect(subject.authorize_params['scope']).to eq('profile')
+ end
+
+ it 'should join scopes' do
+ @options = { scope: 'profile,email' }
+ expect(subject.authorize_params['scope']).to eq('profile email')
+ end
+
+ it 'should deal with whitespace when joining scopes' do
+ @options = { scope: 'profile, email' }
+ expect(subject.authorize_params['scope']).to eq('profile email')
+ end
+
+ it 'should set default scope to email,profile' do
+ expect(subject.authorize_params['scope']).to eq('email profile')
+ end
+
+ it 'should support space delimited scopes' do
+ @options = { scope: 'profile email' }
+ expect(subject.authorize_params['scope']).to eq('profile email')
+ end
+
+ it 'should support extremely badly formed scopes' do
+ @options = { scope: 'profile email,foo,steve yeah http://example.com' }
+ expect(subject.authorize_params['scope']).to eq('profile email https://www.googleapis.com/auth/foo https://www.googleapis.com/auth/steve https://www.googleapis.com/auth/yeah http://example.com')
+ end
+ end
+
+ describe 'state' do
+ it 'should set the state parameter' do
+ @options = { state: 'some_state' }
+ expect(subject.authorize_params['state']).to eq('some_state')
+ expect(subject.authorize_params[:state]).to eq('some_state')
+ expect(subject.session['omniauth.state']).to eq('some_state')
+ end
+
+ it 'should set the omniauth.state dynamically' do
+ allow(subject).to receive(:request) { double('Request', params: { 'state' => 'some_state' }, env: {}) }
+ expect(subject.authorize_params['state']).to eq('some_state')
+ expect(subject.authorize_params[:state]).to eq('some_state')
+ expect(subject.session['omniauth.state']).to eq('some_state')
+ end
+ end
+
+ describe 'overrides' do
+ it 'should include top-level options that are marked as :authorize_options' do
+ @options = { authorize_options: %i[scope foo request_visible_actions], scope: 'http://bar', foo: 'baz', hd: 'wow', request_visible_actions: 'something' }
+ expect(subject.authorize_params['scope']).to eq('http://bar')
+ expect(subject.authorize_params['foo']).to eq('baz')
+ expect(subject.authorize_params['hd']).to eq(nil)
+ expect(subject.authorize_params['request_visible_actions']).to eq('something')
+ end
+
+ describe 'request overrides' do
+ %i[access_type hd login_hint prompt scope state].each do |k|
+ context "authorize option #{k}" do
+ let(:request) { double('Request', params: { k.to_s => 'http://example.com' }, cookies: {}, env: {}) }
+
+ it "should set the #{k} authorize option dynamically in the request" do
+ @options = { k: '' }
+ expect(subject.authorize_params[k.to_s]).to eq('http://example.com')
+ end
+ end
+ end
+
+ describe 'custom authorize_options' do
+ let(:request) { double('Request', params: { 'foo' => 'something' }, cookies: {}, env: {}) }
+
+ it 'should support request overrides from custom authorize_options' do
+ @options = { authorize_options: [:foo], foo: '' }
+ expect(subject.authorize_params['foo']).to eq('something')
+ end
+ end
+ end
+ end
+ end
+
+ describe '#authorize_params' do
+ it 'should include any authorize params passed in the :authorize_params option' do
+ @options = { authorize_params: { request_visible_actions: 'something', foo: 'bar', baz: 'zip' }, hd: 'wow', bad: 'not_included' }
+ expect(subject.authorize_params['request_visible_actions']).to eq('something')
+ expect(subject.authorize_params['foo']).to eq('bar')
+ expect(subject.authorize_params['baz']).to eq('zip')
+ expect(subject.authorize_params['hd']).to eq('wow')
+ expect(subject.authorize_params['bad']).to eq(nil)
+ end
+ end
+
+ describe '#token_params' do
+ it 'should include any token params passed in the :token_params option' do
+ @options = { token_params: { foo: 'bar', baz: 'zip' } }
+ expect(subject.token_params['foo']).to eq('bar')
+ expect(subject.token_params['baz']).to eq('zip')
+ end
+ end
+
+ describe '#token_options' do
+ it 'should include top-level options that are marked as :token_options' do
+ @options = { token_options: %i[scope foo], scope: 'bar', foo: 'baz', bad: 'not_included' }
+ expect(subject.token_params['scope']).to eq('bar')
+ expect(subject.token_params['foo']).to eq('baz')
+ expect(subject.token_params['bad']).to eq(nil)
+ end
+ end
+
+ describe '#callback_url' do
+ let(:base_url) { 'https://example.com' }
+
+ it 'has the correct default callback path' do
+ allow(subject).to receive(:full_host) { base_url }
+ allow(subject).to receive(:script_name) { '' }
+ expect(subject.send(:callback_url)).to eq(base_url + '/auth/google_oauth2/callback')
+ end
+
+ it 'should set the callback path with script_name if present' do
+ allow(subject).to receive(:full_host) { base_url }
+ allow(subject).to receive(:script_name) { '/v1' }
+ expect(subject.send(:callback_url)).to eq(base_url + '/v1/auth/google_oauth2/callback')
+ end
+
+ it 'should set the callback_path parameter if present' do
+ @options = { callback_path: '/auth/foo/callback' }
+ allow(subject).to receive(:full_host) { base_url }
+ allow(subject).to receive(:script_name) { '' }
+ expect(subject.send(:callback_url)).to eq(base_url + '/auth/foo/callback')
+ end
+ end
+
+ describe '#info' do
+ let(:client) do
+ OAuth2::Client.new('abc', 'def') do |builder|
+ builder.request :url_encoded
+ builder.adapter :test do |stub|
+ stub.get('/oauth2/v3/userinfo') { [200, { 'content-type' => 'application/json' }, response_hash.to_json] }
+ end
+ end
+ end
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, {}) }
+ before { allow(subject).to receive(:access_token).and_return(access_token) }
+
+ context 'with verified email' do
+ let(:response_hash) do
+ { email: 'something@domain.invalid', email_verified: true }
+ end
+
+ it 'should return equal email and unverified_email' do
+ expect(subject.info[:email]).to eq('something@domain.invalid')
+ expect(subject.info[:unverified_email]).to eq('something@domain.invalid')
+ end
+ end
+
+ context 'with unverified email' do
+ let(:response_hash) do
+ { email: 'something@domain.invalid', email_verified: false }
+ end
+
+ it 'should return nil email, and correct unverified email' do
+ expect(subject.info[:email]).to eq(nil)
+ expect(subject.info[:unverified_email]).to eq('something@domain.invalid')
+ end
+ end
+ end
+
+ describe '#credentials' do
+ let(:client) { OAuth2::Client.new('abc', 'def') }
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, access_token: 'valid_access_token', expires_at: 123_456_789, refresh_token: 'valid_refresh_token') }
+ before(:each) do
+ allow(subject).to receive(:access_token).and_return(access_token)
+ subject.options.client_options[:connection_build] = proc do |builder|
+ builder.request :url_encoded
+ builder.adapter :test do |stub|
+ stub.get('/oauth2/v3/tokeninfo?access_token=valid_access_token') do
+ [200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
+ aud: '000000000000.apps.googleusercontent.com',
+ sub: '123456789',
+ scope: 'profile email'
+ )]
+ end
+ end
+ end
+ end
+
+ it 'should return access token and (optionally) refresh token' do
+ expect(subject.credentials.to_h).to \
+ match(hash_including(
+ 'token' => 'valid_access_token',
+ 'refresh_token' => 'valid_refresh_token',
+ 'scope' => 'profile email',
+ 'expires_at' => 123_456_789,
+ 'expires' => true
+ ))
+ end
+ end
+
+ describe '#extra' do
+ let(:client) do
+ OAuth2::Client.new('abc', 'def') do |builder|
+ builder.request :url_encoded
+ builder.adapter :test do |stub|
+ stub.get('/oauth2/v3/userinfo') { [200, { 'content-type' => 'application/json' }, '{"sub": "12345"}'] }
+ end
+ end
+ end
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, {}) }
+
+ before { allow(subject).to receive(:access_token).and_return(access_token) }
+
+ describe 'id_token' do
+ shared_examples 'id_token issued by valid issuer' do |issuer|
+ context 'when the id_token is passed into the access token' do
+ let(:token_info) do
+ {
+ 'abc' => 'xyz',
+ 'exp' => Time.now.to_i + 3600,
+ 'nbf' => Time.now.to_i - 60,
+ 'iat' => Time.now.to_i,
+ 'aud' => 'appid',
+ 'iss' => issuer
+ }
+ end
+ let(:id_token) { JWT.encode(token_info, 'secret') }
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, 'id_token' => id_token) }
+
+ it 'should include id_token when set on the access_token' do
+ expect(subject.extra).to include(id_token: id_token)
+ end
+
+ it 'should include id_info when id_token is set on the access_token and skip_jwt is false' do
+ subject.options[:skip_jwt] = false
+ expect(subject.extra).to include(id_info: token_info)
+ end
+
+ it 'should not include id_info when id_token is set on the access_token and skip_jwt is true' do
+ subject.options[:skip_jwt] = true
+ expect(subject.extra).not_to have_key(:id_info)
+ end
+
+ it 'should include id_info when id_token is set on the access_token by default' do
+ expect(subject.extra).to include(id_info: token_info)
+ end
+ end
+ end
+
+ it_behaves_like 'id_token issued by valid issuer', 'accounts.google.com'
+ it_behaves_like 'id_token issued by valid issuer', 'https://accounts.google.com'
+
+ context 'when the id_token is issued by an invalid issuer' do
+ let(:token_info) do
+ {
+ 'abc' => 'xyz',
+ 'exp' => Time.now.to_i + 3600,
+ 'nbf' => Time.now.to_i - 60,
+ 'iat' => Time.now.to_i,
+ 'aud' => 'appid',
+ 'iss' => 'fake.google.com'
+ }
+ end
+ let(:id_token) { JWT.encode(token_info, 'secret') }
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, 'id_token' => id_token) }
+
+ it 'raises JWT::InvalidIssuerError' do
+ expect { subject.extra }.to raise_error(JWT::InvalidIssuerError)
+ end
+ end
+
+ context 'when the id_token is missing' do
+ it 'should not include id_token' do
+ expect(subject.extra).not_to have_key(:id_token)
+ end
+
+ it 'should not include id_info' do
+ expect(subject.extra).not_to have_key(:id_info)
+ end
+ end
+ end
+
+ describe 'raw_info' do
+ context 'when skip_info is true' do
+ before { subject.options[:skip_info] = true }
+
+ it 'should not include raw_info' do
+ expect(subject.extra).not_to have_key(:raw_info)
+ end
+ end
+
+ context 'when skip_info is false' do
+ before { subject.options[:skip_info] = false }
+
+ it 'should include raw_info' do
+ expect(subject.extra[:raw_info]).to eq('sub' => '12345')
+ end
+ end
+ end
+ end
+
+ describe 'populate auth hash urls' do
+ it 'should populate url map in auth hash if link present in raw_info' do
+ allow(subject).to receive(:raw_info) { { 'name' => 'Foo', 'profile' => 'https://plus.google.com/123456' } }
+ expect(subject.info[:urls][:google]).to eq('https://plus.google.com/123456')
+ end
+
+ it 'should not populate url map in auth hash if no link present in raw_info' do
+ allow(subject).to receive(:raw_info) { { 'name' => 'Foo' } }
+ expect(subject.info).not_to have_key(:urls)
+ end
+ end
+
+ describe 'image options' do
+ it 'should have no image if a picture is not present' do
+ @options = { image_aspect_ratio: 'square' }
+ allow(subject).to receive(:raw_info) { { 'name' => 'User Without Pic' } }
+ expect(subject.info[:image]).to be_nil
+ end
+
+ describe 'when a picture is returned from google' do
+ it 'should return the image with size specified in the `image_size` option' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50/photo.jpg')
+ end
+
+ it 'should return the image with size specified in the `image_size` option when sizing is in the picture' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh4.googleusercontent.com/url/s96-c/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh4.googleusercontent.com/url/s50/photo.jpg')
+ end
+
+ it 'should handle a picture with too many slashes correctly' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url//photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50/photo.jpg')
+ end
+
+ it 'should handle a picture with a size query parameter correctly' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg?sz=50' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50/photo.jpg')
+ end
+
+ it 'should handle a picture with a size query parameter and other valid query parameters correctly' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg?sz=50&hello=true&life=42' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50/photo.jpg?hello=true&life=42')
+ end
+
+ it 'should handle a picture with other valid query parameters correctly' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg?hello=true&life=42' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50/photo.jpg?hello=true&life=42')
+ end
+
+ it 'should return the image with width and height specified in the `image_size` option' do
+ @options = { image_size: { width: 50, height: 40 } }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/w50-h40/photo.jpg')
+ end
+
+ it 'should return the image with width and height specified in the `image_size` option when sizing is in the picture' do
+ @options = { image_size: { width: 50, height: 40 } }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/w100-h80-c/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/w50-h40/photo.jpg')
+ end
+
+ it 'should return square image when `image_aspect_ratio` is specified' do
+ @options = { image_aspect_ratio: 'square' }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/c/photo.jpg')
+ end
+
+ it 'should return square image when `image_aspect_ratio` is specified and sizing is in the picture' do
+ @options = { image_aspect_ratio: 'square' }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/c/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/c/photo.jpg')
+ end
+
+ it 'should return square sized image when `image_aspect_ratio` and `image_size` is set' do
+ @options = { image_aspect_ratio: 'square', image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50-c/photo.jpg')
+ end
+
+ it 'should return square sized image when `image_aspect_ratio` and `image_size` is set and sizing is in the picture' do
+ @options = { image_aspect_ratio: 'square', image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/s90/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/s50-c/photo.jpg')
+ end
+
+ it 'should return square sized image when `image_aspect_ratio` and `image_size` has height and width' do
+ @options = { image_aspect_ratio: 'square', image_size: { width: 50, height: 40 } }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/w50-h40-c/photo.jpg')
+ end
+
+ it 'should return square sized image when `image_aspect_ratio` and `image_size` has height and width and sizing is in the picture' do
+ @options = { image_aspect_ratio: 'square', image_size: { width: 50, height: 40 } }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/w100-h80/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/w50-h40-c/photo.jpg')
+ end
+
+ it 'should return original image if image url does not end in `photo.jpg`' do
+ @options = { image_size: 50 }
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photograph.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/photograph.jpg')
+ end
+ end
+
+ it 'should return original image if no options are provided' do
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/photo.jpg')
+ end
+
+ it 'should return correct image if google image url has double https' do
+ allow(subject).to receive(:raw_info) { { 'picture' => 'https:https://lh3.googleusercontent.com/url/photo.jpg' } }
+ expect(subject.info[:image]).to eq('https://lh3.googleusercontent.com/url/photo.jpg')
+ end
+ end
+
+ describe 'build_access_token' do
+ it 'should use a hybrid authorization request_uri if this is an AJAX request with a code parameter' do
+ allow(request).to receive(:xhr?).and_return(true)
+ allow(request).to receive(:params).and_return('code' => 'valid_code')
+
+ client = double(:client)
+ auth_code = double(:auth_code)
+ allow(client).to receive(:auth_code).and_return(auth_code)
+ expect(subject).to receive(:client).and_return(client)
+ expect(auth_code).to receive(:get_token).with('valid_code', { redirect_uri: 'postmessage' }, {})
+
+ expect(subject).not_to receive(:orig_build_access_token)
+ subject.build_access_token
+ end
+
+ it 'should use a hybrid authorization request_uri if this is an AJAX request (mobile) with a code parameter' do
+ allow(request).to receive(:xhr?).and_return(true)
+ allow(request).to receive(:params).and_return('code' => 'valid_code', 'redirect_uri' => '')
+
+ client = double(:client)
+ auth_code = double(:auth_code)
+ allow(client).to receive(:auth_code).and_return(auth_code)
+ expect(subject).to receive(:client).and_return(client)
+ expect(auth_code).to receive(:get_token).with('valid_code', { redirect_uri: '' }, {})
+
+ expect(subject).not_to receive(:orig_build_access_token)
+ subject.build_access_token
+ end
+
+ it 'should use the request_uri from params if this not an AJAX request (request from installed app) with a code parameter' do
+ allow(request).to receive(:xhr?).and_return(false)
+ allow(request).to receive(:params).and_return('code' => 'valid_code', 'redirect_uri' => 'redirect_uri')
+
+ client = double(:client)
+ auth_code = double(:auth_code)
+ allow(client).to receive(:auth_code).and_return(auth_code)
+ expect(subject).to receive(:client).and_return(client)
+ expect(auth_code).to receive(:get_token).with('valid_code', { redirect_uri: 'redirect_uri' }, {})
+
+ expect(subject).not_to receive(:orig_build_access_token)
+ subject.build_access_token
+ end
+
+ it 'should read access_token from hash if this is not an AJAX request with a code parameter' do
+ allow(request).to receive(:xhr?).and_return(false)
+ allow(request).to receive(:params).and_return('access_token' => 'valid_access_token')
+ expect(subject).to receive(:verify_token).with('valid_access_token').and_return true
+ expect(subject).to receive(:client).and_return(:client)
+
+ token = subject.build_access_token
+ expect(token).to be_instance_of(::OAuth2::AccessToken)
+ expect(token.token).to eq('valid_access_token')
+ expect(token.client).to eq(:client)
+ end
+
+ it 'reads the code from a json request body' do
+ body = StringIO.new(%({"code":"json_access_token"}))
+ client = double(:client)
+ auth_code = double(:auth_code)
+
+ allow(request).to receive(:xhr?).and_return(false)
+ allow(request).to receive(:content_type).and_return('application/json')
+ allow(request).to receive(:body).and_return(body)
+ allow(client).to receive(:auth_code).and_return(auth_code)
+ expect(subject).to receive(:client).and_return(client)
+
+ expect(auth_code).to receive(:get_token).with('json_access_token', { redirect_uri: 'postmessage' }, {})
+
+ subject.build_access_token
+ end
+
+ it 'reads the redirect uri from a json request body' do
+ body = StringIO.new(%({"code":"json_access_token", "redirect_uri":"sample"}))
+ client = double(:client)
+ auth_code = double(:auth_code)
+
+ allow(request).to receive(:xhr?).and_return(false)
+ allow(request).to receive(:content_type).and_return('application/json')
+ allow(request).to receive(:body).and_return(body)
+ allow(client).to receive(:auth_code).and_return(auth_code)
+ expect(subject).to receive(:client).and_return(client)
+
+ expect(auth_code).to receive(:get_token).with('json_access_token', { redirect_uri: 'sample' }, {})
+
+ subject.build_access_token
+ end
+
+ it 'reads the access token from a json request body' do
+ body = StringIO.new(%({"access_token":"valid_access_token"}))
+
+ allow(request).to receive(:xhr?).and_return(false)
+ allow(request).to receive(:content_type).and_return('application/json')
+ allow(request).to receive(:body).and_return(body)
+ expect(subject).to receive(:client).and_return(:client)
+
+ expect(subject).to receive(:verify_token).with('valid_access_token').and_return true
+
+ token = subject.build_access_token
+ expect(token).to be_instance_of(::OAuth2::AccessToken)
+ expect(token.token).to eq('valid_access_token')
+ expect(token.client).to eq(:client)
+ end
+
+ it 'should use callback_url without query_string if this is not an AJAX request' do
+ allow(request).to receive(:xhr?).and_return(false)
+ allow(request).to receive(:params).and_return('code' => 'valid_code')
+ allow(request).to receive(:content_type).and_return('application/x-www-form-urlencoded')
+
+ client = double(:client)
+ auth_code = double(:auth_code)
+ allow(client).to receive(:auth_code).and_return(auth_code)
+ allow(subject).to receive(:callback_url).and_return('redirect_uri_without_query_string')
+
+ expect(subject).to receive(:client).and_return(client)
+ expect(auth_code).to receive(:get_token).with('valid_code', { redirect_uri: 'redirect_uri_without_query_string' }, {})
+ subject.build_access_token
+ end
+ end
+
+ describe 'verify_token' do
+ before(:each) do
+ subject.options.client_options[:connection_build] = proc do |builder|
+ builder.request :url_encoded
+ builder.adapter :test do |stub|
+ stub.get('/oauth2/v3/tokeninfo?access_token=valid_access_token') do
+ [200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
+ aud: '000000000000.apps.googleusercontent.com',
+ sub: '123456789',
+ email_verified: 'true',
+ email: 'example@example.com',
+ access_type: 'offline',
+ scope: 'profile email',
+ expires_in: 436
+ )]
+ end
+ stub.get('/oauth2/v3/tokeninfo?access_token=invalid_access_token') do
+ [400, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(error_description: 'Invalid Value')]
+ end
+ end
+ end
+ end
+
+ it 'should verify token if access_token is valid and app_id equals' do
+ subject.options.client_id = '000000000000.apps.googleusercontent.com'
+ expect(subject.send(:verify_token, 'valid_access_token')).to eq(true)
+ end
+
+ it 'should verify token if access_token is valid and app_id authorized' do
+ subject.options.authorized_client_ids = ['000000000000.apps.googleusercontent.com']
+ expect(subject.send(:verify_token, 'valid_access_token')).to eq(true)
+ end
+
+ it 'should not verify token if access_token is valid but app_id is false' do
+ expect(subject.send(:verify_token, 'valid_access_token')).to eq(false)
+ end
+
+ it 'should raise error if access_token is invalid' do
+ expect do
+ subject.send(:verify_token, 'invalid_access_token')
+ end.to raise_error(OAuth2::Error)
+ end
+ end
+
+ describe 'verify_hd' do
+ let(:client) do
+ OAuth2::Client.new('abc', 'def') do |builder|
+ builder.request :url_encoded
+ builder.adapter :test do |stub|
+ stub.get('/oauth2/v3/userinfo') do
+ [200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
+ hd: 'example.com'
+ )]
+ end
+ end
+ end
+ end
+ let(:access_token) { OAuth2::AccessToken.from_hash(client, {}) }
+
+ context 'when domain is nil' do
+ let(:client) do
+ OAuth2::Client.new('abc', 'def') do |builder|
+ builder.request :url_encoded
+ builder.adapter :test do |stub|
+ stub.get('/oauth2/v3/userinfo') do
+ [200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump({})]
+ end
+ end
+ end
+ end
+
+ it 'should verify hd if options hd is set and correct' do
+ subject.options.hd = nil
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should verify hd if options hd is set as an array and is correct' do
+ subject.options.hd = ['example.com', 'example.co', nil]
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should raise an exception if nil is not included' do
+ subject.options.hd = ['example.com', 'example.co']
+ expect do
+ subject.send(:verify_hd, access_token)
+ end.to raise_error(OmniAuth::Strategies::OAuth2::CallbackError)
+ end
+ end
+
+ it 'should verify hd if options hd is not set' do
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should verify hd if options hd is set and correct' do
+ subject.options.hd = 'example.com'
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should verify hd if options hd is set as an array and is correct' do
+ subject.options.hd = ['example.com', 'example.co', nil]
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should verify hd if options hd is set as an Proc and is correct' do
+ subject.options.hd = proc { 'example.com' }
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should verify hd if options hd is set as an Proc returning an array and is correct' do
+ subject.options.hd = proc { ['example.com', 'example.co'] }
+ expect(subject.send(:verify_hd, access_token)).to eq(true)
+ end
+
+ it 'should raise error if options hd is set and wrong' do
+ subject.options.hd = 'invalid.com'
+ expect do
+ subject.send(:verify_hd, access_token)
+ end.to raise_error(OmniAuth::Strategies::GoogleOauth2::CallbackError)
+ end
+
+ it 'should raise error if options hd is set as an array and is not correct' do
+ subject.options.hd = ['invalid.com', 'invalid.co']
+ expect do
+ subject.send(:verify_hd, access_token)
+ end.to raise_error(OmniAuth::Strategies::GoogleOauth2::CallbackError)
+ end
+ end
+end
diff --git a/vendor/gems/omniauth-google-oauth2/spec/spec_helper.rb b/vendor/gems/omniauth-google-oauth2/spec/spec_helper.rb
new file mode 100644
index 00000000000..3c2325389c2
--- /dev/null
+++ b/vendor/gems/omniauth-google-oauth2/spec/spec_helper.rb
@@ -0,0 +1,4 @@
+# frozen_string_literal: true
+
+require File.join('bundler', 'setup')
+require 'rspec'
diff --git a/vendor/gems/omniauth-salesforce/.gitlab-ci.yml b/vendor/gems/omniauth-salesforce/.gitlab-ci.yml
new file mode 100644
index 00000000000..4e18980d01c
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/.gitlab-ci.yml
@@ -0,0 +1,28 @@
+workflow:
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+
+.rspec:
+ cache:
+ key: omniauth-salesforce
+ paths:
+ - vendor/gems/omniauth-salesforce/vendor/ruby
+ before_script:
+ - cd vendor/gems/omniauth-salesforce
+ - ruby -v # Print out ruby version for debugging
+ - gem install bundler --no-document # Bundler is not installed with the image
+ - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby
+ - bundle config set with 'development'
+ - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI
+ - bundle config # Show bundler configuration
+ - bundle install -j $(nproc)
+ script:
+ - bundle exec rspec
+
+rspec-2.7:
+ image: "ruby:2.7"
+ extends: .rspec
+
+rspec-3.0:
+ image: "ruby:3.0"
+ extends: .rspec
diff --git a/vendor/gems/omniauth-salesforce/Gemfile b/vendor/gems/omniauth-salesforce/Gemfile
new file mode 100755
index 00000000000..0ac6c2141a7
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/Gemfile
@@ -0,0 +1,12 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in omniauth-salesforce.gemspec
+gemspec
+
+group :development, :test do
+ gem 'guard'
+ gem 'guard-rspec'
+ gem 'guard-bundler'
+ gem 'rb-fsevent'
+ gem 'growl'
+end
diff --git a/vendor/gems/omniauth-salesforce/Gemfile.lock b/vendor/gems/omniauth-salesforce/Gemfile.lock
new file mode 100644
index 00000000000..0317b16dd9f
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/Gemfile.lock
@@ -0,0 +1,124 @@
+PATH
+ remote: .
+ specs:
+ omniauth-salesforce (1.0.5)
+ omniauth (~> 2.0)
+ omniauth-oauth2 (~> 1.0)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ addressable (2.8.1)
+ public_suffix (>= 2.0.2, < 6.0)
+ coderay (1.1.3)
+ crack (0.4.5)
+ rexml
+ diff-lcs (1.5.0)
+ docile (1.4.0)
+ faraday (2.5.2)
+ faraday-net_http (>= 2.0, < 3.1)
+ ruby2_keywords (>= 0.0.4)
+ faraday-net_http (3.0.0)
+ ffi (1.15.5)
+ formatador (1.1.0)
+ growl (1.0.3)
+ guard (2.18.0)
+ formatador (>= 0.2.4)
+ listen (>= 2.7, < 4.0)
+ lumberjack (>= 1.0.12, < 2.0)
+ nenv (~> 0.1)
+ notiffany (~> 0.0)
+ pry (>= 0.13.0)
+ shellany (~> 0.0)
+ thor (>= 0.18.1)
+ guard-bundler (3.0.0)
+ bundler (>= 2.1, < 3)
+ guard (~> 2.2)
+ guard-compat (~> 1.1)
+ guard-compat (1.2.1)
+ guard-rspec (4.7.3)
+ guard (~> 2.1)
+ guard-compat (~> 1.1)
+ rspec (>= 2.99.0, < 4.0)
+ hashdiff (1.0.1)
+ hashie (5.0.0)
+ jwt (2.4.1)
+ listen (3.7.1)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
+ lumberjack (1.2.8)
+ method_source (1.0.0)
+ multi_xml (0.6.0)
+ nenv (0.3.0)
+ notiffany (0.1.3)
+ nenv (~> 0.1)
+ shellany (~> 0.0)
+ oauth2 (2.0.3)
+ faraday (>= 0.17.3, < 3.0)
+ jwt (>= 1.0, < 3.0)
+ multi_xml (~> 0.5)
+ rack (>= 1.2, < 3)
+ rash_alt (>= 0.4, < 1)
+ version_gem (~> 1.0)
+ omniauth (2.1.0)
+ hashie (>= 3.4.6)
+ rack (>= 2.2.3)
+ rack-protection
+ omniauth-oauth2 (1.7.3)
+ oauth2 (>= 1.4, < 3)
+ omniauth (>= 1.9, < 3)
+ pry (0.14.1)
+ coderay (~> 1.1)
+ method_source (~> 1.0)
+ public_suffix (5.0.0)
+ rack (2.2.4)
+ rack-protection (2.2.2)
+ rack
+ rack-test (2.0.2)
+ rack (>= 1.3)
+ rash_alt (0.4.12)
+ hashie (>= 3.4)
+ rb-fsevent (0.11.1)
+ rb-inotify (0.10.1)
+ ffi (~> 1.0)
+ rexml (3.2.5)
+ rspec (2.99.0)
+ rspec-core (~> 2.99.0)
+ rspec-expectations (~> 2.99.0)
+ rspec-mocks (~> 2.99.0)
+ rspec-core (2.99.2)
+ rspec-expectations (2.99.2)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.99.4)
+ ruby2_keywords (0.0.5)
+ shellany (0.0.1)
+ simplecov (0.21.2)
+ docile (~> 1.1)
+ simplecov-html (~> 0.11)
+ simplecov_json_formatter (~> 0.1)
+ simplecov-html (0.12.3)
+ simplecov_json_formatter (0.1.4)
+ thor (1.2.1)
+ version_gem (1.1.0)
+ webmock (3.18.1)
+ addressable (>= 2.8.0)
+ crack (>= 0.3.2)
+ hashdiff (>= 0.4.0, < 2.0.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ growl
+ guard
+ guard-bundler
+ guard-rspec
+ omniauth-salesforce!
+ rack-test
+ rb-fsevent
+ rspec (~> 2.7)
+ simplecov
+ webmock
+
+BUNDLED WITH
+ 2.3.21
diff --git a/vendor/gems/omniauth-salesforce/Guardfile b/vendor/gems/omniauth-salesforce/Guardfile
new file mode 100755
index 00000000000..2aaba26cc43
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/Guardfile
@@ -0,0 +1,10 @@
+guard 'rspec', :version => 2 do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+end
+
+guard 'bundler' do
+ watch('Gemfile')
+ watch('omniauth-salesforce.gemspec')
+end
diff --git a/vendor/gems/omniauth-salesforce/LICENSE.md b/vendor/gems/omniauth-salesforce/LICENSE.md
new file mode 100644
index 00000000000..e662c786216
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/LICENSE.md
@@ -0,0 +1,5 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/vendor/gems/omniauth-salesforce/README.md b/vendor/gems/omniauth-salesforce/README.md
new file mode 100755
index 00000000000..df59e99bc55
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/README.md
@@ -0,0 +1,60 @@
+# omniauth-salesforce
+
+This is fork of [omniauth-salesforce](https://github.com/realdoug/omniauth-salesforce) to support:
+
+1. OmniAuth v1 and v2. OmniAuth v2 disables GET requests by default
+ and defaults to POST. GitLab already has patched v1 to use POST,
+ but other dependencies need to be updated:
+ https://gitlab.com/gitlab-org/gitlab/-/issues/30073.
+
+There is active discussion with the gem owner (via email) about adding some GitLab employees as gem
+authors so tha they can push changes. If that happens, the updated/canonical gem
+should be used in favor of this vendored fork.
+
+[OmniAuth](https://github.com/intridea/omniauth) Strategy for [salesforce.com](salesforce.com).
+
+Note: This is a fork of the [original](https://github.com/richardvanhook/omniauth-salesforce) project and is now the main repository for the omniauth-salesforce gem.
+
+## See it in action
+
+[http://omniauth-salesforce-example.herokuapp.com](http://omniauth-salesforce-example.herokuapp.com)
+
+[Source for above app](https://github.com/richardvanhook/omniauth-salesforce-example)
+
+## Basic Usage
+
+```ruby
+require "sinatra"
+require "omniauth"
+require "omniauth-salesforce"
+
+class MyApplication < Sinatra::Base
+ use Rack::Session
+ use OmniAuth::Builder do
+ provider :salesforce, ENV['SALESFORCE_KEY'], ENV['SALESFORCE_SECRET']
+ end
+end
+```
+
+## Including other sites
+
+```ruby
+use OmniAuth::Builder do
+ provider :salesforce,
+ ENV['SALESFORCE_KEY'],
+ ENV['SALESFORCE_SECRET']
+ provider OmniAuth::Strategies::SalesforceSandbox,
+ ENV['SALESFORCE_SANDBOX_KEY'],
+ ENV['SALESFORCE_SANDBOX_SECRET']
+ provider OmniAuth::Strategies::SalesforcePreRelease,
+ ENV['SALESFORCE_PRERELEASE_KEY'],
+ ENV['SALESFORCE_PRERELEASE_SECRET']
+ provider OmniAuth::Strategies::DatabaseDotCom,
+ ENV['DATABASE_DOT_COM_KEY'],
+ ENV['DATABASE_DOT_COM_SECRET']
+end
+```
+
+## Resources
+
+* [Article: Digging Deeper into OAuth 2.0 on Force.com](http://wiki.developerforce.com/index.php/Digging_Deeper_into_OAuth_2.0_on_Force.com)
diff --git a/vendor/gems/omniauth-salesforce/Rakefile b/vendor/gems/omniauth-salesforce/Rakefile
new file mode 100755
index 00000000000..ca978a9cf0d
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/Rakefile
@@ -0,0 +1,12 @@
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
+require 'rspec/core/rake_task'
+
+desc 'Default: run specs.'
+task :default => :spec
+
+desc "Run specs"
+RSpec::Core::RakeTask.new
+
+desc 'Run specs'
+task :default => :spec
diff --git a/vendor/gems/omniauth-salesforce/lib/omniauth-salesforce.rb b/vendor/gems/omniauth-salesforce/lib/omniauth-salesforce.rb
new file mode 100755
index 00000000000..20a5937d762
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/lib/omniauth-salesforce.rb
@@ -0,0 +1,2 @@
+require "omniauth-salesforce/version"
+require 'omniauth/strategies/salesforce'
diff --git a/vendor/gems/omniauth-salesforce/lib/omniauth-salesforce/version.rb b/vendor/gems/omniauth-salesforce/lib/omniauth-salesforce/version.rb
new file mode 100755
index 00000000000..51f0084840e
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/lib/omniauth-salesforce/version.rb
@@ -0,0 +1,5 @@
+module OmniAuth
+ module Salesforce
+ VERSION = "1.0.5"
+ end
+end
diff --git a/vendor/gems/omniauth-salesforce/lib/omniauth/strategies/salesforce.rb b/vendor/gems/omniauth-salesforce/lib/omniauth/strategies/salesforce.rb
new file mode 100755
index 00000000000..f2d811aeb9e
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/lib/omniauth/strategies/salesforce.rb
@@ -0,0 +1,97 @@
+require 'omniauth-oauth2'
+require 'openssl'
+require 'base64'
+
+module OmniAuth
+ module Strategies
+ class Salesforce < OmniAuth::Strategies::OAuth2
+
+ MOBILE_USER_AGENTS = 'webos|ipod|iphone|ipad|android|blackberry|mobile'
+
+ option :client_options, {
+ :site => 'https://login.salesforce.com',
+ :authorize_url => '/services/oauth2/authorize',
+ :token_url => '/services/oauth2/token'
+ }
+ option :authorize_options, [
+ :scope,
+ :display,
+ :immediate,
+ :state,
+ :prompt
+ ]
+
+ def request_phase
+ req = Rack::Request.new(@env)
+ options.update(req.params)
+ ua = req.user_agent.to_s
+ if !options.has_key?(:display)
+ mobile_request = ua.downcase =~ Regexp.new(MOBILE_USER_AGENTS)
+ options[:display] = mobile_request ? 'touch' : 'page'
+ end
+ super
+ end
+
+ def auth_hash
+ signed_value = access_token.params['id'] + access_token.params['issued_at']
+ raw_expected_signature = OpenSSL::HMAC.digest('sha256', options.client_secret.to_s, signed_value)
+ expected_signature = Base64.strict_encode64 raw_expected_signature
+ signature = access_token.params['signature']
+ fail! "Salesforce user id did not match signature!" unless signature == expected_signature
+ super
+ end
+
+ uid { raw_info['id'] }
+
+ info do
+ {
+ 'name' => raw_info['display_name'],
+ 'email' => raw_info['email'],
+ 'nickname' => raw_info['nick_name'],
+ 'first_name' => raw_info['first_name'],
+ 'last_name' => raw_info['last_name'],
+ 'location' => '',
+ 'description' => '',
+ 'image' => raw_info['photos']['thumbnail'] + "?oauth_token=#{access_token.token}",
+ 'phone' => '',
+ 'urls' => raw_info['urls']
+ }
+ end
+
+ credentials do
+ hash = {'token' => access_token.token}
+ hash.merge!('instance_url' => access_token.params["instance_url"])
+ hash.merge!('refresh_token' => access_token.refresh_token) if access_token.refresh_token
+ hash
+ end
+
+ def raw_info
+ access_token.options[:mode] = :header
+ @raw_info ||= access_token.post(access_token['id']).parsed
+ end
+
+ extra do
+ raw_info.merge({
+ 'instance_url' => access_token.params['instance_url'],
+ 'pod' => access_token.params['instance_url'],
+ 'signature' => access_token.params['signature'],
+ 'issued_at' => access_token.params['issued_at']
+ })
+ end
+
+ end
+
+ class SalesforceSandbox < OmniAuth::Strategies::Salesforce
+ default_options[:client_options][:site] = 'https://test.salesforce.com'
+ end
+
+ class DatabaseDotCom < OmniAuth::Strategies::Salesforce
+ default_options[:client_options][:site] = 'https://login.database.com'
+ end
+
+ class SalesforcePreRelease < OmniAuth::Strategies::Salesforce
+ default_options[:client_options][:site] = 'https://prerellogin.pre.salesforce.com/'
+ end
+
+ end
+end
diff --git a/vendor/gems/omniauth-salesforce/omniauth-salesforce.gemspec b/vendor/gems/omniauth-salesforce/omniauth-salesforce.gemspec
new file mode 100755
index 00000000000..9c87746e9fd
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/omniauth-salesforce.gemspec
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/omniauth-salesforce/version', __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.authors = ["Richard Vanhook"]
+ gem.email = ["rvanhook@salesforce.com"]
+ gem.description = %q{OmniAuth strategy for salesforce.com.}
+ gem.summary = %q{OmniAuth strategy for salesforce.com.}
+ gem.homepage = "https://github.com/realdoug/omniauth-salesforce"
+
+ gem.files = Dir.glob("lib/**/*.*")
+ gem.test_files = Dir.glob("spec/**/**/*.*")
+ gem.name = "omniauth-salesforce"
+ gem.require_paths = ["lib"]
+ gem.version = OmniAuth::Salesforce::VERSION
+ gem.license = "MIT"
+
+ gem.add_dependency 'omniauth', '~> 2.0'
+ gem.add_dependency 'omniauth-oauth2', '~> 1.0'
+ gem.add_development_dependency 'rspec', '~> 2.7'
+ gem.add_development_dependency 'rack-test'
+ gem.add_development_dependency 'simplecov'
+ gem.add_development_dependency 'webmock'
+end
diff --git a/vendor/gems/omniauth-salesforce/spec/omniauth/strategies/salesforce_spec.rb b/vendor/gems/omniauth-salesforce/spec/omniauth/strategies/salesforce_spec.rb
new file mode 100755
index 00000000000..9b5afbdbe25
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/spec/omniauth/strategies/salesforce_spec.rb
@@ -0,0 +1,219 @@
+require 'spec_helper'
+
+describe OmniAuth::Strategies::Salesforce do
+ strategy = nil
+ before do
+ OmniAuth.config.test_mode = true
+ rack_app = []
+ rack_app.stub :call
+ strategy = OmniAuth::Strategies::Salesforce.new rack_app, 'Consumer Key', 'Consumer Secret'
+ end
+ describe "request_phase" do
+ env = nil
+ before do
+ env = {
+ 'rack.session' => {},
+ 'HTTP_USER_AGENT' => 'unknown',
+ 'REQUEST_METHOD' => 'GET',
+ 'rack.input' => '',
+ 'rack.url_scheme' => 'http',
+ 'SERVER_NAME' => 'server.example',
+ 'QUERY_STRING' => 'code=xxxx',
+ 'SCRIPT_NAME' => '',
+ 'SERVER_PORT' => 80
+ }
+ end
+ context "when using a mobile browser" do
+ user_agents = {
+ :Pre => "Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1",
+ :iPod => "Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3",
+ :iPhone => "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3",
+ :iPad => "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
+ :Nexus => "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ :myTouch => "Mozilla/5.0 (Linux; U; Android 1.6; en-us; WOWMobile myTouch 3G Build/unknown) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ :Storm => "BlackBerry9530/4.7.0.148 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105",
+ :Torch => "Mozilla/5.0 (BlackBerry; U; BlackBerry 9810; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0 Mobile Safari/534.11+",
+ :generic_mobile => "some mobile device"
+ }
+ user_agents.each_pair do |name, agent|
+ context "with the user agent from a #{name.to_s}" do
+ before do
+ env['HTTP_USER_AGENT'] = agent
+ strategy.call!(env)
+ strategy.request_phase
+ end
+ subject {strategy.options}
+ it "sets the :display option to 'touch'" do
+ subject[:display].should == 'touch'
+ end
+ end
+ end
+ end
+ context "when using a desktop browser" do
+ user_agents = {
+ :Chrome => "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21",
+ :Safari => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1",
+ :IE => "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)",
+ :anything_else => "unknown"
+ }
+ user_agents.each_pair do |name, agent|
+ context "with the user agent from #{name.to_s}" do
+ before do
+ env['HTTP_USER_AGENT'] = agent
+ strategy.call!(env)
+ strategy.request_phase
+ end
+ subject {strategy.options}
+ it "sets the :display option to 'page'" do
+ subject[:display].should == 'page'
+ end
+ end
+ end
+ end
+ end
+ describe "callback phase" do
+ raw_info = nil
+ before do
+ raw_info = {
+ 'id' => 'salesforce id',
+ 'display_name' => 'display name',
+ 'email' => 'email',
+ 'nick_name' => 'nick name',
+ 'first_name' => 'first name',
+ 'last_name' => 'last name',
+ 'photos' => {'thumbnail' => '/thumbnail/url'},
+ 'urls'=> {
+ "enterprise" => "https://salesforce.example/services",
+ "metadata" => "https://salesforce.example/services"
+ }
+ }
+ client = OAuth2::Client.new 'id', 'secret', {:site => 'example.com'}
+ access_token = OAuth2::AccessToken.from_hash client, {
+ 'access_token' => 'token',
+ 'instance_url' => 'http://instance.salesforce.example',
+ 'signature' => 'invalid',
+ 'issued_at' => '1296458209517'
+ }
+ strategy.stub(:raw_info) { raw_info }
+ strategy.stub(:access_token) { access_token }
+ end
+ describe "uid" do
+ it "sets the id" do
+ strategy.uid.should == raw_info['id']
+ end
+ end
+ describe "info" do
+ subject { strategy.info }
+ it "returns an info hash" do
+ subject.should_not be_nil
+ end
+ it "sets name" do
+ subject['name'].should == raw_info['display_name']
+ end
+ it "sets email" do
+ subject['email'].should == raw_info['email']
+ end
+ it "sets nickname" do
+ subject['nickname'].should == raw_info['nick_name']
+ end
+ it "sets first_name" do
+ subject['first_name'].should == raw_info['first_name']
+ end
+ it "sets last_name" do
+ subject['last_name'].should == raw_info['last_name']
+ end
+ it "sets location" do
+ subject['location'].should == ''
+ end
+ it "sets description" do
+ subject['description'].should == ''
+ end
+ it "sets image" do
+ subject['image'].should == raw_info['photos']['thumbnail'] + "?oauth_token=#{strategy.access_token.token}"
+ end
+ it "sets phone" do
+ subject['phone'].should == ''
+ end
+ it "sets urls" do
+ subject['urls'].should == raw_info['urls']
+ end
+ end
+ describe "credentials" do
+ subject { strategy.credentials }
+ it "sets token" do
+ subject['token'].should == strategy.access_token.token
+ end
+ it "sets instance_url" do
+ subject['instance_url'].should == strategy.access_token.params["instance_url"]
+ end
+ context "given a refresh token" do
+ it "sets refresh_token" do
+ subject['refresh_token'].should == strategy.access_token.refresh_token
+ end
+ end
+ context "when not given a refresh token" do
+ it "does not set a refresh token" do
+ subject['refresh_token'].should be_nil
+ end
+ end
+ end
+ describe "extra" do
+ subject { strategy.extra }
+ it "sets instance_url" do
+ subject['instance_url'].should == strategy.access_token.params['instance_url']
+ end
+ it "sets pod" do
+ subject['pod'].should == strategy.access_token.params['instance_url']
+ end
+ it "sets signature" do
+ subject['signature'].should == strategy.access_token.params['signature']
+ end
+ it "sets issued_at" do
+ subject['issued_at'].should == strategy.access_token.params['issued_at']
+ end
+ end
+ describe "user id validation" do
+ client_id = nil
+ issued_at = nil
+ signature = nil
+ instance_url = 'http://instance.salesforce.example'
+ before do
+ client_id = "https://login.salesforce.com/id/00Dd0000000d45TEBQ/005d0000000fyGPCCY"
+ issued_at = "1331142541514"
+ signature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', strategy.options.client_secret.to_s, client_id + issued_at))
+ end
+ context "when the signature does not match" do
+ before do
+ access_token = OAuth2::AccessToken.from_hash strategy.access_token.client, {
+ 'id' => 'forged client id',
+ 'refresh_token' => 'anything',
+ 'issued_at' => issued_at,
+ 'instance_url' => 'http://instance.salesforce.example',
+ 'signature' => signature
+ }
+ strategy.stub(:access_token) { access_token }
+ end
+ it "should call fail!" do
+ strategy.should_receive(:fail!)
+ strategy.auth_hash
+ end
+ end
+ context "when the signature does match" do
+ before do
+ access_token = OAuth2::AccessToken.from_hash strategy.access_token.client, {
+ 'id' => client_id,
+ 'refresh_token' => 'anything',
+ 'issued_at' => issued_at,
+ 'instance_url' => 'http://instance.salesforce.example',
+ 'signature' => signature
+ }
+ strategy.stub(:access_token) { access_token }
+ end
+ it "should not fail" do
+ strategy.should_not_receive(:fail!)
+ strategy.auth_hash
+ end
+ end
+ end
+ end
+end
diff --git a/vendor/gems/omniauth-salesforce/spec/spec_helper.rb b/vendor/gems/omniauth-salesforce/spec/spec_helper.rb
new file mode 100755
index 00000000000..0b00358fa05
--- /dev/null
+++ b/vendor/gems/omniauth-salesforce/spec/spec_helper.rb
@@ -0,0 +1,16 @@
+$:.unshift File.expand_path('..', __FILE__)
+$:.unshift File.expand_path('../../lib', __FILE__)
+require 'simplecov'
+SimpleCov.start
+require 'rspec'
+require 'rack/test'
+require 'webmock/rspec'
+require 'omniauth'
+require 'omniauth-salesforce'
+
+RSpec.configure do |config|
+ config.include WebMock::API
+ config.include Rack::Test::Methods
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
+end
+
diff --git a/vendor/gems/omniauth_crowd/Gemfile.lock b/vendor/gems/omniauth_crowd/Gemfile.lock
index 56c9bd4cc7e..43518582535 100644
--- a/vendor/gems/omniauth_crowd/Gemfile.lock
+++ b/vendor/gems/omniauth_crowd/Gemfile.lock
@@ -4,7 +4,7 @@ PATH
omniauth_crowd (2.4.0)
activesupport
nokogiri (>= 1.4.4)
- omniauth (~> 1.0, < 3)
+ omniauth (~> 2.0)
GEM
remote: http://rubygems.org/
@@ -29,12 +29,15 @@ GEM
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
- omniauth (1.9.1)
+ omniauth (2.1.0)
hashie (>= 3.4.6)
- rack (>= 1.6.2, < 3)
+ rack (>= 2.2.3)
+ rack-protection
public_suffix (4.0.7)
racc (1.6.0)
rack (2.2.4)
+ rack-protection (2.2.2)
+ rack
rack-test (2.0.2)
rack (>= 1.3)
rake (13.0.6)
diff --git a/vendor/gems/omniauth_crowd/lib/omniauth/strategies/crowd.rb b/vendor/gems/omniauth_crowd/lib/omniauth/strategies/crowd.rb
index 7e3829b9b95..7126d8328e0 100755
--- a/vendor/gems/omniauth_crowd/lib/omniauth/strategies/crowd.rb
+++ b/vendor/gems/omniauth_crowd/lib/omniauth/strategies/crowd.rb
@@ -17,15 +17,7 @@ module OmniAuth
protected
def request_phase
- if env['REQUEST_METHOD'] == 'GET'
-
- if @configuration.use_sessions? && request.cookies[@configuration.session_cookie]
- redirect callback_url
- else
- get_credentials
- end
-
- elsif (env['REQUEST_METHOD'] == 'POST') && (not request.params['username'])
+ if (env['REQUEST_METHOD'] == 'POST') && (not request.params['username'])
get_credentials
else
session['omniauth.crowd'] = {'username' => request['username'], 'password' => request['password']}
diff --git a/vendor/gems/omniauth_crowd/omniauth_crowd.gemspec b/vendor/gems/omniauth_crowd/omniauth_crowd.gemspec
index 1707c7f3f10..dcbf403419f 100644
--- a/vendor/gems/omniauth_crowd/omniauth_crowd.gemspec
+++ b/vendor/gems/omniauth_crowd/omniauth_crowd.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = OmniAuth::Crowd::VERSION
- gem.add_runtime_dependency 'omniauth', '~> 1.0', '< 3'
+ gem.add_runtime_dependency 'omniauth', '~> 2.0'
gem.add_runtime_dependency 'nokogiri', '>= 1.4.4'
gem.add_runtime_dependency 'activesupport', '>= 0'
gem.add_development_dependency(%q<rack>, [">= 0"])
diff --git a/vendor/gems/omniauth_crowd/spec/omniauth/strategies/crowd_spec.rb b/vendor/gems/omniauth_crowd/spec/omniauth/strategies/crowd_spec.rb
index f234ef82e76..000b3901f86 100755
--- a/vendor/gems/omniauth_crowd/spec/omniauth/strategies/crowd_spec.rb
+++ b/vendor/gems/omniauth_crowd/spec/omniauth/strategies/crowd_spec.rb
@@ -20,9 +20,21 @@ describe OmniAuth::Strategies::Crowd, :type=>:strategy do
@sso_url_image = nil
let(:config) { OmniAuth::Strategies::Crowd::Configuration.new(strategy[1]) }
let(:validator) { OmniAuth::Strategies::Crowd::CrowdValidator.new(config, 'foo', 'bar', nil, nil) }
+ let(:csrf_token) { SecureRandom.base64(32) }
+ let(:base_env) { { 'rack.session' => { csrf: csrf_token }, 'rack.input' => StringIO.new("authenticity_token=#{escaped_token}") } }
+ let(:post_env) { make_env('/auth/crowd', base_env) }
+ let(:escaped_token) { URI.encode_www_form_component(csrf_token, Encoding::UTF_8) }
+
+ def make_env(path = '/auth/crowd', props = {})
+ {
+ 'REQUEST_METHOD' => 'POST',
+ 'PATH_INFO' => path,
+ 'rack.session' => {},
+ 'rack.input' => StringIO.new('test=true')
+ }.merge(props)
+ end
describe 'Authentication Request Body' do
-
it 'should send password in session request' do
body = <<-BODY.strip
<password>
@@ -42,21 +54,13 @@ BODY
end
end
- describe 'GET /auth/crowd' do
+ describe 'POST /auth/crowd' do
it 'should show the login form' do
- get '/auth/crowd'
+ post '/auth/crowd', nil, post_env
expect(last_response).to be_ok
end
end
- describe 'POST /auth/crowd' do
- it 'should redirect to callback' do
- post '/auth/crowd', :username=>'foo', :password=>'bar'
- expect(last_response).to be_redirect
- expect(last_response.headers['Location']).to eq('http://example.org/auth/crowd/callback')
- end
- end
-
describe 'GET /auth/crowd/callback without any credentials' do
it 'should fail' do
get '/auth/crowd/callback'
@@ -79,13 +83,16 @@ BODY
to_return(:status => [415, "Unsupported Media Type"])
get '/auth/crowd/callback', nil, 'rack.session'=>{'omniauth.crowd'=> {"username"=>"foo", "password"=>"ba"}}
end
+
it 'should call through to the master app' do
expect(last_response.body).to eq('true')
end
+
it 'should have an auth hash' do
auth = last_request.env['omniauth.auth']
expect(auth).to be_kind_of(Hash)
end
+
it 'should have good data' do
auth = last_request.env['omniauth.auth']
expect(auth['provider']).to eq(:crowd)
@@ -142,8 +149,7 @@ BODY
end
end
- describe 'GET /auth/crowd without credentials will redirect to login form' do
-
+ describe 'POST /auth/crowd without credentials will redirect to login form' do
sso_url = 'https://foo.bar'
before do
@@ -152,10 +158,9 @@ BODY
end
it 'should have the SSO button in the response body' do
-
found_legend = found_anchor = nil
- get '/auth/crowd'
+ post '/auth/crowd', nil, post_env
Nokogiri::HTML(last_response.body).xpath('//html/body/form/fieldset/*').each do |element|
@@ -163,26 +168,23 @@ BODY
found_legend = true
elsif element.name === 'a' && element.attr('href') === "#{sso_url}/users/auth/crowd/callback"
found_anchor = true
- end
+ end
end
expect(found_legend).to(be(true))
expect(found_anchor).to(be(true))
-
end
after do
@using_sessions = false
@sso_url = nil
end
-
end
-
- describe 'GET /auth/crowd without credentials will redirect to login form which has custom image in the SSO link' do
-
+
+ describe 'POST /auth/crowd without credentials will redirect to login form which has custom image in the SSO link' do
sso_url = 'https://foo.bar'
sso_url_image = 'https://foo.bar/image.png'
-
+
before do
@using_sessions = true
@sso_url = sso_url
@@ -190,10 +192,9 @@ BODY
end
it 'should have the SSO button with a custom image in the response body' do
-
found_legend = found_anchor = found_image = false
- get '/auth/crowd'
+ post '/auth/crowd', nil, post_env
Nokogiri::HTML(last_response.body).xpath('//html/body/form/fieldset/*').each do |element|
@@ -206,14 +207,12 @@ BODY
if element.children.length === 1 && element.children.first.name === 'img' && element.children.first.attr('src') === sso_url_image
found_image = true
end
-
end
end
expect(found_legend).to(be(true))
expect(found_anchor).to(be(true))
expect(found_image).to(be(true))
-
end
after do
@@ -221,46 +220,13 @@ BODY
@sso_url = nil
@sso_url_image = nil
end
-
end
- describe 'GET /auth/crowd without credentials but with SSO cookie will redirect to callback' do
-
- sso_url = 'https://foo.bar'
-
- before do
-
- @using_sessions = true
- @sso_url = sso_url
-
- set_cookie('crowd.token_key=foobar')
-
- end
-
- it 'should redirect to callback' do
- get '/auth/crowd'
- expect(last_response).to be_redirect
- expect(last_response.headers['Location']).to eq('http://example.org/auth/crowd/callback')
- end
-
- after do
-
- @using_sessions = false
- @sso_url = nil
-
- clear_cookies()
-
- end
-
- end
-
describe 'POST /auth/crowd/callback without credentials but with SSO cookie will redirect to login form because session is invalid' do
-
sso_url = 'https://foo.bar'
token = 'foobar'
-
+
before do
-
@using_sessions = true
@sso_url = sso_url
@@ -268,7 +234,6 @@ BODY
to_return(:status => [404])
set_cookie("crowd.token_key=#{token}")
-
end
it 'should redirect to login form' do
@@ -360,7 +325,6 @@ BODY
end
it 'should return user data' do
-
auth = nil
get '/auth/crowd/callback'
diff --git a/vendor/project_templates/cluster_management.tar.gz b/vendor/project_templates/cluster_management.tar.gz
index 93eba37a57b..b7c44a4770d 100644
--- a/vendor/project_templates/cluster_management.tar.gz
+++ b/vendor/project_templates/cluster_management.tar.gz
Binary files differ