kinde_sdk 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +128 -0
  3. data/README.md +12 -424
  4. data/kinde_api/README.md +98 -27
  5. data/kinde_api/docs/APIsApi.md +356 -0
  6. data/kinde_api/docs/AddAPIsRequest.md +20 -0
  7. data/kinde_api/docs/Api.md +28 -0
  8. data/kinde_api/docs/ApiApplicationsInner.md +24 -0
  9. data/kinde_api/docs/Apis.md +24 -0
  10. data/kinde_api/docs/Applications.md +22 -0
  11. data/kinde_api/docs/ApplicationsApi.md +368 -0
  12. data/kinde_api/docs/BusinessApi.md +183 -0
  13. data/kinde_api/docs/CallbacksApi.md +385 -25
  14. data/kinde_api/docs/CreateApplicationRequest.md +20 -0
  15. data/kinde_api/docs/CreateApplicationResponse.md +22 -0
  16. data/kinde_api/docs/CreateApplicationResponseApplication.md +22 -0
  17. data/kinde_api/docs/CreateFeatureFlagRequest.md +28 -0
  18. data/kinde_api/docs/CreateOrganizationRequest.md +3 -1
  19. data/kinde_api/docs/CreateOrganizationUserPermissionRequest.md +18 -0
  20. data/kinde_api/docs/EnvironmentsApi.md +23 -23
  21. data/kinde_api/docs/FeatureFlagsApi.md +19 -29
  22. data/kinde_api/docs/GetApplicationResponse.md +22 -0
  23. data/kinde_api/docs/GetApplicationResponseApplication.md +26 -0
  24. data/kinde_api/docs/GetApplicationsResponse.md +2 -2
  25. data/kinde_api/docs/{GetOrganizationsUsersResponse.md → GetOrganizationUsersResponse.md} +2 -2
  26. data/kinde_api/docs/GetOrganizationsUserPermissionsResponse.md +22 -0
  27. data/kinde_api/docs/GetPermissionsResponse.md +24 -0
  28. data/kinde_api/docs/GetRolesResponse.md +24 -0
  29. data/kinde_api/docs/GetSubscriberResponse.md +22 -0
  30. data/kinde_api/docs/GetSubscribersResponse.md +24 -0
  31. data/kinde_api/docs/IndustriesApi.md +81 -0
  32. data/kinde_api/docs/LogoutRedirectUrls.md +18 -0
  33. data/kinde_api/docs/OAuthApi.md +153 -4
  34. data/kinde_api/docs/Organization.md +3 -1
  35. data/kinde_api/docs/OrganizationUserPermission.md +26 -0
  36. data/kinde_api/docs/OrganizationUserPermissionRolesInner.md +20 -0
  37. data/kinde_api/docs/OrganizationUserRolePermissions.md +22 -0
  38. data/kinde_api/docs/OrganizationUserRolePermissionsPermissions.md +18 -0
  39. data/kinde_api/docs/OrganizationsApi.md +328 -32
  40. data/kinde_api/docs/PermissionsApi.md +84 -14
  41. data/kinde_api/docs/ReplaceLogoutRedirectURLsRequest.md +18 -0
  42. data/kinde_api/docs/ReplaceRedirectCallbackURLsRequest.md +18 -0
  43. data/kinde_api/docs/Role.md +24 -0
  44. data/kinde_api/docs/Roles.md +2 -0
  45. data/kinde_api/docs/RolesApi.md +309 -17
  46. data/kinde_api/docs/RolesPermissionResponseInner.md +24 -0
  47. data/kinde_api/docs/Subscriber.md +24 -0
  48. data/kinde_api/docs/SubscribersApi.md +12 -14
  49. data/kinde_api/docs/SubscribersSubscriber.md +26 -0
  50. data/kinde_api/docs/TimezonesApi.md +81 -0
  51. data/kinde_api/docs/TokenErrorResponse.md +20 -0
  52. data/kinde_api/docs/TokenIntrospect.md +26 -0
  53. data/kinde_api/docs/UpdateAPIApplicationsRequest.md +18 -0
  54. data/kinde_api/docs/UpdateAPIApplicationsRequestApplicationsInner.md +20 -0
  55. data/kinde_api/docs/UpdateApplicationRequest.md +24 -0
  56. data/kinde_api/docs/UpdateEnvironementFeatureFlagOverrideRequest.md +18 -0
  57. data/kinde_api/docs/UpdateOrganizationRequest.md +3 -1
  58. data/kinde_api/docs/UpdateOrganizationUsersRequest.md +1 -1
  59. data/kinde_api/docs/UpdateRolePermissionsRequest.md +18 -0
  60. data/kinde_api/docs/UpdateRolePermissionsRequestPermissionsInner.md +20 -0
  61. data/kinde_api/docs/UpdateRolePermissionsResponse.md +24 -0
  62. data/kinde_api/docs/UpdateRolesRequest.md +24 -0
  63. data/kinde_api/docs/UpdateUserResponse.md +30 -0
  64. data/kinde_api/docs/User.md +7 -7
  65. data/kinde_api/docs/UserIdentitiesInner.md +20 -0
  66. data/kinde_api/docs/UsersApi.md +93 -15
  67. data/kinde_api/docs/UsersResponse.md +1 -1
  68. data/kinde_api/docs/UsersResponseUsersInner.md +42 -0
  69. data/kinde_api/lib/kinde_api/api/apis_api.rb +347 -0
  70. data/kinde_api/lib/kinde_api/api/applications_api.rb +352 -0
  71. data/kinde_api/lib/kinde_api/api/business_api.rb +210 -0
  72. data/kinde_api/lib/kinde_api/api/callbacks_api.rb +394 -31
  73. data/kinde_api/lib/kinde_api/api/environments_api.rb +22 -18
  74. data/kinde_api/lib/kinde_api/api/feature_flags_api.rb +20 -61
  75. data/kinde_api/lib/kinde_api/api/industries_api.rb +85 -0
  76. data/kinde_api/lib/kinde_api/api/o_auth_api.rb +141 -2
  77. data/kinde_api/lib/kinde_api/api/organizations_api.rb +318 -25
  78. data/kinde_api/lib/kinde_api/api/permissions_api.rb +75 -12
  79. data/kinde_api/lib/kinde_api/api/roles_api.rb +297 -15
  80. data/kinde_api/lib/kinde_api/api/subscribers_api.rb +8 -11
  81. data/kinde_api/lib/kinde_api/api/timezones_api.rb +85 -0
  82. data/kinde_api/lib/kinde_api/api/users_api.rb +87 -11
  83. data/kinde_api/lib/kinde_api/api_client.rb +14 -7
  84. data/kinde_api/lib/kinde_api/configuration.rb +81 -5
  85. data/kinde_api/lib/kinde_api/models/add_apis_request.rb +238 -0
  86. data/kinde_api/lib/kinde_api/models/add_organization_users_request.rb +2 -0
  87. data/kinde_api/lib/kinde_api/models/add_organization_users_request_users_inner.rb +2 -0
  88. data/kinde_api/lib/kinde_api/models/add_organization_users_response.rb +2 -0
  89. data/kinde_api/lib/kinde_api/models/api.rb +271 -0
  90. data/kinde_api/lib/kinde_api/models/api_applications_inner.rb +246 -0
  91. data/kinde_api/lib/kinde_api/models/api_result.rb +2 -0
  92. data/kinde_api/lib/kinde_api/models/apis.rb +250 -0
  93. data/kinde_api/lib/kinde_api/models/applications.rb +237 -0
  94. data/kinde_api/lib/kinde_api/models/connected_apps_access_token.rb +2 -0
  95. data/kinde_api/lib/kinde_api/models/connected_apps_auth_url.rb +2 -0
  96. data/kinde_api/lib/kinde_api/models/create_application_request.rb +264 -0
  97. data/kinde_api/lib/kinde_api/models/create_application_response.rb +239 -0
  98. data/kinde_api/lib/kinde_api/models/create_application_response_application.rb +240 -0
  99. data/kinde_api/lib/kinde_api/models/create_feature_flag_request.rb +336 -0
  100. data/kinde_api/lib/kinde_api/models/create_organization_request.rb +16 -4
  101. data/kinde_api/lib/kinde_api/models/create_organization_response.rb +2 -0
  102. data/kinde_api/lib/kinde_api/models/create_organization_response_organization.rb +2 -0
  103. data/kinde_api/lib/kinde_api/models/{application.rb → create_organization_user_permission_request.rb} +13 -19
  104. data/kinde_api/lib/kinde_api/models/create_organization_user_role_request.rb +2 -0
  105. data/kinde_api/lib/kinde_api/models/create_permission_request.rb +2 -0
  106. data/kinde_api/lib/kinde_api/models/create_role_request.rb +2 -0
  107. data/kinde_api/lib/kinde_api/models/create_subscriber_success_response.rb +2 -0
  108. data/kinde_api/lib/kinde_api/models/create_subscriber_success_response_subscriber.rb +2 -0
  109. data/kinde_api/lib/kinde_api/models/create_user_request.rb +2 -0
  110. data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner.rb +2 -0
  111. data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner_details.rb +2 -0
  112. data/kinde_api/lib/kinde_api/models/create_user_request_profile.rb +2 -0
  113. data/kinde_api/lib/kinde_api/models/create_user_response.rb +2 -0
  114. data/kinde_api/lib/kinde_api/models/error.rb +2 -0
  115. data/kinde_api/lib/kinde_api/models/error_response.rb +2 -0
  116. data/kinde_api/lib/kinde_api/models/get_application_response.rb +239 -0
  117. data/kinde_api/lib/kinde_api/models/get_application_response_application.rb +260 -0
  118. data/kinde_api/lib/kinde_api/models/get_applications_response.rb +10 -8
  119. data/kinde_api/lib/kinde_api/models/get_environment_feature_flags_response.rb +2 -0
  120. data/kinde_api/lib/kinde_api/models/get_organization_feature_flags_response.rb +2 -0
  121. data/kinde_api/lib/kinde_api/models/get_organization_feature_flags_response_feature_flags_value.rb +2 -0
  122. data/kinde_api/lib/kinde_api/models/{get_organizations_users_response.rb → get_organization_users_response.rb} +5 -3
  123. data/kinde_api/lib/kinde_api/models/get_organizations_response.rb +2 -0
  124. data/kinde_api/lib/kinde_api/models/get_organizations_user_permissions_response.rb +241 -0
  125. data/kinde_api/lib/kinde_api/models/get_organizations_user_roles_response.rb +2 -0
  126. data/kinde_api/lib/kinde_api/models/get_permissions_response.rb +251 -0
  127. data/kinde_api/lib/kinde_api/models/get_redirect_callback_urls_response.rb +2 -0
  128. data/kinde_api/lib/kinde_api/models/get_roles_response.rb +251 -0
  129. data/kinde_api/lib/kinde_api/models/get_subscriber_response.rb +241 -0
  130. data/kinde_api/lib/kinde_api/models/get_subscribers_response.rb +251 -0
  131. data/kinde_api/lib/kinde_api/models/logout_redirect_urls.rb +222 -0
  132. data/kinde_api/lib/kinde_api/models/organization.rb +15 -4
  133. data/kinde_api/lib/kinde_api/models/organization_user.rb +2 -0
  134. data/kinde_api/lib/kinde_api/models/organization_user_permission.rb +257 -0
  135. data/kinde_api/lib/kinde_api/models/organization_user_permission_roles_inner.rb +228 -0
  136. data/kinde_api/lib/kinde_api/models/organization_user_role.rb +2 -0
  137. data/kinde_api/lib/kinde_api/models/organization_user_role_permissions.rb +237 -0
  138. data/kinde_api/lib/kinde_api/models/organization_user_role_permissions_permissions.rb +219 -0
  139. data/kinde_api/lib/kinde_api/models/permissions.rb +2 -0
  140. data/kinde_api/lib/kinde_api/models/redirect_callback_urls.rb +2 -0
  141. data/kinde_api/lib/kinde_api/models/replace_logout_redirect_urls_request.rb +222 -0
  142. data/kinde_api/lib/kinde_api/models/replace_redirect_callback_urls_request.rb +222 -0
  143. data/kinde_api/lib/kinde_api/models/role.rb +246 -0
  144. data/kinde_api/lib/kinde_api/models/roles.rb +13 -1
  145. data/kinde_api/lib/kinde_api/models/roles_permission_response_inner.rb +246 -0
  146. data/kinde_api/lib/kinde_api/models/subscriber.rb +246 -0
  147. data/kinde_api/lib/kinde_api/models/subscribers_subscriber.rb +255 -0
  148. data/kinde_api/lib/kinde_api/models/success_response.rb +2 -0
  149. data/kinde_api/lib/kinde_api/models/token_error_response.rb +230 -0
  150. data/kinde_api/lib/kinde_api/models/token_introspect.rb +262 -0
  151. data/kinde_api/lib/kinde_api/models/update_api_applications_request.rb +226 -0
  152. data/kinde_api/lib/kinde_api/models/update_api_applications_request_applications_inner.rb +235 -0
  153. data/kinde_api/lib/kinde_api/models/update_application_request.rb +254 -0
  154. data/kinde_api/lib/kinde_api/models/update_environement_feature_flag_override_request.rb +225 -0
  155. data/kinde_api/lib/kinde_api/models/update_organization_request.rb +16 -4
  156. data/kinde_api/lib/kinde_api/models/update_organization_users_request.rb +3 -1
  157. data/kinde_api/lib/kinde_api/models/update_organization_users_request_users_inner.rb +2 -0
  158. data/kinde_api/lib/kinde_api/models/update_organization_users_response.rb +2 -0
  159. data/kinde_api/lib/kinde_api/models/update_role_permissions_request.rb +222 -0
  160. data/kinde_api/lib/kinde_api/models/update_role_permissions_request_permissions_inner.rb +230 -0
  161. data/kinde_api/lib/kinde_api/models/update_role_permissions_response.rb +250 -0
  162. data/kinde_api/lib/kinde_api/models/update_roles_request.rb +260 -0
  163. data/kinde_api/lib/kinde_api/models/update_user_request.rb +2 -0
  164. data/kinde_api/lib/kinde_api/models/update_user_response.rb +280 -0
  165. data/kinde_api/lib/kinde_api/models/user.rb +37 -32
  166. data/kinde_api/lib/kinde_api/models/user_identities_inner.rb +228 -0
  167. data/kinde_api/lib/kinde_api/models/user_identity.rb +2 -0
  168. data/kinde_api/lib/kinde_api/models/user_identity_result.rb +2 -0
  169. data/kinde_api/lib/kinde_api/models/user_profile.rb +2 -0
  170. data/kinde_api/lib/kinde_api/models/user_profile_v2.rb +2 -0
  171. data/kinde_api/lib/kinde_api/models/users_response.rb +3 -1
  172. data/kinde_api/lib/kinde_api/models/users_response_users_inner.rb +348 -0
  173. data/kinde_api/lib/kinde_api.rb +47 -2
  174. data/kinde_api/spec/api/apis_api_spec.rb +95 -0
  175. data/kinde_api/spec/api/applications_api_spec.rb +98 -0
  176. data/kinde_api/spec/api/business_api_spec.rb +75 -0
  177. data/kinde_api/spec/api/callbacks_api_spec.rb +69 -5
  178. data/kinde_api/spec/api/environments_api_spec.rb +5 -5
  179. data/kinde_api/spec/api/feature_flags_api_spec.rb +4 -9
  180. data/kinde_api/spec/api/industries_api_spec.rb +48 -0
  181. data/kinde_api/spec/api/o_auth_api_spec.rb +28 -1
  182. data/kinde_api/spec/api/organizations_api_spec.rb +63 -8
  183. data/kinde_api/spec/api/permissions_api_spec.rb +16 -4
  184. data/kinde_api/spec/api/roles_api_spec.rb +57 -4
  185. data/kinde_api/spec/api/subscribers_api_spec.rb +3 -4
  186. data/kinde_api/spec/api/timezones_api_spec.rb +48 -0
  187. data/kinde_api/spec/api/users_api_spec.rb +17 -2
  188. data/kinde_api/spec/api_client_spec.rb +13 -2
  189. data/kinde_api/spec/models/{application_spec.rb → add_apis_request_spec.rb} +8 -8
  190. data/kinde_api/spec/models/api_applications_inner_spec.rb +52 -0
  191. data/kinde_api/spec/models/api_spec.rb +64 -0
  192. data/kinde_api/spec/models/apis_spec.rb +52 -0
  193. data/kinde_api/spec/models/applications_spec.rb +46 -0
  194. data/kinde_api/spec/models/create_application_request_spec.rb +44 -0
  195. data/kinde_api/spec/models/create_application_response_application_spec.rb +46 -0
  196. data/kinde_api/spec/models/create_application_response_spec.rb +46 -0
  197. data/kinde_api/spec/models/create_feature_flag_request_spec.rb +72 -0
  198. data/kinde_api/spec/models/create_organization_request_spec.rb +6 -0
  199. data/kinde_api/spec/models/create_organization_user_permission_request_spec.rb +34 -0
  200. data/kinde_api/spec/models/get_application_response_application_spec.rb +58 -0
  201. data/kinde_api/spec/models/get_application_response_spec.rb +46 -0
  202. data/kinde_api/spec/models/get_applications_response_spec.rb +1 -1
  203. data/kinde_api/spec/models/{get_organizations_users_response_spec.rb → get_organization_users_response_spec.rb} +6 -6
  204. data/kinde_api/spec/models/get_organizations_user_permissions_response_spec.rb +46 -0
  205. data/kinde_api/spec/models/get_permissions_response_spec.rb +52 -0
  206. data/kinde_api/spec/models/get_roles_response_spec.rb +52 -0
  207. data/kinde_api/spec/models/get_subscriber_response_spec.rb +46 -0
  208. data/kinde_api/spec/models/get_subscribers_response_spec.rb +52 -0
  209. data/kinde_api/spec/models/logout_redirect_urls_spec.rb +34 -0
  210. data/kinde_api/spec/models/organization_spec.rb +6 -0
  211. data/kinde_api/spec/models/organization_user_permission_roles_inner_spec.rb +40 -0
  212. data/kinde_api/spec/models/organization_user_permission_spec.rb +58 -0
  213. data/kinde_api/spec/models/organization_user_role_permissions_permissions_spec.rb +34 -0
  214. data/kinde_api/spec/models/organization_user_role_permissions_spec.rb +46 -0
  215. data/kinde_api/spec/models/replace_logout_redirect_urls_request_spec.rb +34 -0
  216. data/kinde_api/spec/models/replace_redirect_callback_urls_request_spec.rb +34 -0
  217. data/kinde_api/spec/models/role_spec.rb +52 -0
  218. data/kinde_api/spec/models/roles_permission_response_inner_spec.rb +52 -0
  219. data/kinde_api/spec/models/roles_spec.rb +6 -0
  220. data/kinde_api/spec/models/subscriber_spec.rb +52 -0
  221. data/kinde_api/spec/models/subscribers_subscriber_spec.rb +58 -0
  222. data/kinde_api/spec/models/token_error_response_spec.rb +40 -0
  223. data/kinde_api/spec/models/token_introspect_spec.rb +58 -0
  224. data/kinde_api/spec/models/update_api_applications_request_applications_inner_spec.rb +40 -0
  225. data/kinde_api/spec/models/update_api_applications_request_spec.rb +34 -0
  226. data/kinde_api/spec/models/update_application_request_spec.rb +52 -0
  227. data/kinde_api/spec/models/update_environement_feature_flag_override_request_spec.rb +34 -0
  228. data/kinde_api/spec/models/update_organization_request_spec.rb +6 -0
  229. data/kinde_api/spec/models/update_role_permissions_request_permissions_inner_spec.rb +40 -0
  230. data/kinde_api/spec/models/update_role_permissions_request_spec.rb +34 -0
  231. data/kinde_api/spec/models/update_role_permissions_response_spec.rb +52 -0
  232. data/kinde_api/spec/models/update_roles_request_spec.rb +52 -0
  233. data/kinde_api/spec/models/update_user_response_spec.rb +70 -0
  234. data/kinde_api/spec/models/user_identities_inner_spec.rb +40 -0
  235. data/kinde_api/spec/models/user_spec.rb +9 -9
  236. data/kinde_api/spec/models/users_response_users_inner_spec.rb +106 -0
  237. data/kinde_sdk.gemspec +1 -1
  238. data/lib/kinde_sdk/client.rb +17 -5
  239. data/lib/kinde_sdk/configuration.rb +2 -0
  240. data/lib/kinde_sdk/version.rb +1 -1
  241. data/lib/kinde_sdk.rb +1 -1
  242. data/spec/kinde_sdk_spec.rb +2 -18
  243. metadata +193 -12
  244. data/kinde_api/docs/Application.md +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2edea62c5bda0b80177bcb0444a278e5deb6b6a99317f29f2e5d51033dd6a488
