clerk-sdk-ruby 8.0.1 → 9.0.0
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.
- checksums.yaml +4 -4
- data/lib/clerk/actortokens.rb +9 -9
- data/lib/clerk/admin_portal_link_tokens.rb +18 -18
- data/lib/clerk/agenttasks.rb +9 -9
- data/lib/clerk/allowlistidentifiers.rb +13 -13
- data/lib/clerk/api_keys.rb +48 -48
- data/lib/clerk/betafeatures.rb +12 -10
- data/lib/clerk/billing.rb +68 -68
- data/lib/clerk/blocklistidentifiers.rb +13 -13
- data/lib/clerk/clients.rb +13 -13
- data/lib/clerk/directories.rb +342 -46
- data/lib/clerk/domains.rb +23 -20
- data/lib/clerk/emailaddresses.rb +37 -37
- data/lib/clerk/emailandsmstemplates.rb +5 -5
- data/lib/clerk/emailsmstemplates.rb +17 -17
- data/lib/clerk/enterpriseconnections.rb +31 -31
- data/lib/clerk/instancesettings.rb +52 -50
- data/lib/clerk/invitations.rb +166 -18
- data/lib/clerk/jwks.rb +3 -3
- data/lib/clerk/jwttemplates.rb +21 -21
- data/lib/clerk/logs.rb +683 -0
- data/lib/clerk/m2m.rb +27 -27
- data/lib/clerk/machines.rb +41 -41
- data/lib/clerk/miscellaneous.rb +2 -2
- data/lib/clerk/models/components/clerkerror.rb +1 -1
- data/lib/clerk/models/components/data.rb +27 -0
- data/lib/clerk/models/components/{type.rbi → data.rbi} +2 -2
- data/lib/clerk/models/components/directory.rb +8 -2
- data/lib/clerk/models/components/directory.rbi +2 -0
- data/lib/clerk/models/components/directorygroup.rb +44 -0
- data/lib/clerk/models/components/{directory_group.rbi → directorygroup.rbi} +4 -0
- data/lib/clerk/models/components/directorygroup_object.rb +19 -0
- data/lib/clerk/models/components/directorygroup_object.rbi +11 -0
- data/lib/clerk/models/components/directorygroupmember.rb +40 -0
- data/lib/clerk/models/components/directorygroupmember.rbi +17 -0
- data/lib/clerk/models/components/directorygroupmember_list.rb +36 -0
- data/lib/clerk/models/components/directorygroupmember_list.rbi +15 -0
- data/lib/clerk/models/components/directorygroupmember_list_cursor.rb +40 -0
- data/lib/clerk/models/components/directorygroupmember_list_cursor.rbi +17 -0
- data/lib/clerk/models/components/directorygroupmember_object.rb +19 -0
- data/lib/clerk/models/components/directorygroupmember_object.rbi +11 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted.rb +1 -1
- data/lib/clerk/models/components/emailaddress_verification_saml_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enterpriseaccount.rb +1 -1
- data/lib/clerk/models/components/enterpriseaccount_verification_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enterpriseaccount_verification_saml_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enterpriseconnection_idp_certificate.rb +40 -0
- data/lib/clerk/models/components/enterpriseconnection_idp_certificate.rbi +17 -0
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rb +18 -1
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rbi +8 -0
- data/lib/clerk/models/components/enterpriseconnectiontestrun.rb +1 -1
- data/lib/clerk/models/components/enterpriseconnectiontestrun_log.rb +44 -0
- data/lib/clerk/models/components/enterpriseconnectiontestrun_log.rbi +19 -0
- data/lib/clerk/models/components/externalaccountwithverification.rb +2 -2
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/first_event.rb +115 -0
- data/lib/clerk/models/components/first_event.rbi +49 -0
- data/lib/clerk/models/components/instance.rb +5 -1
- data/lib/clerk/models/components/instance.rbi +2 -0
- data/lib/clerk/models/components/instanceprotect.rb +1 -1
- data/lib/clerk/models/components/invitation.rb +1 -1
- data/lib/clerk/models/components/invitation_revoked.rb +2 -2
- data/lib/clerk/models/components/log.rb +87 -18
- data/lib/clerk/models/components/log.rbi +38 -8
- data/lib/clerk/models/components/log_impersonator.rb +32 -0
- data/lib/clerk/models/components/log_impersonator.rbi +13 -0
- data/lib/clerk/models/components/log_list.rb +39 -0
- data/lib/clerk/models/components/log_list.rbi +15 -0
- data/lib/clerk/models/components/log_list_cursor.rb +72 -0
- data/lib/clerk/models/components/log_list_cursor.rbi +29 -0
- data/lib/clerk/models/components/logapplicationcontext.rb +36 -0
- data/lib/clerk/models/components/logapplicationcontext.rbi +15 -0
- data/lib/clerk/models/components/logbrowsercontext.rb +36 -0
- data/lib/clerk/models/components/logbrowsercontext.rbi +15 -0
- data/lib/clerk/models/components/logcontext.rb +36 -0
- data/lib/clerk/models/components/logcontext.rbi +15 -0
- data/lib/clerk/models/components/logdevicecontext.rb +60 -0
- data/lib/clerk/models/components/logdevicecontext.rbi +27 -0
- data/lib/clerk/models/components/logdomaincontext.rb +36 -0
- data/lib/clerk/models/components/logdomaincontext.rbi +15 -0
- data/lib/clerk/models/components/logenvironmentcontext.rb +44 -0
- data/lib/clerk/models/components/logenvironmentcontext.rbi +19 -0
- data/lib/clerk/models/components/loggroup.rb +89 -0
- data/lib/clerk/models/components/loggroup.rbi +37 -0
- data/lib/clerk/models/components/loggroup_impersonator.rb +32 -0
- data/lib/clerk/models/components/loggroup_impersonator.rbi +13 -0
- data/lib/clerk/models/components/loggroup_object.rb +19 -0
- data/lib/clerk/models/components/loggroup_object.rbi +11 -0
- data/lib/clerk/models/components/loglocationcontext.rb +41 -0
- data/lib/clerk/models/components/loglocationcontext.rbi +17 -0
- data/lib/clerk/models/components/logschema.rb +68 -0
- data/lib/clerk/models/components/logschema.rbi +25 -0
- data/lib/clerk/models/components/logschemafield.rb +49 -0
- data/lib/clerk/models/components/logschemafield.rbi +19 -0
- data/lib/clerk/models/components/logschemafield_type.rb +22 -0
- data/lib/clerk/models/components/logschemafield_type.rbi +11 -0
- data/lib/clerk/models/components/logwithpayload.rb +110 -0
- data/lib/clerk/models/components/logwithpayload.rbi +49 -0
- data/lib/clerk/models/components/logwithpayload_impersonator.rb +32 -0
- data/lib/clerk/models/components/logwithpayload_impersonator.rbi +13 -0
- data/lib/clerk/models/components/machine_deleted.rb +1 -1
- data/lib/clerk/models/components/machinescope_deleted.rb +1 -1
- data/lib/clerk/models/components/next_page_status.rb +21 -0
- data/lib/clerk/models/components/next_page_status.rbi +11 -0
- data/lib/clerk/models/components/oauthaccesstoken.rb +1 -1
- data/lib/clerk/models/components/oauthapplication.rb +9 -1
- data/lib/clerk/models/components/oauthapplication.rbi +4 -0
- data/lib/clerk/models/components/oauthapplicationsettings.rb +9 -1
- data/lib/clerk/models/components/oauthapplicationsettings.rbi +4 -0
- data/lib/clerk/models/components/oauthapplicationwithsecret.rb +9 -1
- data/lib/clerk/models/components/oauthapplicationwithsecret.rbi +4 -0
- data/lib/clerk/models/components/organization.rb +13 -8
- data/lib/clerk/models/components/organization.rbi +4 -2
- data/lib/clerk/models/components/organizationinvitation.rb +2 -2
- data/lib/clerk/models/components/organizationinvitationwithpublicorganizationdata.rb +2 -2
- data/lib/clerk/models/components/organizationmembership.rb +2 -2
- data/lib/clerk/models/components/organizationmembership_organization.rb +13 -8
- data/lib/clerk/models/components/organizationmembership_organization.rbi +4 -2
- data/lib/clerk/models/components/organizationwithlogo.rb +13 -8
- data/lib/clerk/models/components/organizationwithlogo.rbi +4 -2
- data/lib/clerk/models/components/role_set_migration.rb +1 -1
- data/lib/clerk/models/components/roleset.rb +1 -1
- data/lib/clerk/models/components/{type.rb → roleset_type.rb} +2 -2
- data/lib/clerk/models/components/roleset_type.rbi +11 -0
- data/lib/clerk/models/components/samlaccount.rb +1 -1
- data/lib/clerk/models/components/samlaccount_clerkerror.rb +1 -1
- data/lib/clerk/models/components/samlconnection_1.rb +6 -1
- data/lib/clerk/models/components/samlconnection_1.rbi +2 -0
- data/lib/clerk/models/components/samlconnection_2.rb +6 -1
- data/lib/clerk/models/components/samlconnection_2.rbi +2 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_1.rb +40 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_1.rbi +17 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_2.rb +40 -0
- data/lib/clerk/models/components/samlconnection_idp_certificate_2.rbi +17 -0
- data/lib/clerk/models/components/scimdirectory.rb +8 -2
- data/lib/clerk/models/components/scimdirectory.rbi +2 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted.rb +1 -1
- data/lib/clerk/models/components/session.rb +2 -2
- data/lib/clerk/models/components/signup.rb +7 -3
- data/lib/clerk/models/components/signup.rbi +2 -0
- data/lib/clerk/models/components/signupverification.rb +1 -1
- data/lib/clerk/models/components/ssobypassallowlistpublicuserdata.rb +58 -0
- data/lib/clerk/models/components/ssobypassallowlistpublicuserdata.rbi +25 -0
- data/lib/clerk/models/components/ssobypassallowlistuser.rb +49 -0
- data/lib/clerk/models/components/ssobypassallowlistuser.rbi +21 -0
- data/lib/clerk/models/components/ssobypassallowlistuser_object.rb +19 -0
- data/lib/clerk/models/components/ssobypassallowlistuser_object.rbi +11 -0
- data/lib/clerk/models/components/user.rb +8 -4
- data/lib/clerk/models/components/user.rbi +2 -0
- data/lib/clerk/models/components/user_directory.rb +1 -1
- data/lib/clerk/models/components/{directory_group.rb → user_directory_group.rb} +1 -1
- data/lib/clerk/models/components/user_directory_group.rbi +15 -0
- data/lib/clerk/models/components/verification_from_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/verification_google_one_tap_clerkerror.rb +1 -1
- data/lib/clerk/models/components/waitlistentry_invitation.rb +1 -1
- data/lib/clerk/models/components.rb +37 -3
- data/lib/clerk/models/errors/apierror.rb +3 -3
- data/lib/clerk/models/errors/clerkerrors.rb +2 -2
- data/lib/clerk/models/errors/createadminportallinktoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/createadminportallinktoken_conflict_error.rb +1 -1
- data/lib/clerk/models/errors/createadminportallinktoken_forbidden_error.rb +1 -1
- data/lib/clerk/models/errors/createadminportallinktoken_unauthorized_error.rb +1 -1
- data/lib/clerk/models/errors/createapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/createapikey_conflict_error.rb +1 -1
- data/lib/clerk/models/errors/createm2mtoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/createm2mtoken_conflict_error.rb +1 -1
- data/lib/clerk/models/errors/deleteapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/deleteapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeys_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeys_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeysecret_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getapikeysecret_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/getm2mtokens_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/getm2mtokens_forbidden_error.rb +1 -1
- data/lib/clerk/models/errors/getm2mtokens_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_forbidden_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/revokeadminportallinktoken_unauthorized_error.rb +1 -1
- data/lib/clerk/models/errors/revokeapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/revokeapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/revokem2mtoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/revokem2mtoken_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/updateapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/updateapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/verifyapikey_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/verifyapikey_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/verifym2mtoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/verifym2mtoken_notfound_error.rb +1 -1
- data/lib/clerk/models/errors/verifyoauthaccesstoken_badrequest_error.rb +1 -1
- data/lib/clerk/models/errors/verifyoauthaccesstoken_notfound_error.rb +1 -1
- data/lib/clerk/models/operations/act.rb +40 -0
- data/lib/clerk/models/operations/act.rbi +17 -0
- data/lib/clerk/models/operations/act_act.rb +36 -0
- data/lib/clerk/models/operations/act_act.rbi +15 -0
- data/lib/clerk/models/operations/actor.rb +1 -1
- data/lib/clerk/models/operations/attemptemailaddressverification_requestbody.rb +7 -1
- data/lib/clerk/models/operations/attemptemailaddressverification_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/attemptphonenumberverification_requestbody.rb +7 -1
- data/lib/clerk/models/operations/attemptphonenumberverification_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rb +5 -1
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rbi +2 -0
- data/lib/clerk/models/operations/createbulkinvitations_requestbody.rb +1 -1
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rb +8 -2
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/createinvitation_request.rb +1 -1
- data/lib/clerk/models/operations/createoauthapplication_request.rb +13 -1
- data/lib/clerk/models/operations/createoauthapplication_request.rbi +6 -0
- data/lib/clerk/models/operations/createorganization_request.rb +2 -2
- data/lib/clerk/models/operations/createorganizationinvitation_requestbody.rb +2 -2
- data/lib/clerk/models/operations/createorganizationinvitationbulk_requestbody.rb +2 -2
- data/lib/clerk/models/operations/createorganizationmembership_requestbody.rb +2 -2
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rb +8 -2
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rbi +2 -0
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rb +8 -2
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rbi +2 -0
- data/lib/clerk/models/operations/createsignintoken_request.rb +17 -2
- data/lib/clerk/models/operations/createsignintoken_request.rbi +4 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_request.rb +32 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_request.rbi +13 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_response.rb +44 -0
- data/lib/clerk/models/operations/createssobypassallowlistuser_response.rbi +19 -0
- data/lib/clerk/models/operations/createuser_request.rb +8 -4
- data/lib/clerk/models/operations/createuser_request.rbi +2 -0
- data/lib/clerk/models/operations/deleteapikey_responsebody.rb +1 -1
- data/lib/clerk/models/operations/deleteinvitation_request.rb +32 -0
- data/lib/clerk/models/operations/deleteinvitation_request.rbi +13 -0
- data/lib/clerk/models/operations/deleteinvitation_response.rb +44 -0
- data/lib/clerk/models/operations/deleteinvitation_response.rbi +19 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_request.rb +32 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_request.rbi +13 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_response.rb +44 -0
- data/lib/clerk/models/operations/deletessobypassallowlistuser_response.rbi +19 -0
- data/lib/clerk/models/operations/filter_match.rb +27 -0
- data/lib/clerk/models/operations/filter_match.rbi +11 -0
- data/lib/clerk/models/operations/getdirectorygroup_request.rb +36 -0
- data/lib/clerk/models/operations/getdirectorygroup_request.rbi +15 -0
- data/lib/clerk/models/operations/getdirectorygroup_response.rb +44 -0
- data/lib/clerk/models/operations/getdirectorygroup_response.rbi +19 -0
- data/lib/clerk/models/operations/getlog_request.rb +34 -0
- data/lib/clerk/models/operations/getlog_request.rbi +13 -0
- data/lib/clerk/models/operations/getlog_response.rb +44 -0
- data/lib/clerk/models/operations/getlog_response.rbi +19 -0
- data/lib/clerk/models/operations/getlogschema_request.rb +35 -0
- data/lib/clerk/models/operations/getlogschema_request.rbi +13 -0
- data/lib/clerk/models/operations/getlogschema_response.rb +44 -0
- data/lib/clerk/models/operations/getlogschema_response.rbi +19 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_request.rb +45 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_request.rbi +19 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_response.rb +44 -0
- data/lib/clerk/models/operations/listdirectorygroupmembers_response.rbi +19 -0
- data/lib/clerk/models/operations/listinvitations_request.rb +6 -1
- data/lib/clerk/models/operations/listinvitations_request.rbi +2 -0
- data/lib/clerk/models/operations/listloggroupevents_request.rb +47 -0
- data/lib/clerk/models/operations/listloggroupevents_request.rbi +19 -0
- data/lib/clerk/models/operations/listloggroupevents_response.rb +44 -0
- data/lib/clerk/models/operations/listloggroupevents_response.rbi +19 -0
- data/lib/clerk/models/operations/listlogs_request.rb +228 -0
- data/lib/clerk/models/operations/listlogs_request.rbi +55 -0
- data/lib/clerk/models/operations/listlogs_response.rb +44 -0
- data/lib/clerk/models/operations/listlogs_response.rbi +19 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_request.rb +32 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_request.rbi +13 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_response.rb +44 -0
- data/lib/clerk/models/operations/listssobypassallowlistusers_response.rbi +19 -0
- data/lib/clerk/models/operations/mergeorganizationmetadata_requestbody.rb +2 -2
- data/lib/clerk/models/operations/mergeuser_request.rb +36 -0
- data/lib/clerk/models/operations/mergeuser_request.rbi +15 -0
- data/lib/clerk/models/operations/mergeuser_requestbody.rb +36 -0
- data/lib/clerk/models/operations/mergeuser_requestbody.rbi +15 -0
- data/lib/clerk/models/operations/mergeuser_response.rb +44 -0
- data/lib/clerk/models/operations/mergeuser_response.rbi +19 -0
- data/lib/clerk/models/operations/mergeuser_responsebody.rb +36 -0
- data/lib/clerk/models/operations/mergeuser_responsebody.rbi +15 -0
- data/lib/clerk/models/operations/refreshsession_requestbody.rb +1 -1
- data/lib/clerk/models/operations/replaceorganizationmetadata_requestbody.rb +2 -2
- data/lib/clerk/models/operations/replaceroleset_requestbody.rb +1 -1
- data/lib/clerk/models/operations/replaceusermetadata_requestbody.rb +3 -3
- data/lib/clerk/models/operations/responsebody.rb +1 -1
- data/lib/clerk/models/operations/revokesession_request.rb +5 -1
- data/lib/clerk/models/operations/revokesession_request.rbi +2 -0
- data/lib/clerk/models/operations/revokesession_requestbody.rb +36 -0
- data/lib/clerk/models/operations/revokesession_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/second_factor_verification.rb +25 -0
- data/lib/clerk/models/operations/second_factor_verification.rbi +11 -0
- data/lib/clerk/models/operations/updatedirectory_requestbody.rb +8 -2
- data/lib/clerk/models/operations/updatedirectory_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rb +8 -2
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/updateinstance_request.rb +1 -1
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +9 -1
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +4 -0
- data/lib/clerk/models/operations/updateinstanceprotect_request.rb +1 -5
- data/lib/clerk/models/operations/updateinstanceprotect_request.rbi +0 -2
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rb +13 -1
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rbi +6 -0
- data/lib/clerk/models/operations/updateorganization_requestbody.rb +12 -2
- data/lib/clerk/models/operations/updateorganization_requestbody.rbi +4 -0
- data/lib/clerk/models/operations/updateorganizationmembershipmetadata_requestbody.rb +2 -2
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rb +8 -2
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rb +8 -2
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updatesession_request.rb +36 -0
- data/lib/clerk/models/operations/updatesession_request.rbi +15 -0
- data/lib/clerk/models/operations/updatesession_requestbody.rb +33 -0
- data/lib/clerk/models/operations/updatesession_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/updatesession_response.rb +44 -0
- data/lib/clerk/models/operations/updatesession_response.rbi +19 -0
- data/lib/clerk/models/operations/updateuser_requestbody.rb +5 -1
- data/lib/clerk/models/operations/updateuser_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateusermetadata_requestbody.rb +3 -3
- data/lib/clerk/models/operations/verifypassword_requestbody.rb +7 -1
- data/lib/clerk/models/operations/verifypassword_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/verifytotp_requestbody.rb +7 -1
- data/lib/clerk/models/operations/verifytotp_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/view.rb +38 -0
- data/lib/clerk/models/operations/view.rbi +11 -0
- data/lib/clerk/models/operations.rb +33 -0
- data/lib/clerk/oauthaccesstokens.rb +7 -7
- data/lib/clerk/oauthapplications.rb +37 -37
- data/lib/clerk/openapiclient.rb +3 -1
- data/lib/clerk/organizationdomains.rb +28 -28
- data/lib/clerk/organizationinvitations.rb +35 -35
- data/lib/clerk/organizationmemberships.rb +25 -25
- data/lib/clerk/organizationpermissions.rb +24 -24
- data/lib/clerk/organizationroles.rb +32 -32
- data/lib/clerk/organizations.rb +61 -61
- data/lib/clerk/phonenumbers.rb +36 -36
- data/lib/clerk/proxychecks.rb +5 -5
- data/lib/clerk/redirecturls.rb +16 -16
- data/lib/clerk/rolesets.rb +38 -38
- data/lib/clerk/samlconnections.rb +23 -23
- data/lib/clerk/scimdirectories.rb +46 -46
- data/lib/clerk/sdk_hooks/types.rb +4 -4
- data/lib/clerk/sdkconfiguration.rb +4 -4
- data/lib/clerk/sessions.rb +219 -42
- data/lib/clerk/signintokens.rb +9 -9
- data/lib/clerk/signups.rb +9 -9
- data/lib/clerk/ssobypassallowlistusers.rb +477 -0
- data/lib/clerk/templates.rb +5 -5
- data/lib/clerk/testingtokens.rb +3 -3
- data/lib/clerk/users.rb +376 -189
- data/lib/clerk/utils/forms.rb +9 -9
- data/lib/clerk/utils/headers.rb +2 -2
- data/lib/clerk/utils/query_params.rb +6 -6
- data/lib/clerk/utils/request_bodies.rb +2 -2
- data/lib/clerk/utils/retries.rb +5 -5
- data/lib/clerk/utils/security.rb +4 -4
- data/lib/clerk/utils/utils.rb +13 -13
- data/lib/clerk/waitlistentries.rb +26 -26
- data/lib/clerk/webhooks.rb +11 -11
- data/lib/clerk-sdk-ruby.rb +6 -0
- data/lib/clerk_sdk_ruby.rb +2 -0
- metadata +143 -6
data/lib/clerk/sessions.rb
CHANGED
|
@@ -69,7 +69,7 @@ module Clerk
|
|
|
69
69
|
retry_connection_errors: true,
|
|
70
70
|
strategy: 'backoff'
|
|
71
71
|
)
|
|
72
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
72
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
73
73
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
74
74
|
|
|
75
75
|
security = @sdk_configuration.security_source&.call
|
|
@@ -110,7 +110,7 @@ module Clerk
|
|
|
110
110
|
request: req
|
|
111
111
|
)
|
|
112
112
|
end
|
|
113
|
-
rescue StandardError => e
|
|
113
|
+
rescue ::StandardError => e
|
|
114
114
|
error = e
|
|
115
115
|
ensure
|
|
116
116
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -146,7 +146,7 @@ module Clerk
|
|
|
146
146
|
response: http_response
|
|
147
147
|
)
|
|
148
148
|
response_data = http_response.env.response_body
|
|
149
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Components::Session))
|
|
149
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Crystalline::Array.new(Models::Components::Session))
|
|
150
150
|
response = Models::Operations::GetSessionListResponse.new(
|
|
151
151
|
status_code: http_response.status,
|
|
152
152
|
content_type: content_type,
|
|
@@ -167,7 +167,7 @@ module Clerk
|
|
|
167
167
|
response: http_response
|
|
168
168
|
)
|
|
169
169
|
response_data = http_response.env.response_body
|
|
170
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
170
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
171
171
|
obj.raw_response = http_response
|
|
172
172
|
raise obj
|
|
173
173
|
else
|
|
@@ -202,7 +202,7 @@ module Clerk
|
|
|
202
202
|
if form && !form.empty?
|
|
203
203
|
body = Utils.encode_form(form)
|
|
204
204
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
205
|
-
body = URI.encode_www_form(data)
|
|
205
|
+
body = ::URI.encode_www_form(data)
|
|
206
206
|
else
|
|
207
207
|
body = data
|
|
208
208
|
end
|
|
@@ -219,7 +219,7 @@ module Clerk
|
|
|
219
219
|
retry_connection_errors: true,
|
|
220
220
|
strategy: 'backoff'
|
|
221
221
|
)
|
|
222
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
222
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
223
223
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
224
224
|
|
|
225
225
|
security = @sdk_configuration.security_source&.call
|
|
@@ -260,7 +260,7 @@ module Clerk
|
|
|
260
260
|
request: req
|
|
261
261
|
)
|
|
262
262
|
end
|
|
263
|
-
rescue StandardError => e
|
|
263
|
+
rescue ::StandardError => e
|
|
264
264
|
error = e
|
|
265
265
|
ensure
|
|
266
266
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -296,7 +296,7 @@ module Clerk
|
|
|
296
296
|
response: http_response
|
|
297
297
|
)
|
|
298
298
|
response_data = http_response.env.response_body
|
|
299
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Session)
|
|
299
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::Session)
|
|
300
300
|
response = Models::Operations::CreateSessionResponse.new(
|
|
301
301
|
status_code: http_response.status,
|
|
302
302
|
content_type: content_type,
|
|
@@ -317,7 +317,7 @@ module Clerk
|
|
|
317
317
|
response: http_response
|
|
318
318
|
)
|
|
319
319
|
response_data = http_response.env.response_body
|
|
320
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
320
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
321
321
|
obj.raw_response = http_response
|
|
322
322
|
raise obj
|
|
323
323
|
else
|
|
@@ -364,7 +364,7 @@ module Clerk
|
|
|
364
364
|
retry_connection_errors: true,
|
|
365
365
|
strategy: 'backoff'
|
|
366
366
|
)
|
|
367
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
367
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
368
368
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
369
369
|
|
|
370
370
|
security = @sdk_configuration.security_source&.call
|
|
@@ -404,7 +404,7 @@ module Clerk
|
|
|
404
404
|
request: req
|
|
405
405
|
)
|
|
406
406
|
end
|
|
407
|
-
rescue StandardError => e
|
|
407
|
+
rescue ::StandardError => e
|
|
408
408
|
error = e
|
|
409
409
|
ensure
|
|
410
410
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -440,7 +440,7 @@ module Clerk
|
|
|
440
440
|
response: http_response
|
|
441
441
|
)
|
|
442
442
|
response_data = http_response.env.response_body
|
|
443
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Session)
|
|
443
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::Session)
|
|
444
444
|
response = Models::Operations::GetSessionResponse.new(
|
|
445
445
|
status_code: http_response.status,
|
|
446
446
|
content_type: content_type,
|
|
@@ -461,7 +461,172 @@ module Clerk
|
|
|
461
461
|
response: http_response
|
|
462
462
|
)
|
|
463
463
|
response_data = http_response.env.response_body
|
|
464
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
464
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
465
|
+
obj.raw_response = http_response
|
|
466
|
+
raise obj
|
|
467
|
+
else
|
|
468
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
469
|
+
end
|
|
470
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
471
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
472
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
473
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
474
|
+
else
|
|
475
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
476
|
+
|
|
477
|
+
end
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
def update(body:, session_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
483
|
+
# update - Update a session
|
|
484
|
+
# Changes when a session expires. Use this to give one session a longer or shorter lifetime than the one configured for your instance, for example to keep a user signed in on a device they chose to remember.
|
|
485
|
+
#
|
|
486
|
+
# `expire_at` can exceed the instance's session lifetime. The change applies only to this session, so new sign-ins still start from the instance's session lifetime. If `expire_at` is later than the session's `abandon_at`, `abandon_at` moves to the same time. The inactivity timeout, if your instance has one, still applies.
|
|
487
|
+
#
|
|
488
|
+
# Only active and pending sessions can be updated. Expired, revoked, and other ended sessions can't be revived, and sessions with an actor, such as impersonation and agent sessions, can't be updated. To end a session immediately, revoke it instead.
|
|
489
|
+
#
|
|
490
|
+
# Take the session ID from the `sid` claim of a verified session token. Never take it from an unverified client request, or a user could change another user's session.
|
|
491
|
+
#
|
|
492
|
+
# Requires a plan that includes custom session duration.
|
|
493
|
+
request = Models::Operations::UpdateSessionRequest.new(
|
|
494
|
+
session_id: session_id,
|
|
495
|
+
body: body
|
|
496
|
+
)
|
|
497
|
+
url, params = @sdk_configuration.get_server_details
|
|
498
|
+
base_url = Utils.template_url(url, params)
|
|
499
|
+
url = Utils.generate_url(
|
|
500
|
+
Models::Operations::UpdateSessionRequest,
|
|
501
|
+
base_url,
|
|
502
|
+
'/sessions/{session_id}',
|
|
503
|
+
request
|
|
504
|
+
)
|
|
505
|
+
headers = {}
|
|
506
|
+
|
|
507
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
508
|
+
headers['content-type'] = req_content_type
|
|
509
|
+
raise ::StandardError, 'request body is required' if data.nil? && form.nil?
|
|
510
|
+
|
|
511
|
+
if form && !form.empty?
|
|
512
|
+
body = Utils.encode_form(form)
|
|
513
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
514
|
+
body = ::URI.encode_www_form(data)
|
|
515
|
+
else
|
|
516
|
+
body = data
|
|
517
|
+
end
|
|
518
|
+
headers['Accept'] = 'application/json'
|
|
519
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
520
|
+
retries ||= @sdk_configuration.retry_config
|
|
521
|
+
retries ||= Utils::RetryConfig.new(
|
|
522
|
+
backoff: Utils::BackoffStrategy.new(
|
|
523
|
+
exponent: 1.5,
|
|
524
|
+
initial_interval: 500,
|
|
525
|
+
max_elapsed_time: 3_600_000,
|
|
526
|
+
max_interval: 60_000
|
|
527
|
+
),
|
|
528
|
+
retry_connection_errors: true,
|
|
529
|
+
strategy: 'backoff'
|
|
530
|
+
)
|
|
531
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
532
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
533
|
+
|
|
534
|
+
security = @sdk_configuration.security_source&.call
|
|
535
|
+
|
|
536
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
537
|
+
timeout ||= @sdk_configuration.timeout
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
connection = @sdk_configuration.client.dup
|
|
541
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
542
|
+
|
|
543
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
544
|
+
config: @sdk_configuration,
|
|
545
|
+
base_url: base_url,
|
|
546
|
+
oauth2_scopes: nil,
|
|
547
|
+
operation_id: 'UpdateSession',
|
|
548
|
+
security_source: @sdk_configuration.security_source
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
error = nil
|
|
552
|
+
http_response = nil
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
begin
|
|
556
|
+
http_response = connection.patch(url) do |req|
|
|
557
|
+
req.body = body
|
|
558
|
+
req.headers.merge!(headers)
|
|
559
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
560
|
+
Utils.configure_request_security(req, security)
|
|
561
|
+
http_headers&.each do |key, value|
|
|
562
|
+
req.headers[key.to_s] = value
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
@sdk_configuration.hooks.before_request(
|
|
566
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
567
|
+
hook_ctx: hook_ctx
|
|
568
|
+
),
|
|
569
|
+
request: req
|
|
570
|
+
)
|
|
571
|
+
end
|
|
572
|
+
rescue ::StandardError => e
|
|
573
|
+
error = e
|
|
574
|
+
ensure
|
|
575
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
576
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
577
|
+
error: error,
|
|
578
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
579
|
+
hook_ctx: hook_ctx
|
|
580
|
+
),
|
|
581
|
+
response: http_response
|
|
582
|
+
)
|
|
583
|
+
else
|
|
584
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
585
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
586
|
+
hook_ctx: hook_ctx
|
|
587
|
+
),
|
|
588
|
+
response: http_response
|
|
589
|
+
)
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
if http_response.nil?
|
|
593
|
+
raise error if !error.nil?
|
|
594
|
+
raise 'no response'
|
|
595
|
+
end
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
599
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
600
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
601
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
602
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
603
|
+
hook_ctx: hook_ctx
|
|
604
|
+
),
|
|
605
|
+
response: http_response
|
|
606
|
+
)
|
|
607
|
+
response_data = http_response.env.response_body
|
|
608
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::Session)
|
|
609
|
+
response = Models::Operations::UpdateSessionResponse.new(
|
|
610
|
+
status_code: http_response.status,
|
|
611
|
+
content_type: content_type,
|
|
612
|
+
raw_response: http_response,
|
|
613
|
+
session: obj
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
return response
|
|
617
|
+
else
|
|
618
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
619
|
+
end
|
|
620
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '402', '404', '422'])
|
|
621
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
622
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
623
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
624
|
+
hook_ctx: hook_ctx
|
|
625
|
+
),
|
|
626
|
+
response: http_response
|
|
627
|
+
)
|
|
628
|
+
response_data = http_response.env.response_body
|
|
629
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
465
630
|
obj.raw_response = http_response
|
|
466
631
|
raise obj
|
|
467
632
|
else
|
|
@@ -503,7 +668,7 @@ module Clerk
|
|
|
503
668
|
if form && !form.empty?
|
|
504
669
|
body = Utils.encode_form(form)
|
|
505
670
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
506
|
-
body = URI.encode_www_form(data)
|
|
671
|
+
body = ::URI.encode_www_form(data)
|
|
507
672
|
else
|
|
508
673
|
body = data
|
|
509
674
|
end
|
|
@@ -520,7 +685,7 @@ module Clerk
|
|
|
520
685
|
retry_connection_errors: true,
|
|
521
686
|
strategy: 'backoff'
|
|
522
687
|
)
|
|
523
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
688
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
524
689
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
525
690
|
|
|
526
691
|
security = @sdk_configuration.security_source&.call
|
|
@@ -561,7 +726,7 @@ module Clerk
|
|
|
561
726
|
request: req
|
|
562
727
|
)
|
|
563
728
|
end
|
|
564
|
-
rescue StandardError => e
|
|
729
|
+
rescue ::StandardError => e
|
|
565
730
|
error = e
|
|
566
731
|
ensure
|
|
567
732
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -597,7 +762,7 @@ module Clerk
|
|
|
597
762
|
response: http_response
|
|
598
763
|
)
|
|
599
764
|
response_data = http_response.env.response_body
|
|
600
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Union.new(Models::Components::Token, Models::Components::Cookies))
|
|
765
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Crystalline::Union.new(Models::Components::Token, Models::Components::Cookies))
|
|
601
766
|
response = Models::Operations::RefreshSessionResponse.new(
|
|
602
767
|
status_code: http_response.status,
|
|
603
768
|
content_type: content_type,
|
|
@@ -609,7 +774,7 @@ module Clerk
|
|
|
609
774
|
else
|
|
610
775
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
611
776
|
end
|
|
612
|
-
elsif Utils.match_status_code(http_response.status, ['400', '401'])
|
|
777
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '403'])
|
|
613
778
|
if Utils.match_content_type(content_type, 'application/json')
|
|
614
779
|
http_response = @sdk_configuration.hooks.after_success(
|
|
615
780
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -618,7 +783,7 @@ module Clerk
|
|
|
618
783
|
response: http_response
|
|
619
784
|
)
|
|
620
785
|
response_data = http_response.env.response_body
|
|
621
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
786
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
622
787
|
obj.raw_response = http_response
|
|
623
788
|
raise obj
|
|
624
789
|
else
|
|
@@ -667,7 +832,7 @@ module Clerk
|
|
|
667
832
|
retry_connection_errors: true,
|
|
668
833
|
strategy: 'backoff'
|
|
669
834
|
)
|
|
670
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
835
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
671
836
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
672
837
|
|
|
673
838
|
security = @sdk_configuration.security_source&.call
|
|
@@ -707,7 +872,7 @@ module Clerk
|
|
|
707
872
|
request: req
|
|
708
873
|
)
|
|
709
874
|
end
|
|
710
|
-
rescue StandardError => e
|
|
875
|
+
rescue ::StandardError => e
|
|
711
876
|
error = e
|
|
712
877
|
ensure
|
|
713
878
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -743,7 +908,7 @@ module Clerk
|
|
|
743
908
|
response: http_response
|
|
744
909
|
)
|
|
745
910
|
response_data = http_response.env.response_body
|
|
746
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Reverification)
|
|
911
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::Reverification)
|
|
747
912
|
response = Models::Operations::GetReverificationResponse.new(
|
|
748
913
|
status_code: http_response.status,
|
|
749
914
|
content_type: content_type,
|
|
@@ -764,7 +929,7 @@ module Clerk
|
|
|
764
929
|
response: http_response
|
|
765
930
|
)
|
|
766
931
|
response_data = http_response.env.response_body
|
|
767
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
932
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
768
933
|
obj.raw_response = http_response
|
|
769
934
|
raise obj
|
|
770
935
|
else
|
|
@@ -782,12 +947,13 @@ module Clerk
|
|
|
782
947
|
|
|
783
948
|
|
|
784
949
|
|
|
785
|
-
def revoke(session_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
950
|
+
def revoke(session_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
786
951
|
# revoke - Revoke a session
|
|
787
952
|
# Sets the status of a session as "revoked", which is an unauthenticated state.
|
|
788
953
|
# In multi-session mode, a revoked session will still be returned along with its client object, however the user will need to sign in again.
|
|
789
954
|
request = Models::Operations::RevokeSessionRequest.new(
|
|
790
|
-
session_id: session_id
|
|
955
|
+
session_id: session_id,
|
|
956
|
+
body: body
|
|
791
957
|
)
|
|
792
958
|
url, params = @sdk_configuration.get_server_details
|
|
793
959
|
base_url = Utils.template_url(url, params)
|
|
@@ -799,6 +965,16 @@ module Clerk
|
|
|
799
965
|
)
|
|
800
966
|
headers = {}
|
|
801
967
|
|
|
968
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
969
|
+
headers['content-type'] = req_content_type
|
|
970
|
+
|
|
971
|
+
if form && !form.empty?
|
|
972
|
+
body = Utils.encode_form(form)
|
|
973
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
974
|
+
body = ::URI.encode_www_form(data)
|
|
975
|
+
else
|
|
976
|
+
body = data
|
|
977
|
+
end
|
|
802
978
|
headers['Accept'] = 'application/json'
|
|
803
979
|
headers['user-agent'] = @sdk_configuration.user_agent
|
|
804
980
|
retries ||= @sdk_configuration.retry_config
|
|
@@ -812,7 +988,7 @@ module Clerk
|
|
|
812
988
|
retry_connection_errors: true,
|
|
813
989
|
strategy: 'backoff'
|
|
814
990
|
)
|
|
815
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
991
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
816
992
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
817
993
|
|
|
818
994
|
security = @sdk_configuration.security_source&.call
|
|
@@ -838,6 +1014,7 @@ module Clerk
|
|
|
838
1014
|
|
|
839
1015
|
begin
|
|
840
1016
|
http_response = connection.post(url) do |req|
|
|
1017
|
+
req.body = body
|
|
841
1018
|
req.headers.merge!(headers)
|
|
842
1019
|
req.options.timeout = timeout unless timeout.nil?
|
|
843
1020
|
Utils.configure_request_security(req, security)
|
|
@@ -852,7 +1029,7 @@ module Clerk
|
|
|
852
1029
|
request: req
|
|
853
1030
|
)
|
|
854
1031
|
end
|
|
855
|
-
rescue StandardError => e
|
|
1032
|
+
rescue ::StandardError => e
|
|
856
1033
|
error = e
|
|
857
1034
|
ensure
|
|
858
1035
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -888,7 +1065,7 @@ module Clerk
|
|
|
888
1065
|
response: http_response
|
|
889
1066
|
)
|
|
890
1067
|
response_data = http_response.env.response_body
|
|
891
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Session)
|
|
1068
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::Session)
|
|
892
1069
|
response = Models::Operations::RevokeSessionResponse.new(
|
|
893
1070
|
status_code: http_response.status,
|
|
894
1071
|
content_type: content_type,
|
|
@@ -900,7 +1077,7 @@ module Clerk
|
|
|
900
1077
|
else
|
|
901
1078
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
902
1079
|
end
|
|
903
|
-
elsif Utils.match_status_code(http_response.status, ['400', '401', '404'])
|
|
1080
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '404', '422'])
|
|
904
1081
|
if Utils.match_content_type(content_type, 'application/json')
|
|
905
1082
|
http_response = @sdk_configuration.hooks.after_success(
|
|
906
1083
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -909,7 +1086,7 @@ module Clerk
|
|
|
909
1086
|
response: http_response
|
|
910
1087
|
)
|
|
911
1088
|
response_data = http_response.env.response_body
|
|
912
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1089
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
913
1090
|
obj.raw_response = http_response
|
|
914
1091
|
raise obj
|
|
915
1092
|
else
|
|
@@ -950,7 +1127,7 @@ module Clerk
|
|
|
950
1127
|
if form && !form.empty?
|
|
951
1128
|
body = Utils.encode_form(form)
|
|
952
1129
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
953
|
-
body = URI.encode_www_form(data)
|
|
1130
|
+
body = ::URI.encode_www_form(data)
|
|
954
1131
|
else
|
|
955
1132
|
body = data
|
|
956
1133
|
end
|
|
@@ -967,7 +1144,7 @@ module Clerk
|
|
|
967
1144
|
retry_connection_errors: true,
|
|
968
1145
|
strategy: 'backoff'
|
|
969
1146
|
)
|
|
970
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
1147
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
971
1148
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
972
1149
|
|
|
973
1150
|
security = @sdk_configuration.security_source&.call
|
|
@@ -1008,7 +1185,7 @@ module Clerk
|
|
|
1008
1185
|
request: req
|
|
1009
1186
|
)
|
|
1010
1187
|
end
|
|
1011
|
-
rescue StandardError => e
|
|
1188
|
+
rescue ::StandardError => e
|
|
1012
1189
|
error = e
|
|
1013
1190
|
ensure
|
|
1014
1191
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -1044,7 +1221,7 @@ module Clerk
|
|
|
1044
1221
|
response: http_response
|
|
1045
1222
|
)
|
|
1046
1223
|
response_data = http_response.env.response_body
|
|
1047
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::CreateSessionTokenResponseBody)
|
|
1224
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Operations::CreateSessionTokenResponseBody)
|
|
1048
1225
|
response = Models::Operations::CreateSessionTokenResponse.new(
|
|
1049
1226
|
status_code: http_response.status,
|
|
1050
1227
|
content_type: content_type,
|
|
@@ -1056,7 +1233,7 @@ module Clerk
|
|
|
1056
1233
|
else
|
|
1057
1234
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
1058
1235
|
end
|
|
1059
|
-
elsif Utils.match_status_code(http_response.status, ['401', '404'])
|
|
1236
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '404'])
|
|
1060
1237
|
if Utils.match_content_type(content_type, 'application/json')
|
|
1061
1238
|
http_response = @sdk_configuration.hooks.after_success(
|
|
1062
1239
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -1065,7 +1242,7 @@ module Clerk
|
|
|
1065
1242
|
response: http_response
|
|
1066
1243
|
)
|
|
1067
1244
|
response_data = http_response.env.response_body
|
|
1068
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1245
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1069
1246
|
obj.raw_response = http_response
|
|
1070
1247
|
raise obj
|
|
1071
1248
|
else
|
|
@@ -1107,7 +1284,7 @@ module Clerk
|
|
|
1107
1284
|
if form && !form.empty?
|
|
1108
1285
|
body = Utils.encode_form(form)
|
|
1109
1286
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
1110
|
-
body = URI.encode_www_form(data)
|
|
1287
|
+
body = ::URI.encode_www_form(data)
|
|
1111
1288
|
else
|
|
1112
1289
|
body = data
|
|
1113
1290
|
end
|
|
@@ -1124,7 +1301,7 @@ module Clerk
|
|
|
1124
1301
|
retry_connection_errors: true,
|
|
1125
1302
|
strategy: 'backoff'
|
|
1126
1303
|
)
|
|
1127
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
1304
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
1128
1305
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
1129
1306
|
|
|
1130
1307
|
security = @sdk_configuration.security_source&.call
|
|
@@ -1165,7 +1342,7 @@ module Clerk
|
|
|
1165
1342
|
request: req
|
|
1166
1343
|
)
|
|
1167
1344
|
end
|
|
1168
|
-
rescue StandardError => e
|
|
1345
|
+
rescue ::StandardError => e
|
|
1169
1346
|
error = e
|
|
1170
1347
|
ensure
|
|
1171
1348
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -1201,7 +1378,7 @@ module Clerk
|
|
|
1201
1378
|
response: http_response
|
|
1202
1379
|
)
|
|
1203
1380
|
response_data = http_response.env.response_body
|
|
1204
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::CreateSessionTokenFromTemplateResponseBody)
|
|
1381
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Operations::CreateSessionTokenFromTemplateResponseBody)
|
|
1205
1382
|
response = Models::Operations::CreateSessionTokenFromTemplateResponse.new(
|
|
1206
1383
|
status_code: http_response.status,
|
|
1207
1384
|
content_type: content_type,
|
|
@@ -1213,7 +1390,7 @@ module Clerk
|
|
|
1213
1390
|
else
|
|
1214
1391
|
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
1215
1392
|
end
|
|
1216
|
-
elsif Utils.match_status_code(http_response.status, ['401', '404'])
|
|
1393
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '404'])
|
|
1217
1394
|
if Utils.match_content_type(content_type, 'application/json')
|
|
1218
1395
|
http_response = @sdk_configuration.hooks.after_success(
|
|
1219
1396
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -1222,7 +1399,7 @@ module Clerk
|
|
|
1222
1399
|
response: http_response
|
|
1223
1400
|
)
|
|
1224
1401
|
response_data = http_response.env.response_body
|
|
1225
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1402
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1226
1403
|
obj.raw_response = http_response
|
|
1227
1404
|
raise obj
|
|
1228
1405
|
else
|
data/lib/clerk/signintokens.rb
CHANGED
|
@@ -57,7 +57,7 @@ module Clerk
|
|
|
57
57
|
if form && !form.empty?
|
|
58
58
|
body = Utils.encode_form(form)
|
|
59
59
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
60
|
-
body = URI.encode_www_form(data)
|
|
60
|
+
body = ::URI.encode_www_form(data)
|
|
61
61
|
else
|
|
62
62
|
body = data
|
|
63
63
|
end
|
|
@@ -74,7 +74,7 @@ module Clerk
|
|
|
74
74
|
retry_connection_errors: true,
|
|
75
75
|
strategy: 'backoff'
|
|
76
76
|
)
|
|
77
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
77
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
78
78
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
79
79
|
|
|
80
80
|
security = @sdk_configuration.security_source&.call
|
|
@@ -115,7 +115,7 @@ module Clerk
|
|
|
115
115
|
request: req
|
|
116
116
|
)
|
|
117
117
|
end
|
|
118
|
-
rescue StandardError => e
|
|
118
|
+
rescue ::StandardError => e
|
|
119
119
|
error = e
|
|
120
120
|
ensure
|
|
121
121
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -151,7 +151,7 @@ module Clerk
|
|
|
151
151
|
response: http_response
|
|
152
152
|
)
|
|
153
153
|
response_data = http_response.env.response_body
|
|
154
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::SignInToken)
|
|
154
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::SignInToken)
|
|
155
155
|
response = Models::Operations::CreateSignInTokenResponse.new(
|
|
156
156
|
status_code: http_response.status,
|
|
157
157
|
content_type: content_type,
|
|
@@ -172,7 +172,7 @@ module Clerk
|
|
|
172
172
|
response: http_response
|
|
173
173
|
)
|
|
174
174
|
response_data = http_response.env.response_body
|
|
175
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
175
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
176
176
|
obj.raw_response = http_response
|
|
177
177
|
raise obj
|
|
178
178
|
else
|
|
@@ -219,7 +219,7 @@ module Clerk
|
|
|
219
219
|
retry_connection_errors: true,
|
|
220
220
|
strategy: 'backoff'
|
|
221
221
|
)
|
|
222
|
-
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
222
|
+
retry_options = retries.to_faraday_retry_options(initial_time: ::Time.now)
|
|
223
223
|
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
224
224
|
|
|
225
225
|
security = @sdk_configuration.security_source&.call
|
|
@@ -259,7 +259,7 @@ module Clerk
|
|
|
259
259
|
request: req
|
|
260
260
|
)
|
|
261
261
|
end
|
|
262
|
-
rescue StandardError => e
|
|
262
|
+
rescue ::StandardError => e
|
|
263
263
|
error = e
|
|
264
264
|
ensure
|
|
265
265
|
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
@@ -295,7 +295,7 @@ module Clerk
|
|
|
295
295
|
response: http_response
|
|
296
296
|
)
|
|
297
297
|
response_data = http_response.env.response_body
|
|
298
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::SignInToken)
|
|
298
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Components::SignInToken)
|
|
299
299
|
response = Models::Operations::RevokeSignInTokenResponse.new(
|
|
300
300
|
status_code: http_response.status,
|
|
301
301
|
content_type: content_type,
|
|
@@ -316,7 +316,7 @@ module Clerk
|
|
|
316
316
|
response: http_response
|
|
317
317
|
)
|
|
318
318
|
response_data = http_response.env.response_body
|
|
319
|
-
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
319
|
+
obj = Crystalline.unmarshal_json(::JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
320
320
|
obj.raw_response = http_response
|
|
321
321
|
raise obj
|
|
322
322
|
else
|