-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f296282
commit 4d4ba08
Showing
54 changed files
with
3,130 additions
and
877 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.