Skip to content

Commit

Permalink
Version 10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Agarwal-Sudhanshu committed Sep 30, 2019
1 parent f296282 commit 4d4ba08
Show file tree
Hide file tree
Showing 54 changed files with 3,130 additions and 877 deletions.
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

npm-debug.log
prepros.cfg
.DS_Store
.idea/

/nbproject/private/
nbproject/project.properties
nbproject/project.xml
/sdk-node-js-customer-identity/nbproject/private/
__pycache__/
*.py[cod]
*$py.class

.installed.cfg
bin
develop-eggs
dist
downloads
eggs
parts
src/*.egg-info
lib64
77 changes: 75 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,81 @@
# LoginRadius Python SDK Change Log

# Version 10.0.0-beta
# Version 10.0.0
Release on **September 30,2019**

## Enhancements
This beta version release includes major changes with several improvements and optimizations :
This full version release includes major breaking changes with several improvements and optimizations :

- Enhanced the coding standards of SDK to follow industry programming styles and best practices.
- Enhanced security standards of SDK.
- Reduced code between the business layer and persistence layer for optimization of SDK performance.
- Added internal parameter validations in the API function.
- ApiKey and ApiSecret usage redundancy removed.
- All LoginRadius related features need to be defined once only and SDK will handle them automatically.
- Improved the naming conventions of API functions for better readability.
- Better Exception Handling for LoginRadius API Response in SDK.
- Revamped complete SDK and restructured it with latest API function names and parameters.
- Added detailed description to API functions and parameters for better understanding.
- Updated the demo according to latest SDK changes.
- Implemented API Region Feature.
- Added PIN Authentication feature APIs.
- Added Consent Management feature APIs.
- Added Local SOTT generation


## Added new multiple APIs for better user experience

- Update Phone ID by UID
- Upsert Email
- Role Context profile
- MFA Resend OTP
- User Registration By Captcha
- Get Access Token via Linkedin Token
- Get Access Token By Foursquare Access Token
- Get Active Session By Account Id
- Get Active Session By Profile Id
- Delete User Profiles By Email
- Verify Multifactor OTP Authentication
- Verify Multifactor Password Authentication
- Verify Multifactor PIN Authentication
- Update UID
- MFA Re-authentication by PIN
- PIN Login
- Forgot PIN By Email
- Forgot PIN By UserName
- Reset PIN By ResetToken
- Reset PIN By SecurityAnswer And Email
- Reset PIN By SecurityAnswer And Username
- Reset PIN By SecurityAnswer And Phone
- Forgot PIN By Phone
- Change PIN By Token
- Reset PIN by Phone and OTP
- Reset PIN by Email and OTP
- Reset PIN by Username and OTP
- Set PIN By PinAuthToken
- Invalidate PIN Session Token
- Submit Consent By ConsentToken
- Get Consent Logs
- Submit Consent By AccessToken
- Verify Consent By AccessToken
- Update Consent Profile By AccessToken
- Get Consent Logs By Uid
- Album With Cursor
- Audio With Cursor
- Check In With Cursor
- Event With Cursor
- Following With Cursor
- Group With Cursor
- Like With Cursor


## Removed APIs:

- GetCompanies API
- Getstatus API

# Version 10.0.0-beta
## This beta version release includes major changes with several improvements and optimizations :
- Enhanced the coding standards of SDK to follow industry programming styles and best practices.
- Enhanced security standards of SDK.
- Reduced code between the business layer and persistence layer for optimization of SDK performance.
Expand Down
Empty file.
Empty file.
51 changes: 49 additions & 2 deletions Demo/LoginRadius/api/account/account_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#

Expand Down Expand Up @@ -315,7 +315,7 @@ def invalidate_account_email_verification(self, uid, email_template='', verifica
return self._lr_object.execute("PUT", resource_path, query_parameters, None)

def get_forgot_password_token(self, email, email_template=None, reset_password_url=None,
send_email=False):
send_email=None):
"""This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body.
Args:
Expand Down Expand Up @@ -544,3 +544,50 @@ def get_account_identities_by_email(self, email, fields=''):

resource_path = "identity/v2/manage/account/identities"
return self._lr_object.execute("GET", resource_path, query_parameters, None)

def account_delete_by_email(self, email):
"""This API is used to delete all user profiles associated with an Email.
Args:
email: Email of the user
Returns:
Response containing Definition of Delete Request
18.36
"""

if(self._lr_object.is_null_or_whitespace(email)):
raise Exception(self._lr_object.get_validation_message("email"))

query_parameters = {}
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["apiSecret"] = self._lr_object.get_api_secret()
query_parameters["email"] = email

resource_path = "identity/v2/manage/account"
return self._lr_object.execute("DELETE", resource_path, query_parameters, None)

def account_update_uid(self, update_uid_model, uid):
"""This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid.
Args:
update_uid_model: Payload containing Update UID
uid: UID, the unified identifier for each user account
Returns:
Response containing Definition of Complete Validation data
18.41
"""
if(update_uid_model is None):
raise Exception(self._lr_object.get_validation_message("update_uid_model"))

if(self._lr_object.is_null_or_whitespace(uid)):
raise Exception(self._lr_object.get_validation_message("uid"))

query_parameters = {}
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["apiSecret"] = self._lr_object.get_api_secret()
query_parameters["uid"] = uid

resource_path = "identity/v2/manage/account/uid"
return self._lr_object.execute("PUT", resource_path, query_parameters, update_uid_model)
2 changes: 1 addition & 1 deletion Demo/LoginRadius/api/account/role_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#

Expand Down
2 changes: 1 addition & 1 deletion Demo/LoginRadius/api/account/sott_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion Demo/LoginRadius/api/advanced/configuration_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#

Expand Down
155 changes: 155 additions & 0 deletions Demo/LoginRadius/api/advanced/consentmanagement_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#


class ConsentManagementApi:

def __init__(self, lr_object):
"""
:param lr_object: this is the reference to the parent LoginRadius object.
"""
self._lr_object = lr_object

def get_consent_logs_by_uid(self, uid):
"""This API is used to get the Consent logs of the user.
Args:
uid: UID, the unified identifier for each user account
Returns:
Response containing consent logs
18.37
"""

if(self._lr_object.is_null_or_whitespace(uid)):
raise Exception(self._lr_object.get_validation_message("uid"))

query_parameters = {}
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["apiSecret"] = self._lr_object.get_api_secret()

resource_path = "identity/v2/manage/account/" + uid + "/consent/logs"
return self._lr_object.execute("GET", resource_path, query_parameters, None)

def submit_consent_by_consent_token(self, consent_token, consent_submit_model):
"""This API is to submit consent form using consent token.
Args:
consent_token: The consent token received after login error 1226
consent_submit_model: Model class containing list of multiple consent
Returns:
Response containing User Profile Data and access token
43.1
"""

if(self._lr_object.is_null_or_whitespace(consent_token)):
raise Exception(self._lr_object.get_validation_message("consent_token"))
if(consent_submit_model is None):
raise Exception(self._lr_object.get_validation_message("consent_submit_model"))

query_parameters = {}
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["consentToken"] = consent_token

resource_path = "identity/v2/auth/consent"
return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model)

def get_consent_logs(self, access_token):
"""This API is used to fetch consent logs.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
Returns:
Response containing consent logs
43.2
"""

if(self._lr_object.is_null_or_whitespace(access_token)):
raise Exception(self._lr_object.get_validation_message("access_token"))

query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()

resource_path = "identity/v2/auth/consent/logs"
return self._lr_object.execute("GET", resource_path, query_parameters, None)

def submit_consent_by_access_token(self, access_token, consent_submit_model):
"""API to provide a way to end user to submit a consent form for particular event type.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
consent_submit_model: Model class containing list of multiple consent
Returns:
Response containing Definition for Complete profile data
43.3
"""

if(self._lr_object.is_null_or_whitespace(access_token)):
raise Exception(self._lr_object.get_validation_message("access_token"))
if(consent_submit_model is None):
raise Exception(self._lr_object.get_validation_message("consent_submit_model"))

query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()

resource_path = "identity/v2/auth/consent/profile"
return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model)

def verify_consent_by_access_token(self, access_token, event, is_custom):
"""This API is used to check if consent is submitted for a particular event or not.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
event: Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
is_custom: true/false
Returns:
Response containing consent profile
43.4
"""

if(self._lr_object.is_null_or_whitespace(access_token)):
raise Exception(self._lr_object.get_validation_message("access_token"))

if(self._lr_object.is_null_or_whitespace(event)):
raise Exception(self._lr_object.get_validation_message("event"))

query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["event"] = event
query_parameters["isCustom"] = is_custom

resource_path = "identity/v2/auth/consent/verify"
return self._lr_object.execute("GET", resource_path, query_parameters, None)

def update_consent_profile_by_access_token(self, access_token, consent_update_model):
"""This API is to update consents using access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
consent_update_model: Model class containg list of multiple consent
Returns:
Response containing consent profile
43.5
"""

if(self._lr_object.is_null_or_whitespace(access_token)):
raise Exception(self._lr_object.get_validation_message("access_token"))
if(consent_update_model is None):
raise Exception(self._lr_object.get_validation_message("consent_update_model"))

query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()

resource_path = "identity/v2/auth/consent"
return self._lr_object.execute("PUT", resource_path, query_parameters, consent_update_model)
6 changes: 3 additions & 3 deletions Demo/LoginRadius/api/advanced/customobject_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#

Expand Down Expand Up @@ -42,7 +42,7 @@ def create_custom_object_by_token(self, access_token, object_name, payload):
return self._lr_object.execute("POST", resource_path, query_parameters, payload)

def update_custom_object_by_token(self, access_token, object_name, object_record_id,
payload, update_type=''):
payload, update_type=None):
"""This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
Args:
Expand Down Expand Up @@ -194,7 +194,7 @@ def create_custom_object_by_uid(self, object_name, payload, uid):
return self._lr_object.execute("POST", resource_path, query_parameters, payload)

def update_custom_object_by_uid(self, object_name, object_record_id, payload,
uid, update_type=''):
uid, update_type=None):
"""This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
Args:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- coding: utf-8 --
# Created by LoginRadius Development Team
# Created by LoginRadius Development Team
# Copyright 2019 LoginRadius Inc. All rights reserved.
#

Expand Down
Loading

0 comments on commit 4d4ba08

Please sign in to comment.