Skip to content

Commit 4431a28

Browse files
committed
Release Version 11.3.0
Release Version 11.3.0
1 parent 3b34ab6 commit 4431a28

File tree

11 files changed

+141
-22
lines changed

11 files changed

+141
-22
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
> **LoginRadius Ruby On Rails SDK Change Log** provides information regarding what has changed, more specifically what changes, improvements and bug fix has been made to the SDK. For more details please refer to the [LoginRadius API Documention](https://docs.loginradius.com/api/v2/sdk-libraries/ruby)
22
3+
4+
# Version 11.3.0
5+
Release on January 28, 2022
6+
7+
## Enhancements
8+
9+
- Added a feature to add ApiKey and ApiSecret directly in LoginRadius manual SOTT generation method.
10+
- Added Licence and Contribution Guideline file.
11+
12+
13+
## Breaking Changes
14+
15+
For developers migrating from v11.2.2, there will be 1 minor breaking change in terms of SDK implementation. In this version, we have added a feature to add ApiKey & ApiSecret directly into the manual SOTT generation method `local_generate_sott()`.
16+
317
# Version 11.2.2
418
Release on September 15, 2021
519

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing
2+
3+
[ROR SDK](https://github.com/LoginRadius/ruby-on-rails-sdk) is [MIT](LICENSE) licensed and accepts contributions via GitHub pull requests. This document outlines some of the conventions on development workflow, commit message formatting, contact points, and other resources to make it easier to get your contribution accepted.
4+
5+
## Getting Started
6+
7+
- Fork the repository on GitHub.
8+
- If you find any bug or Improvement in our existing code-base, please create a pull request as mentioned in Contribution Flow.
9+
10+
## Contribution Flow
11+
12+
This is a rough outline of what a contributor's workflow looks like:
13+
14+
- Create a separate branch from the `dev` branch to base your work.
15+
- Make commits of logical units.
16+
- Make sure your commit messages are in the proper format (see below).
17+
- Push your changes to a topic branch in your fork of the repository.
18+
- Submit a pull request to the original repository.
19+
- **Please ensure that you raise a PR on the `dev` branch instead of `master`.**
20+
21+
#### Commit Messages
22+
23+
Please follow the below format while writing commit messages:
24+
25+
```
26+
title: One line description about your change
27+
<Blank Line>
28+
description: An optional description of your changes.
29+
```
30+
31+
Thanks for your contributions!
32+
33+
## Code of Conduct
34+
35+
### Our Pledge
36+
37+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
38+
39+
### Our Responsibilities
40+
41+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Or
3535

3636

3737
````
38-
gem 'login_radius', '~> 11.2.2'
38+
gem 'login_radius', '~> 11.3.0'
3939
````
4040

4141

@@ -5210,7 +5210,23 @@ response = WebHookApi.web_hook_unsubscribe(web_hook_subscribe_model)
52105210
52115211
```
52125212

5213-
5213+
5214+
### Generate SOTT Manually
5215+
SOTT is a secure one-time token that can be created using the API key, API secret, and a timestamp ( start time and end time ). You can manually create a SOTT using the following function.
5216+
5217+
5218+
5219+
```
5220+
time_difference=10 # (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.
5221+
5222+
api_key="" # (Optional) LoginRadius Api Key.
5223+
5224+
api_secret="" # (Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually).
5225+
5226+
5227+
sott = AuthenticationApi.local_generate_sott(time_difference,api_key,api_secret);
5228+
print sott
5229+
```
52145230

52155231

52165232

demo/vendor/gems/login_radius/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Install the SDK by adding LoginRadius to your application's `Gemfile`.
44

55
```
6-
gem 'login_radius', '~> 11.2.2'
6+
gem 'login_radius', '~> 11.3.0'
77
```
88

99
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).

demo/vendor/gems/login_radius/lib/login_radius/request_client.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,20 +280,25 @@ def create_hash_secret(endpoint, secret_key, headers, body = {})
280280
end
281281

282282
# Local - Generate SOTT:
283-
# Generates a Secured One Time Token locally.
284-
#
285-
# @params validity_length [Integer] Length of time the SOTT is valid for in minutes
283+
# Generates a Secured One Time Token manually.
286284
#
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.
287288
# @returns sott [String] LoginRadius Secured One Time Token
288-
def local_generate_sott(validity_length = 10)
289-
start_time = Time.now.getutc().strftime('%Y/%m/%d %H:%M:%S')
290-
end_time = (Time.now.getutc() + (validity_length*60)).strftime('%Y/%m/%d %H:%M:%S')
289+
def local_generate_sott(time_difference = 10, api_key="", api_secret="")
290+
291+
key=!isNullOrWhiteSpace(api_key) ? api_key:ENV['API_KEY']
291292

292-
plain_text = start_time + '#' + ENV['API_KEY'] + '#' + end_time
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
293298
iter = 10000
294299
salt = "\x00\x00\x00\x00\x00\x00\x00\x00"
295300
key_len = KEY_SIZE / 8
296-
cipher_key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(ENV['API_SECRET'], salt, iter, key_len)
301+
cipher_key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(secret, salt, iter, key_len)
297302

298303
cipher = OpenSSL::Cipher.new('aes-' + KEY_SIZE.to_s + '-cbc')
299304
cipher.encrypt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module LoginRadius
2-
VERSION = "11.2.2"
2+
VERSION = "11.3.0"
33
end

sdk/src/login_radius/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

sdk/src/login_radius/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Install the SDK by adding LoginRadius to your application's `Gemfile`.
44

55
```
6-
gem 'login_radius', '~> 11.2.2'
6+
gem 'login_radius', '~> 11.3.0'
77
```
88

99
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).

sdk/src/login_radius/lib/login_radius/request_client.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,20 +280,25 @@ def create_hash_secret(endpoint, secret_key, headers, body = {})
280280
end
281281

282282
# Local - Generate SOTT:
283-
# Generates a Secured One Time Token locally.
284-
#
285-
# @params validity_length [Integer] Length of time the SOTT is valid for in minutes
283+
# Generates a Secured One Time Token manually.
286284
#
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.
287288
# @returns sott [String] LoginRadius Secured One Time Token
288-
def local_generate_sott(validity_length = 10)
289-
start_time = Time.now.getutc().strftime('%Y/%m/%d %H:%M:%S')
290-
end_time = (Time.now.getutc() + (validity_length*60)).strftime('%Y/%m/%d %H:%M:%S')
289+
def local_generate_sott(time_difference = 10, api_key="", api_secret="")
290+
291+
key=!isNullOrWhiteSpace(api_key) ? api_key:ENV['API_KEY']
291292

292-
plain_text = start_time + '#' + ENV['API_KEY'] + '#' + end_time
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
293298
iter = 10000
294299
salt = "\x00\x00\x00\x00\x00\x00\x00\x00"
295300
key_len = KEY_SIZE / 8
296-
cipher_key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(ENV['API_SECRET'], salt, iter, key_len)
301+
cipher_key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(secret, salt, iter, key_len)
297302

298303
cipher = OpenSSL::Cipher.new('aes-' + KEY_SIZE.to_s + '-cbc')
299304
cipher.encrypt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module LoginRadius
2-
VERSION = "11.2.2"
2+
VERSION = "11.3.0"
33
end

0 commit comments

Comments
 (0)