Skip to content

Commit 7eb32dd

Browse files
authored
Merge pull request #51 from LoginRadius/python-sdk11.7.0
Python sdk11.7.0
2 parents 4e08521 + 5425f5f commit 7eb32dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+318
-120
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# LoginRadius Python SDK Change Log
22

3+
4+
# Version 11.7.0
5+
6+
**Release Date:** March 29, 2025
7+
8+
## Enhancements
9+
10+
We've introduced a brand-new set of Webhook APIs, designed with enhanced functionality and flexibility. These new APIs support advanced features including:
11+
12+
- Custom header configuration
13+
- Query parameter support
14+
- Webhook authentication methods (Bearer Token and Basic Auth)
15+
- Support for a custom `Name` parameter to label each webhook subscription
16+
17+
As part of this upgrade, the legacy Webhook APIs have been deprecated in favor of the new, more robust versions.
18+
19+
## Newly Added APIs
20+
21+
- `get_webhook_subscription_detail` – Retrieve detailed information about a specific webhook subscription
22+
- `create_webhook_subscription` – Create a new webhook subscription with advanced configuration options
23+
- `delete_webhook_subscription` – Remove an existing webhook subscription
24+
- `update_webhook_subscription` – Modify an existing webhook subscription
25+
- `list_all_webhooks` – Retrieve a list of all configured webhook subscriptions
26+
- `get_webhook_events` – Fetch available webhook events supported by the system
27+
28+
## Deprecated APIs
29+
30+
The following legacy APIs have been deprecated:
31+
32+
- `web_hook_subscribe`
33+
- `webhook_test`
34+
- `web_hook_unsubscribe`
35+
- `get_web_hook_subscribed_u_r_ls`
36+
337
# Version 11.6.0
438

539
Release on **July 16, 2024**

Demo/LoginRadius/api/account/account_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/account/role_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/account/sott_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/advanced/configuration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/advanced/consentmanagement_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/advanced/customobject_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/advanced/multifactorauthentication_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Demo/LoginRadius/api/advanced/reauthentication_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- coding: utf-8 --
22
# Created by LoginRadius Development Team
3-
# Copyright 2019 LoginRadius Inc. All rights reserved.
3+
# Copyright 2025 LoginRadius Inc. All rights reserved.
44
#
55

66

@@ -12,36 +12,35 @@ def __init__(self, lr_object):
1212
"""
1313
self._lr_object = lr_object
1414

15-
def get_web_hook_subscribed_u_r_ls(self, event):
16-
"""This API is used to fatch all the subscribed URLs, for particular event
15+
def get_webhook_subscription_detail(self, hook_id):
16+
"""This API is used to get details of a webhook subscription by Id
1717
1818
Args:
19-
event: Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
19+
hook_id: Unique ID of the webhook
2020
2121
Returns:
22-
Response Containing List of Webhhook Data
22+
Response containing Definition for Complete WebHook data
2323
40.1
2424
"""
2525

26-
if(self._lr_object.is_null_or_whitespace(event)):
27-
raise Exception(self._lr_object.get_validation_message("event"))
26+
if(self._lr_object.is_null_or_whitespace(hook_id)):
27+
raise Exception(self._lr_object.get_validation_message("hook_id"))
2828

2929
query_parameters = {}
3030
query_parameters["apikey"] = self._lr_object.get_api_key()
3131
query_parameters["apisecret"] = self._lr_object.get_api_secret()
32-
query_parameters["event"] = event
3332

34-
resource_path = "api/v2/webhook"
33+
resource_path = "v2/manage/webhooks/" + hook_id
3534
return self._lr_object.execute("GET", resource_path, query_parameters, {})
3635

