kinde-python-sdk 1.1.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/PKG-INFO +186 -8
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/README.md +186 -8
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_python_sdk.egg-info/PKG-INFO +186 -8
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/__init__.py +1 -1
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/exceptions.py +4 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/kinde_api_client.py +82 -13
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/user_profile_v2.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_connected_apps_auth_url/get.py +51 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_connected_apps_revoke/post.py +9 -19
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_connected_apps_token/get.py +25 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/oauth2_v2_user_profile/get.py +1 -1
- kinde-python-sdk-1.2.0/kinde_sdk/test/test_kinde_api_client.py +1650 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_add_organization_users_response.py +13 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_api_result.py +12 -3
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_connected_apps_access_token.py +12 -3
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_connected_apps_auth_url.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_create_user_response.py +13 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_error.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_error_response.py +12 -3
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_get_organizations_response.py +13 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_get_organizations_users_response.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_organization.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_organization_user.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_remove_organization_users_response.py +13 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_success_response.py +12 -3
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_user.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_user_identity.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_user_profile.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_user_profile_v2.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_users_response.py +12 -2
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/pyproject.toml +1 -1
- kinde-python-sdk-1.1.0/kinde_sdk/test/test_kinde_api_client.py +0 -241
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/LICENSE +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_python_sdk.egg-info/SOURCES.txt +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_python_sdk.egg-info/dependency_links.txt +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_python_sdk.egg-info/requires.txt +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_python_sdk.egg-info/top_level.txt +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/api_client.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/path_to_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_connected_apps_auth_url.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_connected_apps_revoke.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_connected_apps_token.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_environment_feature_flags_.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_environment_feature_flags_feature_flag_key.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_feature_flags.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_feature_flags_feature_flag_key.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_organization.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_organization_users.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_organizations.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_organizations_org_code_feature_flags.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_organizations_org_code_feature_flags_feature_flag_key.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_user.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/api_v1_users.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/oauth2_user_profile.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/paths/oauth2_v2_user_profile.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tag_to_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/connected_apps_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/environments_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/feature_flags_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/o_auth_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/organizations_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/apis/tags/users_api.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/configuration.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/add_organization_users_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/api_result.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/connected_apps_access_token.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/connected_apps_auth_url.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/create_user_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/error.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/error_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/get_organizations_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/get_organizations_users_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/organization.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/organization_user.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/organization_users.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/organizations.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/remove_organization_users_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/success_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/user.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/user_identity.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/user_profile.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/users.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/model/users_response.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/models/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_connected_apps_auth_url/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_connected_apps_revoke/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_connected_apps_token/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_environment_feature_flags_/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_environment_feature_flags_/delete.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_environment_feature_flags_feature_flag_key/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_environment_feature_flags_feature_flag_key/delete.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_environment_feature_flags_feature_flag_key/patch.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_feature_flags/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_feature_flags/post.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_feature_flags_feature_flag_key/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_feature_flags_feature_flag_key/delete.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_feature_flags_feature_flag_key/put.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization/get.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization/post.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization_users/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization_users/get.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization_users/patch.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organization_users/post.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations/get.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations_org_code_feature_flags/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations_org_code_feature_flags/delete.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations_org_code_feature_flags_feature_flag_key/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations_org_code_feature_flags_feature_flag_key/delete.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_organizations_org_code_feature_flags_feature_flag_key/patch.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_user/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_user/delete.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_user/get.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_user/patch.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_user/post.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_users/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/api_v1_users/get.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/oauth2_user_profile/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/oauth2_user_profile/get.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/paths/oauth2_v2_user_profile/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/rest.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/schemas.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/__init__.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_organization_users.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_organizations.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/kinde_sdk/test/test_models/test_users.py +0 -0
- {kinde-python-sdk-1.1.0 → kinde-python-sdk-1.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kinde-python-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Connect your app to the Kinde platform
|
|
5
5
|
Author-email: Kinde Engineering <engineering@kinde.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/kinde-oss/kinde-python-sdk
|
|
@@ -257,8 +257,9 @@ Result:
|
|
|
257
257
|
{
|
|
258
258
|
id: id_token.sub,
|
|
259
259
|
given_name: id_token.given_name,
|
|
260
|
-
family_name: id_token.family_name
|
|
261
|
-
email: id_token.email
|
|
260
|
+
family_name: id_token.family_name,
|
|
261
|
+
email: id_token.email,
|
|
262
|
+
picture: id_token.picture
|
|
262
263
|
}
|
|
263
264
|
```
|
|
264
265
|
|
|
@@ -268,10 +269,183 @@ We have provided a helper to grab any claim from your id or access tokens. The h
|
|
|
268
269
|
|
|
269
270
|
```python
|
|
270
271
|
kinde_client.get_claim("aud")
|
|
271
|
-
#
|
|
272
|
+
# {
|
|
273
|
+
# "name": "aud",
|
|
274
|
+
# "value": ["api.stakesocial.com/v1"]
|
|
275
|
+
# }
|
|
272
276
|
|
|
273
277
|
kinde_client.get_claim("given_name", "id_token")
|
|
274
|
-
#
|
|
278
|
+
# {
|
|
279
|
+
# "name": "given_name",
|
|
280
|
+
# "value": "David"
|
|
281
|
+
# }
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Feature Flags
|
|
285
|
+
|
|
286
|
+
Get feature_flags claim of the access token.
|
|
287
|
+
|
|
288
|
+
Sample data
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
feature_flags: {
|
|
292
|
+
theme: {
|
|
293
|
+
t: "s",
|
|
294
|
+
v: "pink"
|
|
295
|
+
},
|
|
296
|
+
is_dark_mode: {
|
|
297
|
+
t: "b",
|
|
298
|
+
v: true
|
|
299
|
+
},
|
|
300
|
+
competitions_limit: {
|
|
301
|
+
t: "i",
|
|
302
|
+
v: 5
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
In order to minimize the payload in the token we have used single letter keys / values where possible. The single letters represent the following:
|
|
307
|
+
|
|
308
|
+
t = type
|
|
309
|
+
|
|
310
|
+
v = value
|
|
311
|
+
|
|
312
|
+
s = string
|
|
313
|
+
|
|
314
|
+
b = boolean
|
|
315
|
+
|
|
316
|
+
i = integer
|
|
317
|
+
|
|
318
|
+
We provide helper functions to more easily access feature flags:
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
|
|
322
|
+
# Get a flag from the feature_flags claim of the access_token.
|
|
323
|
+
# @param {string} code - The name of the flag.
|
|
324
|
+
# @param {obj} [defaultValue] - A fallback value if the flag isn't found.
|
|
325
|
+
# @param {'s'|'b'|'i'|undefined} [flagType] - The data type of the flag
|
|
326
|
+
# (integer / boolean / string).
|
|
327
|
+
# @return {object} Flag details.
|
|
328
|
+
|
|
329
|
+
kinde_client.get_flag(code, defaultValue, flagType)
|
|
330
|
+
|
|
331
|
+
# Example usage:
|
|
332
|
+
|
|
333
|
+
kinde_client.get_flag("theme")
|
|
334
|
+
# {
|
|
335
|
+
# "code": "theme",
|
|
336
|
+
# "type": "string",
|
|
337
|
+
# "value": "pink",
|
|
338
|
+
# "is_default": false // whether the fallback value had to be used
|
|
339
|
+
# }
|
|
340
|
+
|
|
341
|
+
# If flag does not exist, default value provided
|
|
342
|
+
kinde_client.get_flag("create_competition", default_value=False)
|
|
343
|
+
# {
|
|
344
|
+
# "code": "create_competition",
|
|
345
|
+
# "value": false,
|
|
346
|
+
# "is_default": true
|
|
347
|
+
# }
|
|
348
|
+
|
|
349
|
+
kinde_client.get_flag("competitions_limit", default_value=3, flat_type='i')
|
|
350
|
+
# {
|
|
351
|
+
# "code": "competitions_limit",
|
|
352
|
+
# "type": "integer",
|
|
353
|
+
# "value": 5,
|
|
354
|
+
# "is_default": false
|
|
355
|
+
# }
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
If flag_type is provided and not the same as the flag value, an error will be raise.
|
|
359
|
+
|
|
360
|
+
#### Get boolean flag
|
|
361
|
+
|
|
362
|
+
Get a boolean flag from the feature_flags claim of the access_token.
|
|
363
|
+
|
|
364
|
+
```python
|
|
365
|
+
|
|
366
|
+
# Get a boolean flag from the feature_flags claim of the access_token.
|
|
367
|
+
# @param {string} code - The name of the flag.
|
|
368
|
+
# @param {bool} [defaultValue] - A fallback value if the flag isn't found.
|
|
369
|
+
# @return {bool}
|
|
370
|
+
|
|
371
|
+
kinde_client.get_boolean_flag(code, defaultValue)
|
|
372
|
+
|
|
373
|
+
# Example usage:
|
|
374
|
+
|
|
375
|
+
kinde_client.get_boolean_flag("is_dark_mode")
|
|
376
|
+
# True
|
|
377
|
+
|
|
378
|
+
kinde_client.get_boolean_flag("is_dark_mode", False)
|
|
379
|
+
# False
|
|
380
|
+
|
|
381
|
+
kinde_client.get_boolean_flag("new_feature", False)
|
|
382
|
+
# False (flag does not exist so falls back to default)
|
|
383
|
+
|
|
384
|
+
kinde_client.get_boolean_flag("new_feature")
|
|
385
|
+
# Error - flag does not exist and no default provided
|
|
386
|
+
|
|
387
|
+
kinde_client.get_boolean_flag("theme", False)
|
|
388
|
+
# Error - Flag "theme" is of type string not boolean
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
#### Get string flag
|
|
392
|
+
|
|
393
|
+
Get a string flag from the feature_flags claim of the access_token.
|
|
394
|
+
|
|
395
|
+
```python
|
|
396
|
+
# Get a string flag from the feature_flags claim of the access_token.
|
|
397
|
+
# @param {string} code - The name of the flag.
|
|
398
|
+
# @param {string} [defaultValue] - A fallback value if the flag isn't found.
|
|
399
|
+
# @return {string}
|
|
400
|
+
|
|
401
|
+
kinde_client.get_string_flag(code, defaultValue)
|
|
402
|
+
|
|
403
|
+
# Example usage:
|
|
404
|
+
|
|
405
|
+
kinde_client.get_string_flag("theme")
|
|
406
|
+
# "pink"
|
|
407
|
+
|
|
408
|
+
kinde_client.get_string_flag("theme", "orange")
|
|
409
|
+
# "pink"
|
|
410
|
+
|
|
411
|
+
kinde_client.get_string_flag("cta_color", "blue")
|
|
412
|
+
# "blue" (flag does not exist so falls back to default)
|
|
413
|
+
|
|
414
|
+
kinde_client.get_string_flag("cta_color")
|
|
415
|
+
# Error - flag does not exist and no default provided
|
|
416
|
+
|
|
417
|
+
kinde_client.get_string_flag("is_dark_mode", False)
|
|
418
|
+
# Error - Flag "is_dark_mode" is of type boolean not string
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
#### Get integer flag
|
|
422
|
+
|
|
423
|
+
Get a integer flag from the feature_flags claim of the access_token.
|
|
424
|
+
|
|
425
|
+
```python
|
|
426
|
+
# Get an integer flag from the feature_flags claim of the access_token.
|
|
427
|
+
# @param {string} code - The name of the flag.
|
|
428
|
+
# @param {int} [defaultValue] - A fallback value if the flag isn't found.
|
|
429
|
+
# @return {int}
|
|
430
|
+
|
|
431
|
+
kinde_client.get_tnteger_flag(code, defaultValue)
|
|
432
|
+
|
|
433
|
+
# Example usage:
|
|
434
|
+
|
|
435
|
+
kinde_client.get_integer_flag("competitions_limit")
|
|
436
|
+
# 5
|
|
437
|
+
|
|
438
|
+
kinde_client.get_integer_flag("competitions_limit", 3)
|
|
439
|
+
# 5
|
|
440
|
+
|
|
441
|
+
kinde_client.get_integer_flag("team_count", 2)
|
|
442
|
+
# 2 (flag does not exist so falls back to default)
|
|
443
|
+
|
|
444
|
+
kinde_client.get_integer_flag("team_count")
|
|
445
|
+
# Error - flag does not exist and no default provided
|
|
446
|
+
|
|
447
|
+
kinde_client.get_integer_flag("is_dark_mode", False)
|
|
448
|
+
# Error - Flag "is_dark_mode" is of type boolean not integer
|
|
275
449
|
```
|
|
276
450
|
|
|
277
451
|
## Get user information from API
|
|
@@ -312,13 +486,17 @@ except ApiException as e:
|
|
|
312
486
|
| logout | Logs the user out of Kinde | | kinde_client.logout() | 'https://your_kinde_domain.kinde.com/logout' |
|
|
313
487
|
| is_authenticated | Check if user is authenticated | | kinde_client.is_authenticated() | True |
|
|
314
488
|
| create_org | Constructs redirect url for creating an organization | | kinde_client.create_org() | 'https://your_kinde_domain.kinde.com/login&start_page=registration&is_create_org=true' |
|
|
315
|
-
| get_claim | Gets a claim from an access or id token | key: string, token_name: string | kinde_client.get_claim('given\_name', 'id\_token') | 'David' |
|
|
489
|
+
| get_claim | Gets a claim from an access or id token | key: string, token_name: string | kinde_client.get_claim('given\_name', 'id\_token') | {'name': 'given\_name', 'value': 'David'} |
|
|
316
490
|
| get_permission | Returns the state of a given permission | permission: string | kinde_client.get_permission('read:todos') | \{'org_code': 'org\_1234', 'is_granted': True\} |
|
|
317
491
|
| get_permissions | Returns all permissions for the current user for the organization they are logged into | | kinde_client.get_permissions() | \{'org_code':'org\_1234', 'permissions': \['create:todos', 'update:todos', 'read:todos'\]\} |
|
|
318
492
|
| get_organization | Get details for the organization your user is logged into | | kinde_client.get_organization() | \{'org_code': 'org\_1234'\} |
|
|
319
|
-
| get_user_details | Returns the profile for the current user | | kinde_client.get_user_details() | \{'given\_name': 'Dave', 'id': 'abcdef', 'family\_name': 'Smith', 'email': 'dave@smith.com'\} |
|
|
493
|
+
| get_user_details | Returns the profile for the current user | | kinde_client.get_user_details() | \{'given\_name': 'Dave', 'id': 'abcdef', 'family\_name': 'Smith', 'email': 'dave@smith.com', 'picture': '<https://google-avatar.com/12455>'\} |
|
|
320
494
|
| get_user_organizations | Gets an array of all organizations the user has access to | | kinde_client.get_user_organizations() | \{'org_codes': ['org\_1234', 'org\_2345']\} |
|
|
321
|
-
|
|
495
|
+
| get_flag | Returns feature_flags claim of the access_token | code: string, default_value: any (optional), flag_type: str (optional) | kinde_client.get_flag("theme") | {"code": "theme","type": "string","value": "pink","is_default": False} |
|
|
496
|
+
| get_boolean_flag | Returns a boolean flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_boolean_flag("is_dark_mode") | True
|
|
497
|
+
| get_string_flag | Returns a string flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_string_flag("theme") | "pink"
|
|
498
|
+
| get_integer_flag | Returns an integer flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_integer_flag("competitions_limit") | 5
|
|
499
|
+
| call_api | Returns deserialized data | resource_path: string, method: string, headers: optional, body: optional, fields: optional, auth_settings: optional, async_req: optional, stream: optional, timeout: optional, host: optional | kinde_client.call_api("/api/v1/user", "GET") | <urllib3.response.HTTPResponse> object
|
|
322
500
|
If you need help connecting to Kinde, please contact us at [support@kinde.com](mailto:support@kinde.com).
|
|
323
501
|
|
|
324
502
|
## Autogenerated API reference
|
|
@@ -239,8 +239,9 @@ Result:
|
|
|
239
239
|
{
|
|
240
240
|
id: id_token.sub,
|
|
241
241
|
given_name: id_token.given_name,
|
|
242
|
-
family_name: id_token.family_name
|
|
243
|
-
email: id_token.email
|
|
242
|
+
family_name: id_token.family_name,
|
|
243
|
+
email: id_token.email,
|
|
244
|
+
picture: id_token.picture
|
|
244
245
|
}
|
|
245
246
|
```
|
|
246
247
|
|
|
@@ -250,10 +251,183 @@ We have provided a helper to grab any claim from your id or access tokens. The h
|
|
|
250
251
|
|
|
251
252
|
```python
|
|
252
253
|
kinde_client.get_claim("aud")
|
|
253
|
-
#
|
|
254
|
+
# {
|
|
255
|
+
# "name": "aud",
|
|
256
|
+
# "value": ["api.stakesocial.com/v1"]
|
|
257
|
+
# }
|
|
254
258
|
|
|
255
259
|
kinde_client.get_claim("given_name", "id_token")
|
|
256
|
-
#
|
|
260
|
+
# {
|
|
261
|
+
# "name": "given_name",
|
|
262
|
+
# "value": "David"
|
|
263
|
+
# }
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Feature Flags
|
|
267
|
+
|
|
268
|
+
Get feature_flags claim of the access token.
|
|
269
|
+
|
|
270
|
+
Sample data
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
feature_flags: {
|
|
274
|
+
theme: {
|
|
275
|
+
t: "s",
|
|
276
|
+
v: "pink"
|
|
277
|
+
},
|
|
278
|
+
is_dark_mode: {
|
|
279
|
+
t: "b",
|
|
280
|
+
v: true
|
|
281
|
+
},
|
|
282
|
+
competitions_limit: {
|
|
283
|
+
t: "i",
|
|
284
|
+
v: 5
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
In order to minimize the payload in the token we have used single letter keys / values where possible. The single letters represent the following:
|
|
289
|
+
|
|
290
|
+
t = type
|
|
291
|
+
|
|
292
|
+
v = value
|
|
293
|
+
|
|
294
|
+
s = string
|
|
295
|
+
|
|
296
|
+
b = boolean
|
|
297
|
+
|
|
298
|
+
i = integer
|
|
299
|
+
|
|
300
|
+
We provide helper functions to more easily access feature flags:
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
|
|
304
|
+
# Get a flag from the feature_flags claim of the access_token.
|
|
305
|
+
# @param {string} code - The name of the flag.
|
|
306
|
+
# @param {obj} [defaultValue] - A fallback value if the flag isn't found.
|
|
307
|
+
# @param {'s'|'b'|'i'|undefined} [flagType] - The data type of the flag
|
|
308
|
+
# (integer / boolean / string).
|
|
309
|
+
# @return {object} Flag details.
|
|
310
|
+
|
|
311
|
+
kinde_client.get_flag(code, defaultValue, flagType)
|
|
312
|
+
|
|
313
|
+
# Example usage:
|
|
314
|
+
|
|
315
|
+
kinde_client.get_flag("theme")
|
|
316
|
+
# {
|
|
317
|
+
# "code": "theme",
|
|
318
|
+
# "type": "string",
|
|
319
|
+
# "value": "pink",
|
|
320
|
+
# "is_default": false // whether the fallback value had to be used
|
|
321
|
+
# }
|
|
322
|
+
|
|
323
|
+
# If flag does not exist, default value provided
|
|
324
|
+
kinde_client.get_flag("create_competition", default_value=False)
|
|
325
|
+
# {
|
|
326
|
+
# "code": "create_competition",
|
|
327
|
+
# "value": false,
|
|
328
|
+
# "is_default": true
|
|
329
|
+
# }
|
|
330
|
+
|
|
331
|
+
kinde_client.get_flag("competitions_limit", default_value=3, flat_type='i')
|
|
332
|
+
# {
|
|
333
|
+
# "code": "competitions_limit",
|
|
334
|
+
# "type": "integer",
|
|
335
|
+
# "value": 5,
|
|
336
|
+
# "is_default": false
|
|
337
|
+
# }
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
If flag_type is provided and not the same as the flag value, an error will be raise.
|
|
341
|
+
|
|
342
|
+
#### Get boolean flag
|
|
343
|
+
|
|
344
|
+
Get a boolean flag from the feature_flags claim of the access_token.
|
|
345
|
+
|
|
346
|
+
```python
|
|
347
|
+
|
|
348
|
+
# Get a boolean flag from the feature_flags claim of the access_token.
|
|
349
|
+
# @param {string} code - The name of the flag.
|
|
350
|
+
# @param {bool} [defaultValue] - A fallback value if the flag isn't found.
|
|
351
|
+
# @return {bool}
|
|
352
|
+
|
|
353
|
+
kinde_client.get_boolean_flag(code, defaultValue)
|
|
354
|
+
|
|
355
|
+
# Example usage:
|
|
356
|
+
|
|
357
|
+
kinde_client.get_boolean_flag("is_dark_mode")
|
|
358
|
+
# True
|
|
359
|
+
|
|
360
|
+
kinde_client.get_boolean_flag("is_dark_mode", False)
|
|
361
|
+
# False
|
|
362
|
+
|
|
363
|
+
kinde_client.get_boolean_flag("new_feature", False)
|
|
364
|
+
# False (flag does not exist so falls back to default)
|
|
365
|
+
|
|
366
|
+
kinde_client.get_boolean_flag("new_feature")
|
|
367
|
+
# Error - flag does not exist and no default provided
|
|
368
|
+
|
|
369
|
+
kinde_client.get_boolean_flag("theme", False)
|
|
370
|
+
# Error - Flag "theme" is of type string not boolean
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
#### Get string flag
|
|
374
|
+
|
|
375
|
+
Get a string flag from the feature_flags claim of the access_token.
|
|
376
|
+
|
|
377
|
+
```python
|
|
378
|
+
# Get a string flag from the feature_flags claim of the access_token.
|
|
379
|
+
# @param {string} code - The name of the flag.
|
|
380
|
+
# @param {string} [defaultValue] - A fallback value if the flag isn't found.
|
|
381
|
+
# @return {string}
|
|
382
|
+
|
|
383
|
+
kinde_client.get_string_flag(code, defaultValue)
|
|
384
|
+
|
|
385
|
+
# Example usage:
|
|
386
|
+
|
|
387
|
+
kinde_client.get_string_flag("theme")
|
|
388
|
+
# "pink"
|
|
389
|
+
|
|
390
|
+
kinde_client.get_string_flag("theme", "orange")
|
|
391
|
+
# "pink"
|
|
392
|
+
|
|
393
|
+
kinde_client.get_string_flag("cta_color", "blue")
|
|
394
|
+
# "blue" (flag does not exist so falls back to default)
|
|
395
|
+
|
|
396
|
+
kinde_client.get_string_flag("cta_color")
|
|
397
|
+
# Error - flag does not exist and no default provided
|
|
398
|
+
|
|
399
|
+
kinde_client.get_string_flag("is_dark_mode", False)
|
|
400
|
+
# Error - Flag "is_dark_mode" is of type boolean not string
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
#### Get integer flag
|
|
404
|
+
|
|
405
|
+
Get a integer flag from the feature_flags claim of the access_token.
|
|
406
|
+
|
|
407
|
+
```python
|
|
408
|
+
# Get an integer flag from the feature_flags claim of the access_token.
|
|
409
|
+
# @param {string} code - The name of the flag.
|
|
410
|
+
# @param {int} [defaultValue] - A fallback value if the flag isn't found.
|
|
411
|
+
# @return {int}
|
|
412
|
+
|
|
413
|
+
kinde_client.get_tnteger_flag(code, defaultValue)
|
|
414
|
+
|
|
415
|
+
# Example usage:
|
|
416
|
+
|
|
417
|
+
kinde_client.get_integer_flag("competitions_limit")
|
|
418
|
+
# 5
|
|
419
|
+
|
|
420
|
+
kinde_client.get_integer_flag("competitions_limit", 3)
|
|
421
|
+
# 5
|
|
422
|
+
|
|
423
|
+
kinde_client.get_integer_flag("team_count", 2)
|
|
424
|
+
# 2 (flag does not exist so falls back to default)
|
|
425
|
+
|
|
426
|
+
kinde_client.get_integer_flag("team_count")
|
|
427
|
+
# Error - flag does not exist and no default provided
|
|
428
|
+
|
|
429
|
+
kinde_client.get_integer_flag("is_dark_mode", False)
|
|
430
|
+
# Error - Flag "is_dark_mode" is of type boolean not integer
|
|
257
431
|
```
|
|
258
432
|
|
|
259
433
|
## Get user information from API
|
|
@@ -294,14 +468,18 @@ except ApiException as e:
|
|
|
294
468
|
| logout | Logs the user out of Kinde | | kinde_client.logout() | 'https://your_kinde_domain.kinde.com/logout' |
|
|
295
469
|
| is_authenticated | Check if user is authenticated | | kinde_client.is_authenticated() | True |
|
|
296
470
|
| create_org | Constructs redirect url for creating an organization | | kinde_client.create_org() | 'https://your_kinde_domain.kinde.com/login&start_page=registration&is_create_org=true' |
|
|
297
|
-
| get_claim | Gets a claim from an access or id token | key: string, token_name: string | kinde_client.get_claim('given\_name', 'id\_token') | 'David' |
|
|
471
|
+
| get_claim | Gets a claim from an access or id token | key: string, token_name: string | kinde_client.get_claim('given\_name', 'id\_token') | {'name': 'given\_name', 'value': 'David'} |
|
|
298
472
|
| get_permission | Returns the state of a given permission | permission: string | kinde_client.get_permission('read:todos') | \{'org_code': 'org\_1234', 'is_granted': True\} |
|
|
299
473
|
| get_permissions | Returns all permissions for the current user for the organization they are logged into | | kinde_client.get_permissions() | \{'org_code':'org\_1234', 'permissions': \['create:todos', 'update:todos', 'read:todos'\]\} |
|
|
300
474
|
| get_organization | Get details for the organization your user is logged into | | kinde_client.get_organization() | \{'org_code': 'org\_1234'\} |
|
|
301
|
-
| get_user_details | Returns the profile for the current user | | kinde_client.get_user_details() | \{'given\_name': 'Dave', 'id': 'abcdef', 'family\_name': 'Smith', 'email': 'dave@smith.com'\} |
|
|
475
|
+
| get_user_details | Returns the profile for the current user | | kinde_client.get_user_details() | \{'given\_name': 'Dave', 'id': 'abcdef', 'family\_name': 'Smith', 'email': 'dave@smith.com', 'picture': '<https://google-avatar.com/12455>'\} |
|
|
302
476
|
| get_user_organizations | Gets an array of all organizations the user has access to | | kinde_client.get_user_organizations() | \{'org_codes': ['org\_1234', 'org\_2345']\} |
|
|
303
|
-
|
|
477
|
+
| get_flag | Returns feature_flags claim of the access_token | code: string, default_value: any (optional), flag_type: str (optional) | kinde_client.get_flag("theme") | {"code": "theme","type": "string","value": "pink","is_default": False} |
|
|
478
|
+
| get_boolean_flag | Returns a boolean flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_boolean_flag("is_dark_mode") | True
|
|
479
|
+
| get_string_flag | Returns a string flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_string_flag("theme") | "pink"
|
|
480
|
+
| get_integer_flag | Returns an integer flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_integer_flag("competitions_limit") | 5
|
|
481
|
+
| call_api | Returns deserialized data | resource_path: string, method: string, headers: optional, body: optional, fields: optional, auth_settings: optional, async_req: optional, stream: optional, timeout: optional, host: optional | kinde_client.call_api("/api/v1/user", "GET") | <urllib3.response.HTTPResponse> object
|
|
304
482
|
If you need help connecting to Kinde, please contact us at [support@kinde.com](mailto:support@kinde.com).
|
|
305
483
|
|
|
306
484
|
## Autogenerated API reference
|
|
307
|
-
See autogenerated API reference in [kinde_sdk_README.md](kinde_sdk_README.md).
|
|
485
|
+
See autogenerated API reference in [kinde_sdk_README.md](kinde_sdk_README.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kinde-python-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Connect your app to the Kinde platform
|
|
5
5
|
Author-email: Kinde Engineering <engineering@kinde.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/kinde-oss/kinde-python-sdk
|
|
@@ -257,8 +257,9 @@ Result:
|
|
|
257
257
|
{
|
|
258
258
|
id: id_token.sub,
|
|
259
259
|
given_name: id_token.given_name,
|
|
260
|
-
family_name: id_token.family_name
|
|
261
|
-
email: id_token.email
|
|
260
|
+
family_name: id_token.family_name,
|
|
261
|
+
email: id_token.email,
|
|
262
|
+
picture: id_token.picture
|
|
262
263
|
}
|
|
263
264
|
```
|
|
264
265
|
|
|
@@ -268,10 +269,183 @@ We have provided a helper to grab any claim from your id or access tokens. The h
|
|
|
268
269
|
|
|
269
270
|
```python
|
|
270
271
|
kinde_client.get_claim("aud")
|
|
271
|
-
#
|
|
272
|
+
# {
|
|
273
|
+
# "name": "aud",
|
|
274
|
+
# "value": ["api.stakesocial.com/v1"]
|
|
275
|
+
# }
|
|
272
276
|
|
|
273
277
|
kinde_client.get_claim("given_name", "id_token")
|
|
274
|
-
#
|
|
278
|
+
# {
|
|
279
|
+
# "name": "given_name",
|
|
280
|
+
# "value": "David"
|
|
281
|
+
# }
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Feature Flags
|
|
285
|
+
|
|
286
|
+
Get feature_flags claim of the access token.
|
|
287
|
+
|
|
288
|
+
Sample data
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
feature_flags: {
|
|
292
|
+
theme: {
|
|
293
|
+
t: "s",
|
|
294
|
+
v: "pink"
|
|
295
|
+
},
|
|
296
|
+
is_dark_mode: {
|
|
297
|
+
t: "b",
|
|
298
|
+
v: true
|
|
299
|
+
},
|
|
300
|
+
competitions_limit: {
|
|
301
|
+
t: "i",
|
|
302
|
+
v: 5
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
In order to minimize the payload in the token we have used single letter keys / values where possible. The single letters represent the following:
|
|
307
|
+
|
|
308
|
+
t = type
|
|
309
|
+
|
|
310
|
+
v = value
|
|
311
|
+
|
|
312
|
+
s = string
|
|
313
|
+
|
|
314
|
+
b = boolean
|
|
315
|
+
|
|
316
|
+
i = integer
|
|
317
|
+
|
|
318
|
+
We provide helper functions to more easily access feature flags:
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
|
|
322
|
+
# Get a flag from the feature_flags claim of the access_token.
|
|
323
|
+
# @param {string} code - The name of the flag.
|
|
324
|
+
# @param {obj} [defaultValue] - A fallback value if the flag isn't found.
|
|
325
|
+
# @param {'s'|'b'|'i'|undefined} [flagType] - The data type of the flag
|
|
326
|
+
# (integer / boolean / string).
|
|
327
|
+
# @return {object} Flag details.
|
|
328
|
+
|
|
329
|
+
kinde_client.get_flag(code, defaultValue, flagType)
|
|
330
|
+
|
|
331
|
+
# Example usage:
|
|
332
|
+
|
|
333
|
+
kinde_client.get_flag("theme")
|
|
334
|
+
# {
|
|
335
|
+
# "code": "theme",
|
|
336
|
+
# "type": "string",
|
|
337
|
+
# "value": "pink",
|
|
338
|
+
# "is_default": false // whether the fallback value had to be used
|
|
339
|
+
# }
|
|
340
|
+
|
|
341
|
+
# If flag does not exist, default value provided
|
|
342
|
+
kinde_client.get_flag("create_competition", default_value=False)
|
|
343
|
+
# {
|
|
344
|
+
# "code": "create_competition",
|
|
345
|
+
# "value": false,
|
|
346
|
+
# "is_default": true
|
|
347
|
+
# }
|
|
348
|
+
|
|
349
|
+
kinde_client.get_flag("competitions_limit", default_value=3, flat_type='i')
|
|
350
|
+
# {
|
|
351
|
+
# "code": "competitions_limit",
|
|
352
|
+
# "type": "integer",
|
|
353
|
+
# "value": 5,
|
|
354
|
+
# "is_default": false
|
|
355
|
+
# }
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
If flag_type is provided and not the same as the flag value, an error will be raise.
|
|
359
|
+
|
|
360
|
+
#### Get boolean flag
|
|
361
|
+
|
|
362
|
+
Get a boolean flag from the feature_flags claim of the access_token.
|
|
363
|
+
|
|
364
|
+
```python
|
|
365
|
+
|
|
366
|
+
# Get a boolean flag from the feature_flags claim of the access_token.
|
|
367
|
+
# @param {string} code - The name of the flag.
|
|
368
|
+
# @param {bool} [defaultValue] - A fallback value if the flag isn't found.
|
|
369
|
+
# @return {bool}
|
|
370
|
+
|
|
371
|
+
kinde_client.get_boolean_flag(code, defaultValue)
|
|
372
|
+
|
|
373
|
+
# Example usage:
|
|
374
|
+
|
|
375
|
+
kinde_client.get_boolean_flag("is_dark_mode")
|
|
376
|
+
# True
|
|
377
|
+
|
|
378
|
+
kinde_client.get_boolean_flag("is_dark_mode", False)
|
|
379
|
+
# False
|
|
380
|
+
|
|
381
|
+
kinde_client.get_boolean_flag("new_feature", False)
|
|
382
|
+
# False (flag does not exist so falls back to default)
|
|
383
|
+
|
|
384
|
+
kinde_client.get_boolean_flag("new_feature")
|
|
385
|
+
# Error - flag does not exist and no default provided
|
|
386
|
+
|
|
387
|
+
kinde_client.get_boolean_flag("theme", False)
|
|
388
|
+
# Error - Flag "theme" is of type string not boolean
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
#### Get string flag
|
|
392
|
+
|
|
393
|
+
Get a string flag from the feature_flags claim of the access_token.
|
|
394
|
+
|
|
395
|
+
```python
|
|
396
|
+
# Get a string flag from the feature_flags claim of the access_token.
|
|
397
|
+
# @param {string} code - The name of the flag.
|
|
398
|
+
# @param {string} [defaultValue] - A fallback value if the flag isn't found.
|
|
399
|
+
# @return {string}
|
|
400
|
+
|
|
401
|
+
kinde_client.get_string_flag(code, defaultValue)
|
|
402
|
+
|
|
403
|
+
# Example usage:
|
|
404
|
+
|
|
405
|
+
kinde_client.get_string_flag("theme")
|
|
406
|
+
# "pink"
|
|
407
|
+
|
|
408
|
+
kinde_client.get_string_flag("theme", "orange")
|
|
409
|
+
# "pink"
|
|
410
|
+
|
|
411
|
+
kinde_client.get_string_flag("cta_color", "blue")
|
|
412
|
+
# "blue" (flag does not exist so falls back to default)
|
|
413
|
+
|
|
414
|
+
kinde_client.get_string_flag("cta_color")
|
|
415
|
+
# Error - flag does not exist and no default provided
|
|
416
|
+
|
|
417
|
+
kinde_client.get_string_flag("is_dark_mode", False)
|
|
418
|
+
# Error - Flag "is_dark_mode" is of type boolean not string
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
#### Get integer flag
|
|
422
|
+
|
|
423
|
+
Get a integer flag from the feature_flags claim of the access_token.
|
|
424
|
+
|
|
425
|
+
```python
|
|
426
|
+
# Get an integer flag from the feature_flags claim of the access_token.
|
|
427
|
+
# @param {string} code - The name of the flag.
|
|
428
|
+
# @param {int} [defaultValue] - A fallback value if the flag isn't found.
|
|
429
|
+
# @return {int}
|
|
430
|
+
|
|
431
|
+
kinde_client.get_tnteger_flag(code, defaultValue)
|
|
432
|
+
|
|
433
|
+
# Example usage:
|
|
434
|
+
|
|
435
|
+
kinde_client.get_integer_flag("competitions_limit")
|
|
436
|
+
# 5
|
|
437
|
+
|
|
438
|
+
kinde_client.get_integer_flag("competitions_limit", 3)
|
|
439
|
+
# 5
|
|
440
|
+
|
|
441
|
+
kinde_client.get_integer_flag("team_count", 2)
|
|
442
|
+
# 2 (flag does not exist so falls back to default)
|
|
443
|
+
|
|
444
|
+
kinde_client.get_integer_flag("team_count")
|
|
445
|
+
# Error - flag does not exist and no default provided
|
|
446
|
+
|
|
447
|
+
kinde_client.get_integer_flag("is_dark_mode", False)
|
|
448
|
+
# Error - Flag "is_dark_mode" is of type boolean not integer
|
|
275
449
|
```
|
|
276
450
|
|
|
277
451
|
## Get user information from API
|
|
@@ -312,13 +486,17 @@ except ApiException as e:
|
|
|
312
486
|
| logout | Logs the user out of Kinde | | kinde_client.logout() | 'https://your_kinde_domain.kinde.com/logout' |
|
|
313
487
|
| is_authenticated | Check if user is authenticated | | kinde_client.is_authenticated() | True |
|
|
314
488
|
| create_org | Constructs redirect url for creating an organization | | kinde_client.create_org() | 'https://your_kinde_domain.kinde.com/login&start_page=registration&is_create_org=true' |
|
|
315
|
-
| get_claim | Gets a claim from an access or id token | key: string, token_name: string | kinde_client.get_claim('given\_name', 'id\_token') | 'David' |
|
|
489
|
+
| get_claim | Gets a claim from an access or id token | key: string, token_name: string | kinde_client.get_claim('given\_name', 'id\_token') | {'name': 'given\_name', 'value': 'David'} |
|
|
316
490
|
| get_permission | Returns the state of a given permission | permission: string | kinde_client.get_permission('read:todos') | \{'org_code': 'org\_1234', 'is_granted': True\} |
|
|
317
491
|
| get_permissions | Returns all permissions for the current user for the organization they are logged into | | kinde_client.get_permissions() | \{'org_code':'org\_1234', 'permissions': \['create:todos', 'update:todos', 'read:todos'\]\} |
|
|
318
492
|
| get_organization | Get details for the organization your user is logged into | | kinde_client.get_organization() | \{'org_code': 'org\_1234'\} |
|
|
319
|
-
| get_user_details | Returns the profile for the current user | | kinde_client.get_user_details() | \{'given\_name': 'Dave', 'id': 'abcdef', 'family\_name': 'Smith', 'email': 'dave@smith.com'\} |
|
|
493
|
+
| get_user_details | Returns the profile for the current user | | kinde_client.get_user_details() | \{'given\_name': 'Dave', 'id': 'abcdef', 'family\_name': 'Smith', 'email': 'dave@smith.com', 'picture': '<https://google-avatar.com/12455>'\} |
|
|
320
494
|
| get_user_organizations | Gets an array of all organizations the user has access to | | kinde_client.get_user_organizations() | \{'org_codes': ['org\_1234', 'org\_2345']\} |
|
|
321
|
-
|
|
495
|
+
| get_flag | Returns feature_flags claim of the access_token | code: string, default_value: any (optional), flag_type: str (optional) | kinde_client.get_flag("theme") | {"code": "theme","type": "string","value": "pink","is_default": False} |
|
|
496
|
+
| get_boolean_flag | Returns a boolean flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_boolean_flag("is_dark_mode") | True
|
|
497
|
+
| get_string_flag | Returns a string flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_string_flag("theme") | "pink"
|
|
498
|
+
| get_integer_flag | Returns an integer flag from the feature_flags claim of the access_token | code: string, default_value: any (optional) | kinde_client.get_integer_flag("competitions_limit") | 5
|
|
499
|
+
| call_api | Returns deserialized data | resource_path: string, method: string, headers: optional, body: optional, fields: optional, auth_settings: optional, async_req: optional, stream: optional, timeout: optional, host: optional | kinde_client.call_api("/api/v1/user", "GET") | <urllib3.response.HTTPResponse> object
|
|
322
500
|
If you need help connecting to Kinde, please contact us at [support@kinde.com](mailto:support@kinde.com).
|
|
323
501
|
|
|
324
502
|
## Autogenerated API reference
|