yol_sso 0.0.2 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b1f44cf4dba4d8a8a63c05d3af3840323fde03f1d49a3d1505298b7dd17a3d0
4
- data.tar.gz: ee395608e63571c22ea980fe32f29d7fa76069d0ff2d138ef82c7015718dcd38
3
+ metadata.gz: 598864578d8e9723f9c0e1ec90166d902354daa4c1170dd0765352e93d56a980
4
+ data.tar.gz: 62395714806da64948fc6ca03c44df5b3d720bffc9cca2fdfbd598d4bf222a20
5
5
  SHA512:
6
- metadata.gz: 8ee8d5edcbe2eff7b8241ea36e0b148633e312b2b3524afc642ac0153692ade4c4f62419f512642bd93158d7d71ae506e708ab8bc1127bfedece91971f3dfa5a
7
- data.tar.gz: d764e1ce2bd511eb87e7374e4579213a109d04e354b246226d29f03f2c129066a9494629cac94e503ffb5f8a4c7c30240b47e181854a15d87680495e31d9cb05
6
+ metadata.gz: c509d8f4b312375bc9e33a80d3b3c1e09d5a40582dea081ed01637d9cdc1cd3dcbfe8d3f26f8871e442356690bb51dece50bf5e5430a916c157c550348ecdf58
7
+ data.tar.gz: 68ad61782b91acceb2caf1eb2fa0e8adbfc5c1d66880433d1824b1d2c2f76b4f8f9892ee890f2b63a396bdfb96927a361ce656a8b6c7350e43ded4ce172c361e
data/.gitignore ADDED
@@ -0,0 +1,68 @@
1
+ .idea
2
+ *.gem
3
+ *.rbc
4
+ *.DS_Store
5
+ *.swp
6
+ Gemfile.lock
7
+ GemfileLocal
8
+ GemfileLocal.lock
9
+
10
+ # Ignore all logfiles and tempfiles.
11
+ /log/*
12
+ /tmp/*
13
+ !/log/.keep
14
+ !/tmp/.keep
15
+
16
+ # TODO Comment out this rule if you are OK with secrets being uploaded to the repo
17
+ config/initializers/secret_token.rb
18
+ config/master.key
19
+
20
+ # Only include if you have production secrets in this file, which is no longer a Rails default
21
+ # config/secrets.yml
22
+
23
+ # dotenv
24
+ # TODO Comment out this rule if environment variables can be committed
25
+ .env
26
+
27
+ ## Environment normalization:
28
+ /.bundle
29
+ /vendor/bundle
30
+
31
+ # these should all be checked in to normalize the environment:
32
+ # Gemfile.lock, .ruby-version, .ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
36
+
37
+ # if using bower-rails ignore default bower_components path bower.json files
38
+ /vendor/assets/bower_components
39
+ *.bowerrc
40
+ bower.json
41
+
42
+ # Ignore pow environment settings
43
+ .powenv
44
+
45
+ # Ignore Byebug command history file.
46
+ .byebug_history
47
+
48
+ # Ignore node_modules
49
+ node_modules/
50
+
51
+ # Ignore precompiled javascript packs
52
+ /public/packs
53
+ /public/packs-test
54
+ /public/assets
55
+
56
+ # Ignore yarn files
57
+ /yarn-error.log
58
+ yarn-debug.log*
59
+ .yarn-integrity
60
+
61
+ # Ignore uploaded files in development
62
+ /storage/*
63
+ !/storage/.keep
64
+
65
+
66
+
67
+
68
+
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yol_sso (0.0.2)
4
+ yol_sso (0.0.6)
5
5
  multi_xml
6
6
  nokogiri
7
7
  roxml
@@ -20,11 +20,11 @@ GEM
20
20
  concurrent-ruby (~> 1.0)
21
21
  minitest (5.14.4)
22
22
  multi_xml (0.6.0)
23
- nokogiri (1.11.7-x86_64-darwin)
23
+ nokogiri (1.12.4-x86_64-darwin)
24
24
  racc (~> 1.4)
25
25
  racc (1.5.2)
26
26
  rake (13.0.1)
27
- roxml (4.1.1)
27
+ roxml (4.2.0)
28
28
  activesupport (>= 4.0)
29
29
  nokogiri (>= 1.3.3)
30
30
  thread_safe (0.3.6)
@@ -1,19 +1,19 @@
1
1
  require "monitor"
2
2
  require "redis"
3
3
  require 'digest/md5'
4
- module YolSso
4
+ module YolSso
5
5
  class Client
6
6
 
7
7
  include Connection::Base
8
8
  include Connection::Message
9
+ include Connection::User
9
10
 
10
- attr_accessor :host
11
-
12
- attr_accessor :agentid
11
+ attr_accessor :host, :agentid, :redis
13
12
 
14
13
  def initialize(options = {})
15
- @host = options[:host] || Sso.configuration.host
16
- @agentid = options[:agentid] || Sso.configuration.agentid
14
+ @host = options[:host] || YolSso.configuration.host
15
+ @agentid = options[:agentid] || YolSso.configuration.agentid
16
+ @redis = options[:redis] || YolSso.configuration.redis
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -5,8 +5,7 @@ module YolSso
5
5
  http_post(send_url, body.merge("agentid": agentid))
6
6
  end
7
7
 
8
- def deal_message(message_id)
9
- body = {agentid: agentid, message_id: message_id}
8
+ def deal_message(body)
10
9
  http_post(deal_url, body.merge("agentid": agentid))
11
10
  end
12
11
 
@@ -0,0 +1,23 @@
1
+ module YolSso
2
+ module Connection
3
+ module User
4
+ def get_user(userid)
5
+ JSON.parse(redis.get("userinfo_#{userid}")) rescue nil
6
+ end
7
+
8
+ def get_menus(userid)
9
+ JSON.parse(redis.get("menus_#{agentid}_#{userid}")) rescue nil
10
+ end
11
+
12
+ def get_api_list(userid)
13
+ JSON.parse(redis.get("accesses_#{agentid}_#{userid}")) rescue nil
14
+ end
15
+
16
+ private
17
+
18
+ def send_url
19
+ "#{host}messages"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,11 +1,13 @@
1
1
  module YolSso
2
2
  class Configuration
3
3
 
4
- OPTIONS = [:host, :agentid].freeze
4
+ OPTIONS = [:host, :agentid, :redis].freeze
5
5
 
6
6
  attr_accessor :host
7
7
 
8
8
  attr_accessor :agentid
9
9
 
10
+ attr_accessor :redis
11
+
10
12
  end
11
13
  end
@@ -1,3 +1,3 @@
1
1
  module YolSso
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yol_sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - luojie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-29 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".DS_Store"
91
+ - ".gitignore"
91
92
  - Gemfile
92
93
  - Gemfile.lock
93
94
  - LICENSE.txt
@@ -98,6 +99,7 @@ files:
98
99
  - lib/yol_sso/connection.rb
99
100
  - lib/yol_sso/connections/base.rb
100
101
  - lib/yol_sso/connections/message.rb
102
+ - lib/yol_sso/connections/user.rb
101
103
  - lib/yol_sso/helpers/pkcs7_encoder.rb
102
104
  - lib/yol_sso/helpers/prpcrypt.rb
103
105
  - lib/yol_sso/models/configuration.rb