-
-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2_0-indev' into fix-path-prefix-when-redirecting-on-fai…
…lure
- Loading branch information
Showing
21 changed files
with
468 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
| # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | ||
| # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | ||
|
|
||
| name: Ruby | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-18.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu, macos] | ||
| ruby: [2.5, 2.6, 2.7, head, debug, truffleruby, truffleruby-head] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: bundle install | ||
| - name: Run tests | ||
| run: bundle exec rake | ||
| test-jruby: | ||
| runs-on: ubuntu-18.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu, macos] | ||
| jruby: [jruby, jruby-head] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.jruby }} | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| env: | ||
| JRUBY_OPTS: --debug | ||
| run: bundle install | ||
| - name: Run tests | ||
| env: | ||
| JRUBY_OPTS: --debug | ||
| run: bundle exec rake | ||
| coveralls: | ||
| runs-on: ubuntu-18.04 | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 2.5 | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: bundle install | ||
| - name: Run tests | ||
| run: bundle exec rake | ||
| - name: Coveralls GitHub Action | ||
| uses: coverallsapp/github-action@v1.1.2 | ||
| with: | ||
| github-token: ${{ secrets.github_token }} | ||
| path-to-lcov: './coverage/lcov/omniauth.lcov' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ doc/* | |
| log/* | ||
| measurement/* | ||
| pkg/* | ||
| .DS_Store | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| require 'rack-protection' | ||
|
|
||
| module OmniAuth | ||
| class AuthenticityError < StandardError; end | ||
| class AuthenticityTokenProtection < Rack::Protection::AuthenticityToken | ||
| def initialize(options = {}) | ||
| @options = default_options.merge(options) | ||
| end | ||
|
|
||
| def self.call(env) | ||
| new.call!(env) | ||
| end | ||
|
|
||
| def call!(env) | ||
| return if accepts?(env) | ||
|
|
||
| instrument env | ||
| react env | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def deny(_env) | ||
| OmniAuth.logger.send(:warn, "Attack prevented by #{self.class}") | ||
| raise AuthenticityError.new(options[:message]) | ||
| end | ||
|
|
||
| alias default_reaction deny | ||
| end | ||
| end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.