Skip to content

Commit e833e33

Browse files
authored
Merge pull request #8 from omniauth/discourse-main
2 parents a301f0b + 386e81f commit e833e33

29 files changed

Lines changed: 787 additions & 83 deletions

.github/workflows/ancient.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Ancient Ruby Support
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Ruby ${{ matrix.ruby }}
24+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
26+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
experimental: [false]
31+
rubygems:
32+
- "2.7.11"
33+
bundler:
34+
- none
35+
gemfile:
36+
- ancient
37+
ruby:
38+
- "2.3.8"
39+
- "2.2.10"
40+
runs-on: ubuntu-20.04
41+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v3
45+
- name: Setup Ruby & Bundle
46+
uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby }}
49+
rubygems: ${{ matrix.rubygems }}
50+
bundler: ${{ matrix.bundler }}
51+
bundler-cache: true
52+
- name: Run tests
53+
run: bundle exec rspec

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Omniauth JWT Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
name: Ruby ${{ matrix.ruby }}
25+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
26+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
27+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
28+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
experimental: [false]
33+
rubygems:
34+
- latest
35+
bundler:
36+
- latest
37+
gemfile:
38+
- vanilla
39+
ruby:
40+
- "2.7"
41+
- "3.0"
42+
- "3.1"
43+
- "3.2"
44+
exclude:
45+
# Vanilla + 3.2 is effectively run by coverage workflow
46+
- gemfile: vanilla
47+
ruby: "3.2"
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
- name: Setup Ruby & Bundle
52+
uses: ruby/setup-ruby@v1
53+
with:
54+
ruby-version: ${{ matrix.ruby }}
55+
rubygems: ${{ matrix.rubygems }}
56+
bundler: ${{ matrix.bundler }}
57+
bundler-cache: true
58+
- name: Tests
59+
run: bundle exec rspec

.github/workflows/coverage.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Code Coverage
2+
3+
env:
4+
K_SOUP_COV_MIN_BRANCH: 85
5+
K_SOUP_COV_MIN_LINE: 87
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
tags:
12+
- '!*' # Do not execute on tags
13+
pull_request:
14+
branches:
15+
- '*'
16+
# Allow manually triggering the workflow.
17+
workflow_dispatch:
18+
19+
# Cancels all previous workflow runs for the same branch that have not yet completed.
20+
concurrency:
21+
# The concurrency group contains the workflow name and the branch name.
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
test:
27+
name: Specs with Coverage - Ruby ${{ matrix.ruby }}
28+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
29+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
30+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
31+
CI_CODECOV: true
32+
COVER_ALL: true
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
experimental: [false]
37+
rubygems:
38+
- latest
39+
bundler:
40+
- latest
41+
gemfile:
42+
- coverage
43+
ruby:
44+
- "3.2"
45+
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v3
50+
51+
- name: Setup Ruby & Bundle
52+
uses: ruby/setup-ruby@v1
53+
with:
54+
ruby-version: ${{ matrix.ruby }}
55+
rubygems: ${{ matrix.rubygems }}
56+
bundler: ${{ matrix.bundler }}
57+
bundler-cache: true
58+
59+
- name: Run RSpec tests
60+
run: |
61+
bundle exec rspec
62+
63+
- name: Code Coverage Summary Report
64+
uses: irongut/CodeCoverageSummary@v1.3.0
65+
if: ${{ github.event_name == 'pull_request' }}
66+
with:
67+
filename: ./coverage/coverage.xml
68+
badge: true
69+
fail_below_min: true
70+
format: markdown
71+
hide_branch_rate: false
72+
hide_complexity: true
73+
indicators: true
74+
output: both
75+
# https://github.com/irongut/CodeCoverageSummary#thresholds
76+
thresholds: "75 85"
77+
continue-on-error: ${{ matrix.experimental != 'false' }}
78+
79+
- name: Add Coverage PR Comment
80+
uses: marocchino/sticky-pull-request-comment@v2
81+
if: ${{ github.event_name == 'pull_request' }}
82+
with:
83+
recreate: true
84+
path: code-coverage-results.md
85+
continue-on-error: ${{ matrix.experimental != 'false' }}
86+
87+
- name: Coveralls
88+
uses: coverallsapp/github-action@master
89+
with:
90+
github-token: ${{ secrets.GITHUB_TOKEN }}
91+
continue-on-error: ${{ matrix.experimental != 'false' }}

.github/workflows/legacy.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Legacy Ruby Support
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '!*' # Do not execute on tags
9+
pull_request:
10+
branches:
11+
- '*'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
# Cancels all previous workflow runs for the same branch that have not yet completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Ruby ${{ matrix.ruby }}
24+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
26+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
experimental: [false]
31+
rubygems:
32+
- "2.7.11"
33+
bundler:
34+
- none
35+
gemfile:
36+
- legacy
37+
ruby:
38+
- "2.6"
39+
- "2.5"
40+
- "2.4"
41+
runs-on: ubuntu-20.04
42+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v3
46+
- name: Setup Ruby & Bundle
47+
uses: ruby/setup-ruby@v1
48+
with:
49+
ruby-version: ${{ matrix.ruby }}
50+
rubygems: ${{ matrix.rubygems }}
51+
bundler: ${{ matrix.bundler }}
52+
bundler-cache: true
53+
- name: Run tests
54+
run: bundle exec rspec

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ spec/reports
1515
test/tmp
1616
test/version_tmp
1717
tmp
18+
gemfiles/*.gemfile.lock

.simplecov

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require "kettle/soup/cover/config"
2+
SimpleCov.start # you could do this somewhere else, up to you, but you do have to do it

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 2.3.8

.travis.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

Gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,16 @@ source 'https://rubygems.org'
22

33
# Specify your gem's dependencies in omniauth-jwt.gemspec
44
gemspec
5+
6+
# Development dependencies that rely on Ruby version >=
7+
# Style
8+
eval_gemfile "gemfiles/contexts/style.gemfile"
9+
10+
# Coverage
11+
eval_gemfile "gemfiles/contexts/coverage.gemfile"
12+
13+
# Testing
14+
eval_gemfile "gemfiles/contexts/testing.gemfile"
15+
16+
# Debug
17+
eval_gemfile "gemfiles/contexts/debug.gemfile"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[JSON Web Token](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html) (JWT) is a simple
66
way to send verified information between two parties online. This can be useful as a mechanism for
77
providing Single Sign-On (SSO) to an application by allowing an authentication server to send a validated
8-
claim and log the user in. This is how [Zendesk does SSO](https://support.zendesk.com/entries/23675367-Setting-up-single-sign-on-with-JWT-JSON-Web-Token-),
8+
claim and log the user in. This is how [Zendesk does SSO](https://support.zendesk.com/hc/en-us/articles/4408845838874-Enabling-JWT-JSON-Web-Token-single-sign-on),
99
for example.
1010

1111
OmniAuth::JWT provides a clean, simple wrapper on top of JWT so that you can easily implement this kind

0 commit comments

Comments
 (0)