omniauth-open-edx 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bb707284e879a220930aee4a98fa14c4a4e06a4067b8d87719ad4045628eb6d
4
- data.tar.gz: fd39ed5c00099c6dd0fe100da9f95d436f5e92be21eec266ef254765115e6df9
3
+ metadata.gz: e6958f4c987eebe5015422f90474856d4eb163ce989291bd1262b6c1514431c2
4
+ data.tar.gz: 21752ad436c7f4a27280cd00b75385ff89b95df82fe2345df6530fec0ee062bf
5
5
  SHA512:
6
- metadata.gz: 2ee47db6426bfa6c05725e6e08b24b97bf89def9bfa886ef64350a56653a1bba9e83d050af520f81d7172b51d65607dccaf002da7f42933cc41e8bed2ae03f5e
7
- data.tar.gz: 97796ee6bca64e35c4418549dc6c2c6497aeffa7ab26a2a93ea973d1206fb51cc8fe468e1a4a80e21b38fcca9ea0f0853eb12a2309b3429ce26bfae8f1b642d8
6
+ metadata.gz: 18c004388b91ad328220e2ba685807e81171532cfdfbf1ef8d337379d707bced457d18bcd17982c04e71afb195388a3ae259d6264d23444268d5da11a59b6746
7
+ data.tar.gz: 3aa2ac93282db9d54efd66cabc489c4524bed6531ff169b4ec2707cb58d0763308ac8a31a26947a00bd7b747e66d6348b014d8e584f0ebfb34bb61f2e5eac90d
@@ -0,0 +1,32 @@
1
+ name: validate
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ style:
10
+ name: code style
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 2.7
17
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
18
+ - run: bundle exec rbprettier --check .
19
+
20
+ test:
21
+ name: test
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby: ["2.4", "2.5", "2.6", "2.7"]
26
+ steps:
27
+ - uses: actions/checkout@v2
28
+ - uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
32
+ - run: bundle exec rake
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  Gemfile.lock
10
+ *.gem
10
11
 
11
12
  # rspec failure tracking
12
13
  .rspec_status
data/.prettierignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /pkg/
6
+ /spec/reports/
7
+ /tmp/
8
+ /vendor/
9
+ Gemfile.lock
@@ -2,4 +2,6 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
+ gem "sinatra", ">= 2.0"
6
+ gem "omniauth", ">= 2.0"
5
7
  gem "omniauth-open-edx", path: "../../"
@@ -1,14 +1,19 @@
1
1
  begin
2
2
  require "sinatra"
3
+ require "securerandom"
3
4
  require "omniauth"
4
5
  require "omniauth-open-edx"
5
6
  rescue LoadError
6
7
  require "rubygems"
8
+ require "securerandom"
7
9
  require "sinatra"
8
10
  require "omniauth"
9
11
  require "omniauth-open-edx"
10
12
  end
11
13
 
14
+ set sessions: true
15
+ set :session_secret, ENV.fetch("SESSION_SECRET") { SecureRandom.hex(64) }
16
+
12
17
  use Rack::Session::Cookie
13
18
  use OmniAuth::Builder do
14
19
  provider :open_edx,
@@ -17,14 +22,17 @@ use OmniAuth::Builder do
17
22
  {
18
23
  scope: "profile email",
19
24
  client_options: {
20
- site: "https://courses.edx.org"
25
+ site: "https://courses.michael-juniper.skillsnetwork.site"
21
26
  }
22
27
  }
23
28
  end
24
29
 
25
30
  get "/" do
26
31
  <<-HTML
27
- <a href='/auth/open_edx'>Sign in with Open edX</a>
32
+ <form method='post' action='/auth/open_edx'>
33
+ <input type="hidden" name="authenticity_token" value='#{request.env["rack.session"]["csrf"]}'>
34
+ <button type='submit'>Sign in with Open edX</button>
35
+ </form>
28
36
  HTML
29
37
  end
30
38
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module OpenEdx
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency "jwt", ">= 2.0"
32
- spec.add_dependency "omniauth", [">= 1.9", "< 2"]
32
+ spec.add_dependency "omniauth", [">= 1.9", "< 3"]
33
33
  spec.add_dependency "omniauth-oauth2", ">= 1.4"
34
34
 
35
35
  spec.add_development_dependency "bundler", ">= 2.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-open-edx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Lin
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '1.9'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '2'
36
+ version: '3'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '1.9'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '2'
46
+ version: '3'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: omniauth-oauth2
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,9 @@ extensions: []
164
164
  extra_rdoc_files: []
165
165
  files:
166
166
  - ".editorconfig"
167
+ - ".github/workflows/validate.yml"
167
168
  - ".gitignore"
169
+ - ".prettierignore"
168
170
  - ".prettierrc.yml"
169
171
  - ".rspec"
170
172
  - ".rubocop.yml"