4
- data.tar.gz: 360a4ef5a4de05384ad6186960f22c3955839d63edcc7df6cb3f76f66428fdb0
3
+ metadata.gz: 0a84ffe92552e8ab43146d5fd7445edefc924495388368adae348ae48ba6d621
4
+ data.tar.gz: 779838b43100f0d9e78fe54199f7e9f26b9818f6fe18904529664b7de631f6d5
5
5
  SHA512:
6
- metadata.gz: 6b69c73af4c5ca4c291e54cba3c9284d74d2aaab8024c27c6d09b7f40ac859cf3004dabf362dd5839acf46d2bfab25f9fcd4a67377ea52afb948e619b6827eec
7
- data.tar.gz: b9b249b70f9983335153b5d6ba6ab8187588c4a9da240e97fb6e1f17076b37d600d16a7ea61c9693adf419d80cdbdfa671f867b8a8d94dab9331c6925ef564e0
6
+ metadata.gz: 9469af65325f71dab96c2c901fc2ffa70258ed92f65841d5009f1dd67536d704ef917000638ff1e00eb17a3fb7edc6095fa1fecae66574d3c1837d72ba1491e4
7
+ data.tar.gz: a3cc75b2c027b5ff0d166f7bd54e942f7c7efa467586a175fb1f83412d3d7829d2ddb58cd4bf3eb7b1594019f85c6417bce0c3435b67c6ef4552ecf7793cbdb0
data/Gemfile.lock ADDED
@@ -0,0 +1,128 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ kinde_sdk (1.2.1)
5
+ faraday-follow_redirects
6
+ oauth2 (~> 2.0)
7
+ pkce_challenge
8
+ typhoeus (~> 1.0, >= 1.0.1)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.8.5)
14
+ public_suffix (>= 2.0.2, < 6.0)
15
+ ast (2.4.2)
16
+ base64 (0.1.1)
17
+ byebug (11.1.3)
18
+ coderay (1.1.3)
19
+ crack (0.4.5)
20
+ rexml
21
+ diff-lcs (1.5.0)
22
+ ethon (0.16.0)
23
+ ffi (>= 1.15.0)
24
+ faraday (2.7.11)
25
+ base64
26
+ faraday-net_http (>= 2.0, < 3.1)
27
+ ruby2_keywords (>= 0.0.4)
28
+ faraday-follow_redirects (0.3.0)
29
+ faraday (>= 1, < 3)
30
+ faraday-net_http (3.0.2)
31
+ ffi (1.16.3)
32
+ hashdiff (1.0.1)
33
+ hashie (5.0.0)
34
+ json (2.6.3)
35
+ jwt (2.7.1)
36
+ language_server-protocol (3.17.0.3)
37
+ method_source (1.0.0)
38
+ multi_xml (0.6.0)
39
+ oauth2 (2.0.9)
40
+ faraday (>= 0.17.3, < 3.0)
41
+ jwt (>= 1.0, < 3.0)
42
+ multi_xml (~> 0.5)
43
+ rack (>= 1.2, < 4)
44
+ snaky_hash (~> 2.0)
45
+ version_gem (~> 1.1)
46
+ parallel (1.23.0)
47
+ parser (3.2.2.4)
48
+ ast (~> 2.4.1)
49
+ racc
50
+ pkce_challenge (1.0.0)
51
+ pry (0.14.2)
52
+ coderay (~> 1.1)
53
+ method_source (~> 1.0)
54
+ pry-byebug (3.10.1)
55
+ byebug (~> 11.0)
56
+ pry (>= 0.13, < 0.15)
57
+ public_suffix (5.0.3)
58
+ racc (1.7.2)
59
+ rack (3.0.8)
60
+ rainbow (3.1.1)
61
+ rake (13.0.6)
62
+ regexp_parser (2.8.2)
63
+ rexml (3.2.6)
64
+ rspec (3.12.0)
65
+ rspec-core (~> 3.12.0)
66
+ rspec-expectations (~> 3.12.0)
67
+ rspec-mocks (~> 3.12.0)
68
+ rspec-core (3.12.2)
69
+ rspec-support (~> 3.12.0)
70
+ rspec-expectations (3.12.3)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.12.0)
73
+ rspec-mocks (3.12.6)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.12.0)
76
+ rspec-support (3.12.1)
77
+ rubocop (1.57.2)
78
+ json (~> 2.3)
79
+ language_server-protocol (>= 3.17.0)
80
+ parallel (~> 1.10)
81
+ parser (>= 3.2.2.4)
82
+ rainbow (>= 2.2.2, < 4.0)
83
+ regexp_parser (>= 1.8, < 3.0)
84
+ rexml (>= 3.2.5, < 4.0)
85
+ rubocop-ast (>= 1.28.1, < 2.0)
86
+ ruby-progressbar (~> 1.7)
87
+ unicode-display_width (>= 2.4.0, < 3.0)
88
+ rubocop-ast (1.30.0)
89
+ parser (>= 3.2.1.0)
90
+ rubocop-capybara (2.19.0)
91
+ rubocop (~> 1.41)
92
+ rubocop-factory_bot (2.24.0)
93
+ rubocop (~> 1.33)
94
+ rubocop-rake (0.6.0)
95
+ rubocop (~> 1.0)
96
+ rubocop-rspec (2.25.0)
97
+ rubocop (~> 1.40)
98
+ rubocop-capybara (~> 2.17)
99
+ rubocop-factory_bot (~> 2.22)
100
+ ruby-progressbar (1.13.0)
101
+ ruby2_keywords (0.0.5)
102
+ snaky_hash (2.0.1)
103
+ hashie
104
+ version_gem (~> 1.1, >= 1.1.1)
105
+ typhoeus (1.4.0)
106
+ ethon (>= 0.9.0)
107
+ unicode-display_width (2.5.0)
108
+ version_gem (1.1.3)
109
+ webmock (3.19.1)
110
+ addressable (>= 2.8.0)
111
+ crack (>= 0.3.2)
112
+ hashdiff (>= 0.4.0, < 2.0.0)
113
+
114
+ PLATFORMS
115
+ arm64-darwin-22
116
+
117
+ DEPENDENCIES
118
+ kinde_sdk!
119
+ pry-byebug
120
+ rake (~> 13.0.1)
121
+ rspec (~> 3.6, >= 3.6.0)
122
+ rubocop
123
+ rubocop-rake
124
+ rubocop-rspec
125
+ webmock
126
+
127
+ BUNDLED WITH
128
+ 2.4.21
data/README.md CHANGED
@@ -1,435 +1,23 @@
1
- # Kinde Ruby SDK
1
+ # Kinde Ruby SDK
2
2
 
