login_radius 11.2.2 → 11.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +19 -0
- data/README.md +1 -1
- data/lib/login_radius/request_client.rb +13 -8
- data/lib/login_radius/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1548a06b5a983aa27237e2a227f3c689f14fb510ad380764d93c562c68f60259
|
4
|
+
data.tar.gz: 4f37e09e9ed84615b939afca5c02ce0f4e20d91b312f665a3dafea42c4bd21cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e205518ba3bb793bc30745ac85ef18473e7b0af4d8888c7add521d1dfaf6152960715ae2af0ae6848d27e3fa67552fff8227b57f34fa6b41c249377fa91da2ae
|
7
|
+
data.tar.gz: e6889286f27fcbe71a12e4736015619a2d2472e546217fee7d022d420fbc42ebf9b8907d94265dfc4185f0bfb86f4f9a8d668fe7c678acf1a89ee33d0f8976f0
|
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2022 LoginRadius Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Install the SDK by adding LoginRadius to your application's `Gemfile`.
|
4
4
|
|
5
5
|
```
|
6
|
-
gem 'login_radius', '~> 11.
|
6
|
+
gem 'login_radius', '~> 11.3.0'
|
7
7
|
```
|
8
8
|
|
9
9
|
Then, run `$ bundle`. A copy of the SDK can also be found on our [Github](https://github.com/LoginRadius/ruby-on-rails-gem/tree/master).
|
@@ -280,20 +280,25 @@ module LoginRadius
|
|
280
280
|
end
|
281
281
|
|
282
282
|
# Local - Generate SOTT:
|
283
|
-
# Generates a Secured One Time Token
|
284
|
-
#
|
285
|
-
# @params validity_length [Integer] Length of time the SOTT is valid for in minutes
|
283
|
+
# Generates a Secured One Time Token manually.
|
286
284
|
#
|
285
|
+
# @params time_difference [Integer] (Optional)The time_difference will be used to set the expiration time of SOTT, If you do not pass time_difference then the default expiration time of SOTT is 10 minutes.
|
286
|
+
# @params api_key [String] (Optional) LoginRadius Api Key.
|
287
|
+
# @params api_secret [String] (Optional) LoginRadius Api Secret.
|
287
288
|
# @returns sott [String] LoginRadius Secured One Time Token
|
288
|
-
def local_generate_sott(
|
289
|
-
|
290
|
-
|
289
|
+
def local_generate_sott(time_difference = 10, api_key="", api_secret="")
|
290
|
+
|
291
|
+
key=!isNullOrWhiteSpace(api_key) ? api_key:ENV['API_KEY']
|
291
292
|
|
292
|
-
|
293
|
+
secret=!isNullOrWhiteSpace(api_secret) ? api_secret:ENV['API_SECRET']
|
294
|
+
|
295
|
+
start_time = Time.now.getutc().strftime('%Y/%m/%d %H:%M:%S')
|
296
|
+
end_time = (Time.now.getutc() + (time_difference*60)).strftime('%Y/%m/%d %H:%M:%S')
|
297
|
+
plain_text = start_time + '#' + key + '#' + end_time
|
293
298
|
iter = 10000
|
294
299
|
salt = "\x00\x00\x00\x00\x00\x00\x00\x00"
|
295
300
|
key_len = KEY_SIZE / 8
|
296
|
-
cipher_key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(
|
301
|
+
cipher_key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(secret, salt, iter, key_len)
|
297
302
|
|
298
303
|
cipher = OpenSSL::Cipher.new('aes-' + KEY_SIZE.to_s + '-cbc')
|
299
304
|
cipher.encrypt
|
data/lib/login_radius/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: login_radius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.
|
4
|
+
version: 11.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LoginRadius
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- LICENSE
|
48
49
|
- LICENSE.txt
|
49
50
|
- README.md
|
50
51
|
- lib/login_radius.rb
|