yol_sso 0.0.3 → 0.0.4

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: 2c3f2e1cc0346af03c94b85bbfb307e76cd300052c54d260fe487301636c291f
4
- data.tar.gz: b3e900a79ef34098f2b56109c47c2e631e63ed59c68a785005713ea32a910f56
3
+ metadata.gz: 9e1f61ed7a0f4d0401361729c1779bbfc32c79b1aa76c263970bffa6d3f0d40e
4
+ data.tar.gz: 8bbd45b3d9ec88e6576ef71377363fa30fe10a6789cefc6a37d2102afa84eb4f
5
5
  SHA512:
6
- metadata.gz: 243b2e36f7513504cb5a3d0a37fd612bfbb3abf8ac0bdb084c87852cd627fbe90f19a31ef38fdde0d4256f1579483927ee74f15e0040af60931c935c3fc106aa
7
- data.tar.gz: c469cbe06c69678f0e45294ea7c3fa58011af33eef1bc141d1a55f014513dddce02a7dce9517c0ea8c9f0070e2c162781a71c263ffd2ca8b2f7a5adc87b5b43f
6
+ metadata.gz: 505ed8cda6c081733476b51a2f8c6d12d45121097163fc3944eeb8d51267ad1aab7c6b1b1552f7bee9c803465afcba3aa39d8642161985a985798223e93a96cd
7
+ data.tar.gz: a12ab17cd9a3ad1260dbe59261a30cf51159775cc2e4ad79c4f9bbc30da5604bca3217a2a4f34f8dc9806806f0949f435254c618beeeec27aeda5a9356bd4637
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.3)
4
+ yol_sso (0.0.4)
5
5
  multi_xml
6
6
  nokogiri
7
7
  roxml
@@ -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
@@ -0,0 +1,15 @@
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
+ private
9
+
10
+ def send_url
11
+ "#{host}messages"
12
+ end
13
+ end
14
+ end
15
+ 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.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - luojie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-06 00:00:00.000000000 Z
11
+ date: 2021-09-07 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