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 +5 -5
- data/README.md +3 -1
- data/Rakefile +12 -4
- data/lib/install/init.rb +4 -0
- data/lib/install/omniauth.rb +4 -0
- data/lib/omniauth/jaccount/version.rb +1 -1
- data/lib/omniauth/strategies/jaccount.rb +19 -14
- data/lib/omniauth-jaccount.rb +2 -2
- data/lib/tasks/install.rake +10 -0
- metadata +26 -60
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -7
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -57
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/omniauth-jaccount.gemspec +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 047c715e740975c5cc7196fc97a65a1a39364a89ab9e6ba47ae8d81e73bca9ad
|
|
4
|
+
data.tar.gz: 4e0c85effdd571dbeb5a80c7ea68d9e2648d1b483e50930fd696ba7dfdc5c3b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c3c2fcf5c53c59d0f79488361217d1b498e0a9b0034cb9ee5e84c8c396d34826cb391f61d822f5ca645c3f16c27b63af6a14230a9d497755045164b1320e01a
|
|
7
|
+
data.tar.gz: fae2a9971ee88e27921c8fdf275d03f9010f46208bed22c511b6ba013f24a2b61a162adc042b14a53711df4aadafcd7e94147bd66474dfe51ef4d03c8080c5a7
|
data/README.md
CHANGED
data/Rakefile
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
require "bundler/
|
|
2
|
-
require "rspec/core/rake_task"
|
|
1
|
+
# require "bundler/setup"
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
# require "bundler/gem_tasks"
|
|
5
4
|
|
|
6
|
-
|
|
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
|
data/lib/install/init.rb
ADDED
|
@@ -4,34 +4,39 @@ module OmniAuth
|
|
|
4
4
|
module Strategies
|
|
5
5
|
class JAccount < OmniAuth::Strategies::OAuth2
|
|
6
6
|
option :client_options, {
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
:
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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[
|
|
20
|
+
uid { raw_info['id'].to_s }
|
|
19
21
|
|
|
20
22
|
info do
|
|
21
23
|
{
|
|
22
|
-
'email'
|
|
23
|
-
'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
|
|
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
|
data/lib/omniauth-jaccount.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
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.
|
|
4
|
+
version: 0.1.6.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- feynixs
|
|
8
|
-
autorequire:
|
|
9
|
-
bindir:
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
40
|
+
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: railties
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
48
|
-
type: :
|
|
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:
|
|
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
|
-
-
|
|
98
|
-
-
|
|
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
|
-
-
|
|
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
|
-
|
|
122
|
-
|
|
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
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
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
data/omniauth-jaccount.gemspec
DELETED
|
@@ -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
|