omniauth-jaccount 0.1.3 → 0.1.6.5

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
- SHA1:
3
- metadata.gz: cea20086b1caeff033d67b2b982fdab818d9669c
4
- data.tar.gz: 0dbb4661ce3752a1109c8f619667af811e660f2d
2
+ SHA256:
3
+ metadata.gz: 047c715e740975c5cc7196fc97a65a1a39364a89ab9e6ba47ae8d81e73bca9ad
4
+ data.tar.gz: 4e0c85effdd571dbeb5a80c7ea68d9e2648d1b483e50930fd696ba7dfdc5c3b5
5
5
  SHA512:
6
- metadata.gz: 23b23bdc4bec831582a1aa6ced677518513c942c8dc0236914d4b15d00d297293f2d659923f0c35f579f1e7b7b872b21b57a4320a27cb5028b35972b2b727196
7
- data.tar.gz: 1ee4748ef0cccbe7f7eb50131ce10bddada62e9acd4b1d36091e7a87483ee9def2ebfffb4ab93b9d1a2a0c377ac9f897f6d89eafebac0ab0b1b77723f40475fe
6
+ metadata.gz: 7c3c2fcf5c53c59d0f79488361217d1b498e0a9b0034cb9ee5e84c8c396d34826cb391f61d822f5ca645c3f16c27b63af6a14230a9d497755045164b1320e01a
7
+ data.tar.gz: fae2a9971ee88e27921c8fdf275d03f9010f46208bed22c511b6ba013f24a2b61a162adc042b14a53711df4aadafcd7e94147bd66474dfe51ef4d03c8080c5a7
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Omniauth::Jaccount
2
2
 
3
- More jAccount OAuth2.0 detail see <http://developer.sjtu.edu.cn/wiki/JAccount>
3
+ More jAccount OAuth2.0 detail see <http://developer.sjtu.edu.cn>
4
+
5
+ Omniauth detail see:<https://github.com/omniauth/omniauth>
4
6
 
5
7
  ## Installation
6
8
 
data/Rakefile CHANGED
@@ -1,6 +1,14 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # require "bundler/setup"
3
2
 
4
- RSpec::Core::RakeTask.new(:spec)
3
+ # require "bundler/gem_tasks"
5
4
 
6
- task :default => :spec
5
+ # require "rake/testtask"
6
+
7
+ # Rake::TestTask.new(:test) do |t|
8
+ # t.libs << 'test'
9
+ # t.pattern = 'test/**/*_test.rb'
10
+ # t.verbose = false
11
+ # t.warning = true
12
+ # end
13
+
14
+ # task default: :test
@@ -0,0 +1,4 @@
1
+ unless Rails.root.join("config/tailwind.config.js").exist?
2
+ say "Add default config/tailwindcss.config.js"
3
+ copy_file "#{__dir__}/tailwind.config.js", "config/tailwind.config.js"
4
+ end
@@ -0,0 +1,4 @@
1
+ Rails.application.config.middleware.use OmniAuth::Builder do
2
+ provider :developer if Rails.env.development?
3
+ provider :jaccount, ENV['JACCOUNT_APP_ID'], ENV['JACCOUNT_APP_SECRET'], scope: 'profile'
4
+ end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Jaccount
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.6.5"
4
4
  end
5
5
  end
@@ -4,34 +4,39 @@ module OmniAuth
4
4
  module Strategies
5
5
  class JAccount < OmniAuth::Strategies::OAuth2
6
6
  option :client_options, {
7
- :site => 'https://api.sjtu.edu.cn/v1',
8
- :authorize_url => 'https://jaccount.sjtu.edu.cn/oauth2/authorize',
9
- :token_url => 'https://jaccount.sjtu.edu.cn/oauth2/token'
7
+ site: 'https://api.sjtu.edu.cn/v1',
8
+ authorize_url: 'https://jaccount.sjtu.edu.cn/oauth2/authorize',
9
+ token_url: 'https://jaccount.sjtu.edu.cn/oauth2/token'
10
10
  }
11
11
 
12
- option :authorize_params, {scope: "essential"}
13
-
14
- def request_phase
15
- super
12
+ def authorize_params
13
+ super.tap do |params|
14
+ %w[scope client_options].each do |v|
15
+ params[v.to_sym] = request.params[v] if request.params[v]
16
+ end
17
+ end
16
18
  end
17
19
 
18
- uid { raw_info["id"].to_s }
20
+ uid { raw_info['id'].to_s }
19
21
 
20
22
  info do
21
23
  {
22
- 'email' => raw_info['account'] + "@sjtu.edu.cn",
23
- 'name' => raw_info['name']
24
+ 'email': raw_info['email'],
25
+ 'name': raw_info['name'],
26
+ 'account': raw_info['account'],
27
+ 'code': raw_info['code'],
28
+ 'organize': raw_info['organize'],
29
+ 'top_organize': raw_info['top_organize'],
30
+ 'userType': raw_info['userType']
24
31
  }
25
32
  end
26
33
 
27
34
  extra do
28
- {:raw_info => raw_info}
35
+ { raw_info: raw_info }
29
36
  end
30
37
 
31
38
  def raw_info
32
- @raw_info ||= access_token.get('https://api.sjtu.edu.cn/v1/me/profile').parsed
33
- #puts @raw_info
34
- @raw_info["entities"][0]
39
+ @raw_info ||= access_token.get('https://api.sjtu.edu.cn/v1/me/profile').parsed['entities'].first
35
40
  end
36
41
 
37
42
  def callback_url