3
- The Kinde Ruby SDK gem allows developers to integrate Kinde API into any ruby-based applications, Rails or non-Rails.
4
- The gem contains all the related oauth2 authorization, so you need only to integrate it properly.
5
- The gem contains 3 pre-built OAuth flows: **client credentials**, **authorization code** and **authorization code with PKCE code verifier**.
3
+ The Kinde SDK for Ruby.
6
4
 
7
- ## Register for Kinde
5
+ You can also use the Ruby starter kit [here](https://github.com/kinde-starter-kits/ruby-starter-kit).
8
6
 
9
- If you haven’t already got a Kinde account, register for free [here](http://app.kinde.com/register) (no credit card required).
7
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com) [![Kinde Docs](https://img.shields.io/badge/Kinde-Docs-eee?style=flat-square)](https://kinde.com/docs/developer-tools) [![Kinde Community](https://img.shields.io/badge/Kinde-Community-eee?style=flat-square)](https://thekindecommunity.slack.com)
10
8
 
11
- You need a Kinde domain to get started, e.g. yourapp.kinde.com.
9
+ ## Documentation
12
10
 
13
- ## Installation
11
+ For details on integrating this SDK into your project, head over to the [Kinde docs](https://kinde.com/docs/) and see the [Ruby SDK](https://kinde.com/docs/developer-tools/ruby-sdk) doc 👍🏼.
14
12
 
15
- Add this line into your Gemfile and run bundler:
16
- ```
17
- gem 'kinde_sdk', git: 'https://github.com/kinde-oss/kinde-ruby-sdk.git', branch: 'main'
18
- ```
19
- or install manually through gem command.
13
+ ## Publishing
20
14
 
21
- ## Getting started
15
+ The core team handles publishing.
22
16
 
23
- ### Kinde configuration
17
+ ## Contributing
24
18
 
25
- On the Kinde web app navigate to `Settings` in the left menu, then select `App keys` and find the `Callbacks` input field.
19
+ Please refer to Kinde’s [contributing guidelines](https://github.com/kinde-oss/.github/blob/489e2ca9c3307c2b2e098a885e22f2239116394a/CONTRIBUTING.md).
26
20
 
27
- Here you want to put in the callback URLs for your application, which should look something like this:
21
+ ## License
28
22
 
29
- - **Allowed callback URLs** - `http://localhost:3000/api/auth/kinde_callback`
30
- - **Allowed logout redirect URLs** - `http://localhost:3000`
31
-
32
- Make sure you press the Save button at the bottom of the page!
33
-
34
- _Note_: The `http://localhost:3000` is used as an example of local address, don't forget to add all the required addresses that you are going to use in any environments.
35
-
36
- ### Environments
37
-
38
- If you would like to use our Environments feature as part of your development process. You will need to create them first within your Kinde account, see the guide here.
39
- In this case you would use the Environment subdomain in the code block above.
40
-
41
- ### Configuring your app
42
-
43
- In a basic scenario it requires several steps to be made:
44
- 1. proper configuring of client credentials and domain
45
- 2. external service authorization
46
- 3. callback processing
47
- 4. bearer token receiving
48
- 5. Usage
49
-
50
- #### Integration
51
- The gem contains simple configurator which you can use whenever you want. For example, in a typical Rails-app it can be
52
- configured through initializer file:
53
-
54
- ```ruby
55
- # domain, client_id/secret and callback defined somewhere in your settings
56
-
57
- KindeSdk.configure do |c|
58
- c.domain = domain
59
- c.client_id = client_id
60
- c.client_secret = client_secret
61
- c.callback_url = callback_url
62
- c.logout_url = logout_url
63
- # c.scope = 'openid offline email profile' # default value
64
- # c.pkce_enabled = true # default value
65
- # c.authorize_url = '/oauth2/auth' # default value
66
- # c.token_url = '/oauth2/token' # default value
67
- # c.debugging = false # default value
68
- c.logger = Rails.logger
69
- end
70
- ```
71
- Snippet above contains all the possible configuration values.
72
- Here is detailed explanation on them:
73
-
74
- - `Domain` refers to your organization - for example, `your-biz.kinde.com`.
75
- - `Client id` and `Client secret` can be fetched from your Kinde application credentials in a setting section.
76
- - `Callback url` refers to your callback processing controller action. Remember that
77
- the url must be defined in allowed callback urls of your kinde organization's [application config](#Kinde-configuration).
78
- Callback url is an optional parameter, you can set the desired url in runtime, see examples below.
79
- - `Logout url` will be triggered after successful logout on kinde. Same as callback url, it should be
80
- defined in allowed logout urls of your kinde organization's application config
81
- - `Scope` is an oauth special parameter which is used to limit some rights. Probably, you don't need to change in.
82
- - `PKCE enabled` is a flag that can turn off PKCE auth flow. By default it is activated to improve your security.
83
- - `Authorize url` and `Token url` are paths to oauth2 methods in kinde. You don't need to change it.
84
- - `Debugging` set to true start writing verbose request logs. Might be useful while developing your application.
85
- - `Logger` might be set to any kind of loggers you are using. By default it is set to `Rails.logger` if gem is used in
86
- rails application or `Logger.new(STDOUT)` if it is not a rails app.
87
-
88
- These variables can be handled with any system you want: .env files, settings.yml or any type of config files.
89
- For example, .env file (you can name variables by yourself):
90
- ```
91
- KINDE_DOMAIN=https://example.kinde.com
92
- KINDE_CLIENT_ID=qwe
93
- KINDE_CLIENT_SECRET=wert
94
- KINDE_CALLBACK_URL=http://localhost:3000/callback
95
- KINDE_LOGOUT_URL=http://localhost:3000/logout_callback
96
- ```
97
-
98
- can be used as:
99
- ```ruby
100
- KindeSdk.configure do |c|
101
- c.domain = ENV['KINDE_DOMAIN']
102
- c.client_id = ENV['KINDE_CLIENT_ID']
103
- # ....
104
- end
105
- ```
106
-
107
- #### Login / Register
108
- The next step is to authorize you in the Kinde.
109
- For this, you need to acquire auth url by calling:
110
- ```ruby
111
- KindeSdk.auth_url
112
- # =>
113
- {
114
- url: "https://<domain>/oauth2/auth?client_id=<client_id>&code_challenge=<generated code>&code_challenge_method=S256&redirect_uri=<redirect_uri>&response_type=code&scope=openid+offline+email+profile&state=<random string>",
115
- code_verifier: "<challenge verifier>"
116
- }
117
- ```
118
- By default, gem uses PKCE verification flow - this means that in your auth url will be added special `code challenge`
119
- param and the method returns verification string for the code, which should be used later in token acquiring request.
120
- You are free to disable PKCE by setting `pkce_enabled` to false in your configuration.
121
- In this case, `KindeSdk.auth_url` will return only url itself:
122
- ```ruby
123
- KindeSdk.auth_url
124
- # => {url: ......}
125
- ```
126
- If you are about to use PCKE, our recommendation to save code verifier output somewhere near your later tokens output.
127
-
128
- The `#auth_url` method can have another redirect url just in runtime. Use it with the argument:
129
- ```ruby
130
- KindeSdk.auth_url(redirect_uri: "your-another-desired-callback")
131
- ```
132
-
133
- You can put the link right in your web-application page or you can use it under the hood through redirection.
134
- After visiting the link you'll be redirected to Kinde's sign in/sign up form.
135
- And after authorizing in Kinde, you'll be redirected to callback url.
136
-
137
- #### Handle redirect
138
- Next step is to extract code from the callback redirection. Your callback endpoint should contain logic to call exchange method.
139
- Callback will be triggered with body, where will be code present. You are free to use the whole `params` object or to extract code from `params["code"]`.
140
-
141
- Next, it needs to be exchanged for the access and refresh tokens.
142
- `code` is the parameter which received in the callback endpoint, `code_verifier` (if PKCE enabled) should be used from previous step:
143
- ```ruby
144
- KindeSdk.fetch_tokens(code, code_verifier: code_verifier)
145
- # =>
146
- {"access_token"=>"eyJhbGciOiJSUzI1NiIsIm...",
147
- "expires_in"=>86399,
148
- "id_token"=>"eyJhbGciOiJSUz",
149
- "refresh_token"=>"eyJhbGciOiJSUz",
150
- "scope"=>"openid offline email profile",
151
- "token_type"=>"bearer"}
152
- ```
153
-
154
- This is your tokens - save the whole hash in your session, redis or any other storage and use it to build your client:
155
- ```ruby
156
- # In case of preventing cookie overflow, you need to limit what exactly your are saving.
157
- # Here is the required minimum of params. But in general you are able save it wherever you want to.
158
- # For example, in database, without any limiting.
159
- session[:kinde_auth] = KindeSdk.fetch_tokens(code).slice(:access_token, :id_token, :refresh_token, :expires_at)
160
- # ...
161
- client = KindeSdk.client(session[:kinde_auth]) # => #<KindeSdk::Client:0x00007faf31e5ecb8>
162
- ```
163
-
164
- The `#fetch_tokens` method can have another callback url (just lake the `#auth_url` method), just use it in a same way:
165
- ```ruby
166
- KindeSdk.fetch_tokens(code, redirect_uri: "your-another-desired-callback")
167
- ```
168
-
169
- #### Token expiration and refreshing
170
- For proper refreshing you'll need to use `access_token`, `refresh_token` and probably `expires_in` if you want to know is your access token still actual.
171
- Use these two methods to work with refreshing:
172
- ```ruby
173
- KindeSdk.token_expired?(session[:kinde_auth]) # => false
174
- KindeSdk.refresh_token(session[:kinde_auth]) # => {"access_token" => "qwe...", "refresh_token" => "fqw...", "expires_at"=>1685474405}
175
- ```
176
- or from your client instance:
177
- ```ruby
178
- client.token_expired? # => false
179
- client.refresh_token # => {"access_token" => "qwe...", ...., "expires_at"=>1685474405}
180
- ```
181
- If you are calling `#refresh_token` on a client instance, the instance token data will be automatically updated.
182
- If you are calling `KindeSdk#refresh_token`, you'll need to store new token data in your configured storage (redis/session/etc).
183
-
184
- #### Audience
185
- An `audience` is the intended recipient of an access token - for example the API for your application.
186
- The audience argument can be passed to the Kinde `#auth_url` method to request an audience be added to the provided token:
187
- ```ruby
188
- KindeSdk.auth_url(audience: "https://your-app.kinde.com/api")
189
- ```
190
- For details on how to connect, see [Register an API](https://kinde.com/docs/developer-tools/register-an-api/)
191
-
192
- #### Overriding scope
193
- By default `KindeSdk` requests the following scopes:
194
-
195
- - profile
196
- - email
197
- - offline
198
- - openid
199
-
200
- You are able to change it - by configuring as mentioned at [Integration](#integration) or by direct param passing into `auth_url` method:
201
- ```ruby
202
- KindeSdk.auth_url(scope: "openid offline")
203
- ```
204
-
205
- #### Getting claims
206
- We have provided a helper to grab any claim from your id or access tokens. The helper defaults to access tokens:
207
- ```ruby
208
- client = KindeSdk.client(session[:kinde_auth])
209
- client.get_claim("aud") #=> {name: "aud", value: ['api.yourapp.com']}
210
- client.get_claim("scp") #=> {name: "scp", value: ["openid", "offline"]}
211
- ```
212
- By default claim data fetched from access_token, but you can also do it with id_token as well:
213
- ```ruby
214
- client.get_claim("some-claim", :id_token) # => {name: "some-claim", value: "some-data"}
215
- ```
216
-
217
- #### User permissions
218
- After a user signs in and they are verified, the token return includes permissions for that user.
219
- [User permissions](https://kinde.com/docs/user-management/user-permissions) are set in Kinde,
220
- but you must also configure your application to unlock these functions.
221
- ```
222
- permissions" => [
223
- "create:todos",
224
- "update:todos",
225
- "read:todos",
226
- "delete:todos",
227
- "create:tasks",
228
- "update:tasks",
229
- "read:tasks",
230
- "delete:tasks",
231
- ]
232
- ```
233
- We provide helper functions to more easily access permissions:
234
- ```ruby
235
- client = KindeSdk.client(session[:kinde_auth])
236
- client.get_permission("create:todos") # => {org_code: "org_1234", is_granted: true}
237
- client.permission_granted?("create:todos") # => true
238
- client.permission_granted?("create:orders") # => false
239
- ```
240
-
241
- #### Feature flags
242
- Kinde itself provides feature flag functionality - more [here](https://kinde.com/feature-flags/).
243
- So, the SDK provides methods to work with them.
244
- For example, you have data like below:
245
- ```json
246
- {
247
- "asd": { "t": "b", "v": true },
248
- "eeeeee": { "t": "i", "v": 111 },
249
- "qqq": { "t": "s", "v": "aa" }
250
- }
251
- ```
252
- where `t` refers to type (`b` - boolean, `i` - integer, `s` - string) and `v` refers to value.
253
- You can fetch these flags with methods below:
254
- ```ruby
255
- client.get_flag("asd") # => { code: "asd", is_default: false, type: "boolean", value: true }
256
- client.get_flag("eeeeee") # => { code: "eeeeee", is_default: false, type: "integer", value: 111 }
257
- client.get_flag("qqq") # => { code: "qqq", is_default: false, type: "string", value: "aa" }
258
- ```
259
- Note that trying to call undefined flag leads to exception.
260
-
261
- In addition to fetch existing flags, you can use fallbacks. For example:
262
- ```ruby
263
- client.get_flag("undefined", { default_value: true }) # => { code: "undefined", is_default: true, value: true }
264
- ```
265
-
266
- and with setting the type explicitly (output omitted except value):
267
- ```ruby
268
- client.get_flag("undefined_bool", { default_value: true }, "b") # => value = true
269
- client.get_flag("undefined_string", { default_value: "true" }, "s") # => value = "true"
270
- client.get_flag("undefined_int", { default_value: 111 }, "i") # => value = 111
271
- ```
272
- In the example above if you try to set default_value of different type (for example: `get_flag("flag", {default_value: 1}, "s")`), you'll get an exception.
273
-
274
- Also you have wrapper methods, for example:
275
- ```ruby
276
- client.get_boolean_flag("eeeeee") # => leads to exception "Flag eeeeee value type is different from requested type"
277
- client.get_boolean_flag("asd") # => true
278
- client.get_boolean_flag("undefined", false) # => false
279
-
280
- client.get_integer_flag("asd") # => exception "Flag asd value type is different from requested type"
281
- client.get_integer_flag("undefined", "true") # => exception "Flag undefined value type is different from requested type"
282
- client.get_integer_flag("eeeeee") # => 111
283
- client.get_integer_flag("undefined", 123) # => 123
284
-
285
- client.get_string_flag("qqq") # => "aa"
286
- client.get_string_flag("undefined", "111") # => "111"
287
- ```
288
-
289
- #### Client usage
290
- API part is mounted in the `KindeSdk::Client` instance, so the short usage is just simple as:
291
- ```ruby
292
- client.oauth.get_user
293
- client.users.create_user(args)
294
- client.organizations.get_organizations
295
- ```
296
- The method name will be the same as API module from sdk without `-Api` part in the end.
297
- Alternatively, you can initialize each API module by yourself:
298
- ```ruby
299
- # use initialized and configured api client
300
- api_client = KindeSdk.api_client(access_token)
301
- instance_client = KindeApi::UsersApi.new(api_client)
302
- instance_client.create_user(args)
303
- ```
304
-
305
- #### Logout
306
- For logout you need to call (in case of rails app) in your controller:
307
- ```ruby
308
- redirect_to KindeSdk.logout_url, allow_other_host: true
309
- ```
310
- Your app should handle logout callback url (which was configured separately).
311
- After calling redirect to logout_url (if set), Kinde redirect it back to logout callback path, where you need to clear your session:
312
- ```ruby
313
- # .......
314
- def logout_callback
315
- Rails.logger.info("logout callback successfully received")
316
- reset_session
317
- redirect_to root_path
318
- end
319
- # ......
320
- ```
321
- If you configured logout redirect url correct (e.g. added in the admin panel allowed logout redirect), you can receive
322
- a logout callback. Otherwise Kinde logout message will be shown.
323
-
324
- ### Organizations
325
- #### Create an organization
326
- To have a new organization created within your application, you will need to run something like:
327
- ```ruby
328
- client.organizations.create_organization(create_organization_request: {name: "new_org"})
329
- # or `client.organizations.create_organization` without name
330
- ```
331
-
332
- ### Sign up and sign in to organizations
333
- Kinde has a unique code for every organization.
334
- If you want a user to sign into a particular organization, call the `#auth_url` method with `org_code` param passing:
335
- ```ruby
336
- KindeSdk.auth_url(org_code: "org_1234", start_page: "registration") # to enforce new user creation form
337
- KindeSdk.auth_url(org_code: "org_1234") # to login by default
338
- ```
339
-
340
- Following authentication, Kinde provides a json web token (jwt) to your application.
341
- Along with the standard information we also include the `org_code` and the permissions for that organization (this is important as a user can belong to multiple organizations and have different permissions for each).
342
-
343
- Example of a returned token:
344
- ```ruby
345
- [
346
- {
347
- "aud" => [],
348
- "exp" => 1658475930,
349
- "iat" => 1658472329,
350
- "iss" => "https://your_subdomain.kinde.com",
351
- "jti" => "123457890",
352
- "org_code" => "org_1234",
353
- "permissions" => ["read:todos", "create:todos"],
354
- "scp" => [
355
- "openid",
356
- "profile",
357
- "email",
358
- "offline"
359
- ],
360
- "sub" => "kp:123457890",
361
- "feature_flags" => {
362
- "asd" => { "t" => "b", "v" => true },
363
- "eeeeee" => { "t" => "i", "v" => 111 },
364
- "qqq" => { "t" => "s", "v" => "aa" }
365
- }
366
- }
367
- ]
368
- ```
369
- The `id_token` will also contain an array of organizations that a user belongs to - this is useful if you wanted to build out an organization switcher for example:
370
- ```ruby
371
- client.get_claim("org_codes", :id_token) # => {name: "org_codes", value: ["org_1234", "org_5462"]}
372
- ```
373
-
374
- ### API reference
375
- Detailed API reference described in [KindeSDK README](kinde-sdk/README.md) and underlying description docs.
376
- Here are some selected examples of usage.
377
-
378
- #### Getting user info
379
-
380
- ```ruby
381
- KindeSdk.client(session[:kinde_auth]).oauth.get_user
382
- # => {id: ..., preferred_email: ..., provided_id: ..., last_name: ..., first_name: ...}
383
- ```
384
-
385
- #### Management API
386
- These sections below are part of management API. It should be configured first at your Kinde account
387
- [Here is detailed note about it](https://kinde.notion.site/Management-API-via-client_credentials-240e6fa548c144828d4981ddbaa0f6b2),
388
- you need to add `Machine to Machine` (M2M) application and use another grant type for authorization:
389
- ```ruby
390
- result = KindeSdk.client_credentials_access(
391
- client_id: ENV["KINDE_MANAGEMENT_CLIENT_ID"],
392
- client_secret: ENV["KINDE_MANAGEMENT_CLIENT_SECRET"]
393
- )
394
- # as an example of usage redis to save access token:
395
- $redis.set("kinde_m2m_token", result["access_token"], ex: result["expires_in"].to_i)
396
- ```
397
-
398
- ##### Organizations handling
399
- ```ruby
400
- client = KindeSdk.client({"access_token" => $redis.get("kinde_m2m_token")})
401
- # get organizations list:
402
- client.organizations.get_organizations
403
- # => {"code": "OK", "message": "Success", "next_token": "qweqweqwe", "organizations": [{"code": "org_casda123c", "name": "Default Organization", "is_default": true}]}
404
-
405
- # create new organization:
406
- client.organizations.create_organization(create_organization_request: {name: "new_org"})
407
- # this variant for more strict input params validation:
408
- # client.organizations.create_organization(create_organization_request: KindeApi::CreateOrganizationRequest.new(name: new_org_name))
409
- ```
410
-
411
- #### Create new user
412
- ```ruby
413
- client.users.create_user(
414
- create_user_request: {
415
- profile: {given_name: "AAAname", family_name: "AAAsurname"},
416
- identities: [{type: "email", details: {email: "aaexample@asd.com"}}]
417
- }
418
- )
419
- ```
420
- Alternatively, using model instances:
421
- ```ruby
422
- request = KindeApi::CreateUserRequest.new(
423
- profile: KindeApi::CreateUserRequestProfile.new(given_name: "AAAfirstname1", family_name: "AAAlastname1"),
424
- identities: [
425
- KindeApi::CreateUserRequestIdentitiesInner.new(type: "email", details: KindeApi::CreateUserRequestIdentitiesInnerDetails.new(email: "aaaaexample@example.com"))
426
- ]
427
- )
428
- client.users.create_user(create_user_request: request)
429
- ```
430
-
431
- #### Add organization users
432
-
433
- ```ruby
434
- client.organizations.add_organization_users(code: "org_1111", users: ["kp:12311...."])
435
- ```
23
+ By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.