37-
def web_hook_subscribe(self, web_hook_subscribe_model):
38-
"""API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call.
36+
def create_webhook_subscription(self, web_hook_subscribe_model):
37+
"""This API is used to create a new webhook subscription on your LoginRadius site.
3938
4039
Args:
4140
web_hook_subscribe_model: Model Class containing Definition of payload for Webhook Subscribe API
4241
4342
Returns:
44-
Response containing Definition of Complete Validation data
43+
Response containing Definition for Complete WebHook data
4544
40.2
4645
"""
4746
if(web_hook_subscribe_model is None):
@@ -51,40 +50,80 @@ def web_hook_subscribe(self, web_hook_subscribe_model):
5150
query_parameters["apikey"] = self._lr_object.get_api_key()
5251
query_parameters["apisecret"] = self._lr_object.get_api_secret()
5352

54-
resource_path = "api/v2/webhook"
53+
resource_path = "v2/manage/webhooks"
5554
return self._lr_object.execute("POST", resource_path, query_parameters, web_hook_subscribe_model)
5655

57-
def webhook_test(self):
58-
"""API can be used to test a subscribed WebHook.
56+
def delete_webhook_subscription(self, hook_id):
57+
"""This API is used to delete webhook subscription
5958
59+
Args:
60+
hook_id: Unique ID of the webhook
61+
6062
Returns:
61-
Response containing Definition of Complete Validation data
63+
Response containing Definition of Delete Request
6264
40.3
6365
"""
6466

67+
if(self._lr_object.is_null_or_whitespace(hook_id)):
68+
raise Exception(self._lr_object.get_validation_message("hook_id"))
69+
6570
query_parameters = {}
6671
query_parameters["apikey"] = self._lr_object.get_api_key()
6772
query_parameters["apisecret"] = self._lr_object.get_api_secret()
6873

69-
resource_path = "api/v2/webhook/test"
70-
return self._lr_object.execute("GET", resource_path, query_parameters, {})
74+
resource_path = "v2/manage/webhooks/" + hook_id
75+
return self._lr_object.execute("DELETE", resource_path, query_parameters, {})
7176

72-
def web_hook_unsubscribe(self, web_hook_subscribe_model):
73-
"""API can be used to unsubscribe a WebHook configured on your LoginRadius site.
77+
def update_webhook_subscription(self, hook_id, web_hook_subscription_update_model):
78+
"""This API is used to update a webhook subscription
7479
7580
Args:
76-
web_hook_subscribe_model: Model Class containing Definition of payload for Webhook Subscribe API
81+
hook_id: Unique ID of the webhook
82+
web_hook_subscription_update_model: Model Class containing Definition for WebHookSubscriptionUpdateModel Property
7783
7884
Returns:
79-
Response containing Definition of Delete Request
85+
Response containing Definition for Complete WebHook data
8086
40.4
8187
"""
82-
if(web_hook_subscribe_model is None):
83-
raise Exception(self._lr_object.get_validation_message("web_hook_subscribe_model"))
88+
89+
if(self._lr_object.is_null_or_whitespace(hook_id)):
90+
raise Exception(self._lr_object.get_validation_message("hook_id"))
91+
if(web_hook_subscription_update_model is None):
92+
raise Exception(self._lr_object.get_validation_message("web_hook_subscription_update_model"))
93+
94+
query_parameters = {}
95+
query_parameters["apikey"] = self._lr_object.get_api_key()
96+
query_parameters["apisecret"] = self._lr_object.get_api_secret()
97+
98+
resource_path = "v2/manage/webhooks/" + hook_id
99+
return self._lr_object.execute("PUT", resource_path, query_parameters, web_hook_subscription_update_model)
100+
101+
def list_all_webhooks(self):
102+
"""This API is used to get the list of all the webhooks
103+
104+
Returns:
105+
Response Containing List of Webhhook Data
106+
40.5
107+
"""
108+
109+
query_parameters = {}
110+
query_parameters["apikey"] = self._lr_object.get_api_key()
111+
query_parameters["apisecret"] = self._lr_object.get_api_secret()
112+
113+
resource_path = "v2/manage/webhooks"
114+
return self._lr_object.execute("GET", resource_path, query_parameters, {})
115+
116+
def get_webhook_events(self):
117+
"""This API is used to retrieve all the webhook events.
118+
119+
Returns:
120+
Model Class containing Definition for WebHookEventModel Property
121+
40.6
122+
"""
84123

85124
query_parameters = {}
86125
query_parameters["apikey"] = self._lr_object.get_api_key()
87126
query_parameters["apisecret"] = self._lr_object.get_api_secret()
88127

89-
resource_path = "api/v2/webhook"
90-
return self._lr_object.execute("DELETE", resource_path, query_parameters, web_hook_subscribe_model)
128+
resource_path = "v2/manage/webhooks/events"
129+
return self._lr_object.execute("GET", resource_path, query_parameters, {})

0 commit comments

Comments
 (0)