@@ -1,2 +1,2 @@
1
- require "omniauth/jaccount/version"
2
- require "omniauth/strategies/jaccount"
1
+ require 'omniauth/jaccount/version'
2
+ require 'omniauth/strategies/jaccount'
@@ -0,0 +1,10 @@
1
+ namespace :omniauth_jaccount do
2
+ desc "Install controller, config into the app"
3
+ task :install do
4
+ # copy install/omniauth.rb to config/initi...
5
+ # unless Rails.root.join("config/initializers/omniauth.rb").exist?
6
+ # say "Add default config/initializers/omniauth.rb"
7
+ # copy_file "#{__dir__}/../install/omniauth.rb ", "config/initializers/omniauth.rb"
8
+ # end
9
+ end
10
+ end
metadata CHANGED
@@ -1,109 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-jaccount
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - feynixs
8
- autorequire:
9
- bindir: exe
8
+ autorequire:
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-15 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: railties
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.16'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '10.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '10.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
47
+ version: 6.0.0
48
+ type: :runtime
77
49
  prerelease: false
78
50
  version_requirements: !ruby/object:Gem::Requirement
79
51
  requirements:
80
- - - "~>"
52
+ - - ">="
81
53
  - !ruby/object:Gem::Version
82
- version: '3.0'
83
- description:
54
+ version: 6.0.0
55
+ description:
84
56
  email:
85
57
  - feynixs@gmail.com
86
58
  executables: []
87
59
  extensions: []
88
60
  extra_rdoc_files: []
89
61
  files:
90
- - ".gitignore"
91
- - ".rspec"
92
- - ".travis.yml"
93
- - Gemfile
94
- - Gemfile.lock
95
62
  - README.md
96
63
  - Rakefile
97
- - bin/console
98
- - bin/setup
64
+ - lib/install/init.rb
65
+ - lib/install/omniauth.rb
99
66
  - lib/omniauth-jaccount.rb
100
67
  - lib/omniauth/jaccount/version.rb
101
68
  - lib/omniauth/strategies/jaccount.rb
102
- - omniauth-jaccount.gemspec
103
- homepage:
69
+ - lib/tasks/install.rake
70
+ homepage: ''
104
71
  licenses: []
105
72
  metadata: {}
106
- post_install_message:
73
+ post_install_message:
107
74
  rdoc_options: []
108
75
  require_paths:
109
76
  - lib
@@ -118,9 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
85
  - !ruby/object:Gem::Version
119
86
  version: '0'
120
87
  requirements: []
121
- rubyforge_project:
122
- rubygems_version: 2.6.8
123
- signing_key:
88
+ rubygems_version: 3.4.21
89
+ signing_key:
124
90
  specification_version: 4
125
91
  summary: omniauth for jaccount
126
92
  test_files: []
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.3.1
7
- before_install: gem install bundler -v 1.16.4
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in omniauth-jaccount.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,57 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- omniauth-jaccount (0.1.2)
5
- omniauth (~> 1.0)
6
- omniauth-oauth2 (~> 1.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- diff-lcs (1.3)
12
- faraday (0.15.4)
13
- multipart-post (>= 1.2, < 3)
14
- hashie (3.6.0)
15
- jwt (2.1.0)
16
- multi_json (1.13.1)
17
- multi_xml (0.6.0)
18
- multipart-post (2.0.0)
19
- oauth2 (1.4.1)
20
- faraday (>= 0.8, < 0.16.0)
21
- jwt (>= 1.0, < 3.0)
22
- multi_json (~> 1.3)
23
- multi_xml (~> 0.5)
24
- rack (>= 1.2, < 3)
25
- omniauth (1.9.0)
26
- hashie (>= 3.4.6, < 3.7.0)
27
- rack (>= 1.6.2, < 3)
28
- omniauth-oauth2 (1.6.0)
29
- oauth2 (~> 1.1)
30
- omniauth (~> 1.9)
31
- rack (2.0.5)
32
- rake (10.4.2)
33
- rspec (3.8.0)
34
- rspec-core (~> 3.8.0)
35
- rspec-expectations (~> 3.8.0)
36
- rspec-mocks (~> 3.8.0)
37
- rspec-core (3.8.0)
38
- rspec-support (~> 3.8.0)
39
- rspec-expectations (3.8.2)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.8.0)
42
- rspec-mocks (3.8.0)
43
- diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.8.0)
45
- rspec-support (3.8.0)
46
-
47
- PLATFORMS
48
- ruby
49
-
50
- DEPENDENCIES
51
- bundler (~> 1.16)
52
- omniauth-jaccount!
53
- rake (~> 10.0)
54
- rspec (~> 3.0)
55
-
56
- BUNDLED WITH
57
- 1.16.4
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "omniauth/jaccount"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,29 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "omniauth/jaccount/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "omniauth-jaccount"
8
- spec.version = Omniauth::Jaccount::VERSION
9
- spec.authors = ["feynixs"]
10
- spec.email = ["feynixs@gmail.com"]
11
-
12
- spec.summary = %q{omniauth for jaccount}
13
-
14
-
15
- # Specify which files should be added to the gem when it is released.
16
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
18
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- end
20
- spec.bindir = "exe"
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
- spec.require_paths = ["lib"]
23
-
24
- spec.add_dependency 'omniauth', '~> 1.0'
25
- spec.add_dependency 'omniauth-oauth2', '~> 1.0'
26
- spec.add_development_dependency "bundler", "~> 1.16"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rspec", "~> 3.0"
29
- end