clerk-sdk-ruby 7.0.0 → 8.0.1
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 +11 -11
- data/lib/clerk/admin_portal_link_tokens.rb +10 -10
- data/lib/clerk/agenttasks.rb +10 -10
- data/lib/clerk/allowlistidentifiers.rb +15 -15
- data/lib/clerk/api_keys.rb +40 -40
- data/lib/clerk/betafeatures.rb +10 -10
- data/lib/clerk/billing.rb +388 -52
- data/lib/clerk/blocklistidentifiers.rb +15 -15
- data/lib/clerk/clients.rb +15 -15
- data/lib/clerk/directories.rb +1534 -0
- data/lib/clerk/domains.rb +27 -24
- data/lib/clerk/emailaddresses.rb +43 -36
- data/lib/clerk/emailandsmstemplates.rb +6 -6
- data/lib/clerk/emailsmstemplates.rb +21 -21
- data/lib/clerk/enterpriseconnections.rb +35 -35
- data/lib/clerk/instancesettings.rb +60 -60
- data/lib/clerk/invitations.rb +20 -20
- data/lib/clerk/jwks.rb +5 -5
- data/lib/clerk/jwttemplates.rb +25 -25
- data/lib/clerk/m2m.rb +20 -20
- data/lib/clerk/machines.rb +45 -45
- data/lib/clerk/miscellaneous.rb +5 -5
- data/lib/clerk/models/components/amount_off.rb +44 -0
- data/lib/clerk/models/components/{schemas_commerceplan_fee.rbi → amount_off.rbi} +2 -2
- data/lib/clerk/models/components/applycommercediscountrequest.rb +32 -0
- data/lib/clerk/models/components/applycommercediscountrequest.rbi +13 -0
- data/lib/clerk/models/components/automation_disposition.rb +21 -0
- data/lib/clerk/models/components/automation_disposition.rbi +11 -0
- data/lib/clerk/models/components/billingpaymentattempt_totals.rb +1 -1
- data/lib/clerk/models/components/billingstatement.rb +1 -1
- data/lib/clerk/models/components/{group.rb → billingstatement_group.rb} +1 -1
- data/lib/clerk/models/components/{group.rbi → billingstatement_group.rbi} +2 -2
- data/lib/clerk/models/components/biometriccredential.rb +72 -0
- data/lib/clerk/models/components/biometriccredential.rbi +33 -0
- data/lib/clerk/models/components/biometriccredential_algorithm.rb +19 -0
- data/lib/clerk/models/components/biometriccredential_algorithm.rbi +11 -0
- data/lib/clerk/models/components/biometriccredential_list.rb +36 -0
- data/lib/clerk/models/components/biometriccredential_list.rbi +15 -0
- data/lib/clerk/models/components/biometriccredential_object.rb +19 -0
- data/lib/clerk/models/components/biometriccredential_object.rbi +11 -0
- data/lib/clerk/models/components/biometriccredential_platform.rb +20 -0
- data/lib/clerk/models/components/biometriccredential_platform.rbi +11 -0
- data/lib/clerk/models/components/biometriccredential_status.rb +20 -0
- data/lib/clerk/models/components/biometriccredential_status.rbi +11 -0
- data/lib/clerk/models/components/clerkerror.rb +1 -1
- data/lib/clerk/models/components/commercecreditledgerresponse.rb +3 -7
- data/lib/clerk/models/components/commercecreditledgerresponse.rbi +0 -2
- data/lib/clerk/models/components/commercediscountredemptionresponse.rb +93 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse.rbi +43 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_amount.rb +45 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_amount.rbi → commercediscountredemptionresponse_amount.rbi} +2 -2
- data/lib/clerk/models/components/commercediscountredemptionresponse_object.rb +19 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_object.rbi +11 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_status.rb +21 -0
- data/lib/clerk/models/components/commercediscountredemptionresponse_status.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commerceperunittotal.rb → commerceperunittotal_2.rb} +2 -2
- data/lib/clerk/models/components/{schemas_commerceperunittotal.rbi → commerceperunittotal_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceperunittotaltier.rb → commerceperunittotaltier_2.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commerceperunittotaltier.rbi → commerceperunittotaltier_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceplan.rb → commerceplan_2.rb} +6 -6
- data/lib/clerk/models/components/{schemas_commerceplan.rbi → commerceplan_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceplan_fee.rb → commerceplan_2_annual_fee.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commerceplan_annual_fee.rbi → commerceplan_2_annual_fee.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_fee.rb → commerceplan_2_annual_monthly_fee.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commerceplan_annual_monthly_fee.rbi → commerceplan_2_annual_monthly_fee.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commerceplan_annual_fee.rb → commerceplan_2_fee.rb} +1 -1
- data/lib/clerk/models/components/commerceplan_2_fee.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commerceplan_object.rb → commerceplan_2_object.rb} +2 -2
- data/lib/clerk/models/components/commerceplan_2_object.rbi +11 -0
- data/lib/clerk/models/components/commercepricetransitiondetails.rb +1 -1
- data/lib/clerk/models/components/commercepricetransitionresponse.rb +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem.rb → commercesubscriptionitem_2.rb} +7 -7
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem.rbi → commercesubscriptionitem_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_amount.rb → commercesubscriptionitem_2_amount.rb} +1 -1
- data/lib/clerk/models/components/commercesubscriptionitem_2_amount.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commerceplan_annual_monthly_fee.rb → commercesubscriptionitem_2_annual_fee.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_fee.rbi → commercesubscriptionitem_2_annual_fee.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_annual_fee.rb → commercesubscriptionitem_2_annual_monthly_fee.rb} +1 -1
- data/lib/clerk/models/components/commercesubscriptionitem_2_annual_monthly_fee.rbi +19 -0
- data/lib/clerk/models/components/commercesubscriptionitem_2_fee.rb +44 -0
- data/lib/clerk/models/components/commercesubscriptionitem_2_fee.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment.rb → commercesubscriptionitem_2_next_payment.rb} +3 -3
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment.rbi → commercesubscriptionitem_2_next_payment.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_amount.rb → commercesubscriptionitem_2_next_payment_amount.rb} +1 -1
- data/lib/clerk/models/components/commercesubscriptionitem_2_next_payment_amount.rbi +19 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits.rb → commercesubscriptionitem_2_next_payment_credits.rb} +3 -3
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits.rbi → commercesubscriptionitem_2_next_payment_credits.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits_proration.rb → commercesubscriptionitem_2_next_payment_credits_proration.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_credits_proration.rbi → commercesubscriptionitem_2_next_payment_credits_proration.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts.rb → commercesubscriptionitem_2_next_payment_discounts.rb} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts.rbi → commercesubscriptionitem_2_next_payment_discounts.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts_proration.rb → commercesubscriptionitem_2_next_payment_discounts_proration.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_discounts_proration.rbi → commercesubscriptionitem_2_next_payment_discounts_proration.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_payer.rb → commercesubscriptionitem_2_next_payment_payer.rb} +1 -1
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_payer.rbi → commercesubscriptionitem_2_next_payment_payer.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_totals.rb → commercesubscriptionitem_2_next_payment_totals.rb} +3 -3
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_next_payment_totals.rbi → commercesubscriptionitem_2_next_payment_totals.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commercepayer.rb → commercesubscriptionitem_2_object_commercepayer.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_object_commercepayer.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commerceplan.rb → commercesubscriptionitem_2_object_commerceplan.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_object_commerceplan.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_object_commercesubscriptionitem.rb → commercesubscriptionitem_2_object_commercesubscriptionitem.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_object_commercesubscriptionitem.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan.rb → commercesubscriptionitem_2_plan.rb} +6 -6
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan.rbi → commercesubscriptionitem_2_plan.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_plan_period.rb → commercesubscriptionitem_2_plan_period.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_plan_period.rbi +11 -0
- data/lib/clerk/models/components/{schemas_commercesubscriptionitem_status.rb → commercesubscriptionitem_2_status.rb} +2 -2
- data/lib/clerk/models/components/commercesubscriptionitem_2_status.rbi +11 -0
- data/lib/clerk/models/components/commercesubscriptionitem_totals.rb +1 -1
- data/lib/clerk/models/components/commercesubscriptionnextpayment.rb +1 -1
- data/lib/clerk/models/components/commercesubscriptionnextpayment_totals.rb +1 -1
- data/lib/clerk/models/components/createbillingpricerequest.rb +2 -2
- data/lib/clerk/models/components/directory.rb +80 -0
- data/lib/clerk/models/components/directory.rbi +37 -0
- data/lib/clerk/models/components/directory_custom_attribute.rb +52 -0
- data/lib/clerk/models/components/{custom_attribute.rbi → directory_custom_attribute.rbi} +4 -2
- data/lib/clerk/models/components/directory_group.rb +36 -0
- data/lib/clerk/models/components/directory_group.rbi +15 -0
- data/lib/clerk/models/components/directory_list.rb +36 -0
- data/lib/clerk/models/components/directory_list.rbi +15 -0
- data/lib/clerk/models/components/directory_object.rb +19 -0
- data/lib/clerk/models/components/{samlaccount_meta.rbi → directory_object.rbi} +2 -2
- data/lib/clerk/models/components/directorygrouprolemapping.rb +76 -0
- data/lib/clerk/models/components/directorygrouprolemapping.rbi +35 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted.rb +43 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted.rbi +17 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted_object.rb +19 -0
- data/lib/clerk/models/components/directorygrouprolemapping_deleted_object.rbi +11 -0
- data/lib/clerk/models/components/directorygrouprolemapping_list.rb +36 -0
- data/lib/clerk/models/components/directorygrouprolemapping_list.rbi +15 -0
- data/lib/clerk/models/components/directorygrouprolemapping_object.rb +19 -0
- data/lib/clerk/models/components/directorygrouprolemapping_object.rbi +11 -0
- data/lib/clerk/models/components/dnstarget.rb +49 -0
- data/lib/clerk/models/components/dnstarget.rbi +21 -0
- data/lib/clerk/models/components/domain.rb +7 -2
- data/lib/clerk/models/components/domain.rbi +2 -0
- data/lib/clerk/models/components/effect.rb +20 -0
- data/lib/clerk/models/components/{clerkerror_meta.rbi → effect.rbi} +2 -2
- data/lib/clerk/models/components/emailaddress_verification_saml_clerkerror.rb +1 -1
- data/lib/clerk/models/components/enrollment_mode.rb +1 -0
- 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.rb +6 -2
- data/lib/clerk/models/components/enterpriseconnection.rbi +2 -0
- data/lib/clerk/models/components/{custom_attribute.rb → enterpriseconnection_custom_attribute.rb} +6 -2
- data/lib/clerk/models/components/enterpriseconnection_custom_attribute.rbi +23 -0
- data/lib/clerk/models/components/enterpriseconnection_mode.rb +21 -0
- data/lib/clerk/models/components/enterpriseconnection_mode.rbi +11 -0
- data/lib/clerk/models/components/enterpriseconnection_object.rb +19 -0
- data/lib/clerk/models/components/enterpriseconnection_object.rbi +11 -0
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rb +5 -1
- data/lib/clerk/models/components/enterpriseconnection_saml_connection.rbi +2 -0
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_clerkerror.rb +1 -1
- data/lib/clerk/models/components/{schemas_featureresponse.rb → featureresponse_2.rb} +2 -2
- data/lib/clerk/models/components/{schemas_featureresponse.rbi → featureresponse_2.rbi} +2 -2
- data/lib/clerk/models/components/{schemas_featureresponse_object.rb → featureresponse_2_object.rb} +2 -2
- data/lib/clerk/models/components/featureresponse_2_object.rbi +11 -0
- data/lib/clerk/models/components/instance.rb +13 -1
- data/lib/clerk/models/components/instance.rbi +6 -0
- data/lib/clerk/models/components/instanceprotect.rb +14 -2
- data/lib/clerk/models/components/instanceprotect.rbi +6 -0
- data/lib/clerk/models/components/instancesettings.rb +4 -1
- data/lib/clerk/models/components/level.rb +21 -0
- data/lib/clerk/models/components/{clerkerrors_meta.rbi → level.rbi} +2 -2
- data/lib/clerk/models/components/login_hint.rb +36 -0
- data/lib/clerk/models/components/login_hint.rbi +15 -0
- data/lib/clerk/models/components/oauthapplication.rb +7 -2
- data/lib/clerk/models/components/oauthapplication.rbi +2 -0
- data/lib/clerk/models/components/oauthapplicationsettings.rb +26 -1
- data/lib/clerk/models/components/oauthapplicationsettings.rbi +12 -0
- data/lib/clerk/models/components/oauthapplicationwithsecret.rb +7 -2
- data/lib/clerk/models/components/oauthapplicationwithsecret.rbi +2 -0
- data/lib/clerk/models/components/organization.rb +6 -1
- data/lib/clerk/models/components/organization.rbi +2 -0
- data/lib/clerk/models/components/organizationmembership_organization.rb +6 -1
- data/lib/clerk/models/components/organizationmembership_organization.rbi +2 -0
- data/lib/clerk/models/components/organizationmembershippublicuserdata.rb +5 -1
- data/lib/clerk/models/components/organizationmembershippublicuserdata.rbi +2 -0
- data/lib/clerk/models/components/organizationwithlogo.rb +6 -1
- data/lib/clerk/models/components/organizationwithlogo.rbi +2 -0
- data/lib/clerk/models/components/payer_commercepayer.rb +1 -1
- data/lib/clerk/models/components/payment_type.rb +1 -0
- data/lib/clerk/models/components/record_type.rb +20 -0
- data/lib/clerk/models/components/record_type.rbi +11 -0
- data/lib/clerk/models/components/reverification.rb +74 -0
- data/lib/clerk/models/components/reverification.rbi +31 -0
- data/lib/clerk/models/components/reverification_object.rb +20 -0
- data/lib/clerk/models/components/reverification_object.rbi +11 -0
- data/lib/clerk/models/components/reverification_status.rb +21 -0
- data/lib/clerk/models/components/reverification_status.rbi +11 -0
- data/lib/clerk/models/components/samlaccount_clerkerror.rb +1 -1
- data/lib/clerk/models/components/samlconnection_1.rb +15 -1
- data/lib/clerk/models/components/samlconnection_1.rbi +6 -0
- data/lib/clerk/models/components/samlconnection_2.rb +15 -1
- data/lib/clerk/models/components/samlconnection_2.rbi +6 -0
- data/lib/clerk/models/components/samlconnectionloginhint.rb +36 -0
- data/lib/clerk/models/components/samlconnectionloginhint.rbi +15 -0
- data/lib/clerk/models/components/samlconnectionloginhint_mode.rb +21 -0
- data/lib/clerk/models/components/samlconnectionloginhint_mode.rbi +11 -0
- data/lib/clerk/models/components/scim_group.rb +36 -0
- data/lib/clerk/models/components/scim_group.rbi +15 -0
- data/lib/clerk/models/components/scimdirectory.rb +80 -0
- data/lib/clerk/models/components/scimdirectory.rbi +37 -0
- data/lib/clerk/models/components/scimdirectory_custom_attribute.rb +52 -0
- data/lib/clerk/models/components/scimdirectory_custom_attribute.rbi +23 -0
- data/lib/clerk/models/components/scimdirectory_list.rb +36 -0
- data/lib/clerk/models/components/scimdirectory_list.rbi +15 -0
- data/lib/clerk/models/components/scimdirectory_object.rb +19 -0
- data/lib/clerk/models/components/scimdirectory_object.rbi +11 -0
- data/lib/clerk/models/components/scimgrouprolemapping.rb +76 -0
- data/lib/clerk/models/components/scimgrouprolemapping.rbi +35 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted.rb +43 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted.rbi +17 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted_object.rb +19 -0
- data/lib/clerk/models/components/scimgrouprolemapping_deleted_object.rbi +11 -0
- data/lib/clerk/models/components/scimgrouprolemapping_list.rb +36 -0
- data/lib/clerk/models/components/scimgrouprolemapping_list.rbi +15 -0
- data/lib/clerk/models/components/scimgrouprolemapping_object.rb +19 -0
- data/lib/clerk/models/components/scimgrouprolemapping_object.rbi +11 -0
- data/lib/clerk/models/components/scimusermetadata.rb +64 -0
- data/lib/clerk/models/components/scimusermetadata.rbi +27 -0
- data/lib/clerk/models/components/scimusermetadata_group.rb +36 -0
- data/lib/clerk/models/components/scimusermetadata_group.rbi +15 -0
- data/lib/clerk/models/components/seats.rb +1 -1
- data/lib/clerk/models/components/source.rb +21 -0
- data/lib/clerk/models/components/source.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice.rb +72 -0
- data/lib/clerk/models/components/trusteddevice.rbi +33 -0
- data/lib/clerk/models/components/trusteddevice_algorithm.rb +19 -0
- data/lib/clerk/models/components/trusteddevice_algorithm.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice_list.rb +36 -0
- data/lib/clerk/models/components/trusteddevice_list.rbi +15 -0
- data/lib/clerk/models/components/trusteddevice_object.rb +19 -0
- data/lib/clerk/models/components/trusteddevice_object.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice_platform.rb +20 -0
- data/lib/clerk/models/components/trusteddevice_platform.rbi +11 -0
- data/lib/clerk/models/components/trusteddevice_status.rb +20 -0
- data/lib/clerk/models/components/trusteddevice_status.rbi +11 -0
- data/lib/clerk/models/components/user.rb +16 -3
- data/lib/clerk/models/components/user.rbi +4 -0
- data/lib/clerk/models/components/user_directory.rb +65 -0
- data/lib/clerk/models/components/user_directory.rbi +27 -0
- data/lib/clerk/models/components/user_scim.rb +27 -6
- data/lib/clerk/models/components/user_scim.rbi +10 -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.rb +85 -39
- data/lib/clerk/models/errors/clerkerrors.rb +1 -1
- data/lib/clerk/models/operations/adddomain_request.rb +3 -6
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_request.rb +36 -0
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_request.rbi +15 -0
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_response.rb +44 -0
- data/lib/clerk/models/operations/applybillingsubscriptionitemdiscount_response.rbi +19 -0
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rb +5 -1
- data/lib/clerk/models/operations/clerkidpoauthaccesstoken.rbi +2 -0
- data/lib/clerk/models/operations/createdirectory_group_role_mapping.rb +52 -0
- data/lib/clerk/models/operations/createdirectory_group_role_mapping.rbi +23 -0
- data/lib/clerk/models/operations/createdirectory_request.rb +44 -0
- data/lib/clerk/models/operations/createdirectory_request.rbi +19 -0
- data/lib/clerk/models/operations/createdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/createdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_requestbody.rb +46 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_requestbody.rbi +19 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/createdirectorygrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/createemailaddress_request.rb +7 -1
- data/lib/clerk/models/operations/createemailaddress_request.rbi +2 -0
- data/lib/clerk/models/operations/createenterpriseconnection_custom_attribute.rb +5 -1
- data/lib/clerk/models/operations/createenterpriseconnection_custom_attribute.rbi +2 -0
- data/lib/clerk/models/operations/createenterpriseconnection_login_hint.rb +36 -0
- data/lib/clerk/models/operations/createenterpriseconnection_login_hint.rbi +15 -0
- data/lib/clerk/models/operations/createenterpriseconnection_mode.rb +21 -0
- data/lib/clerk/models/operations/createenterpriseconnection_mode.rbi +11 -0
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rb +5 -1
- data/lib/clerk/models/operations/createenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/createoauthapplication_request.rb +6 -2
- data/lib/clerk/models/operations/createoauthapplication_request.rbi +2 -0
- data/lib/clerk/models/operations/createorganizationdomain_requestbody.rb +1 -1
- data/lib/clerk/models/operations/createsamlconnection_login_hint_1.rb +36 -0
- data/lib/clerk/models/operations/createsamlconnection_login_hint_1.rbi +15 -0
- data/lib/clerk/models/operations/createsamlconnection_login_hint_2.rb +36 -0
- data/lib/clerk/models/operations/createsamlconnection_login_hint_2.rbi +15 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_1.rb +21 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_1.rbi +11 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_2.rb +21 -0
- data/lib/clerk/models/operations/createsamlconnection_mode_2.rbi +11 -0
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rb +5 -1
- data/lib/clerk/models/operations/createsamlconnection_requestbody_1.rbi +2 -0
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rb +5 -1
- data/lib/clerk/models/operations/createsamlconnection_requestbody_2.rbi +2 -0
- data/lib/clerk/models/operations/createscimdirectory_group_role_mapping.rb +44 -0
- data/lib/clerk/models/operations/createscimdirectory_group_role_mapping.rbi +19 -0
- data/lib/clerk/models/operations/createscimdirectory_request.rb +44 -0
- data/lib/clerk/models/operations/createscimdirectory_request.rbi +19 -0
- data/lib/clerk/models/operations/createscimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/createscimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_requestbody.rb +42 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_requestbody.rbi +17 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/createscimgrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/createsignintoken_request.rb +6 -1
- data/lib/clerk/models/operations/createsignintoken_request.rbi +2 -0
- data/lib/clerk/models/operations/createuser_request.rb +8 -2
- data/lib/clerk/models/operations/createuser_request.rbi +2 -0
- data/lib/clerk/models/operations/deletedirectory_request.rb +32 -0
- data/lib/clerk/models/operations/deletedirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/deletedirectory_response.rb +44 -0
- data/lib/clerk/models/operations/deletedirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/deletedirectorygrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/deletedomain_request.rb +1 -1
- data/lib/clerk/models/operations/deletescimdirectory_request.rb +32 -0
- data/lib/clerk/models/operations/deletescimdirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/deletescimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/deletescimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_request.rb +36 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_request.rbi +15 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_response.rb +44 -0
- data/lib/clerk/models/operations/deletescimgrouprolemapping_response.rbi +19 -0
- data/lib/clerk/models/operations/enrollment_mode.rb +5 -0
- data/lib/clerk/models/operations/extendbillingsubscriptionitemfreetrial_response.rb +4 -4
- data/lib/clerk/models/operations/extendbillingsubscriptionitemfreetrial_response.rbi +2 -2
- data/lib/clerk/models/operations/getdirectory_request.rb +32 -0
- data/lib/clerk/models/operations/getdirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/getdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/getdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/getreverification_request.rb +36 -0
- data/lib/clerk/models/operations/getreverification_request.rbi +15 -0
- data/lib/clerk/models/operations/getreverification_response.rb +44 -0
- data/lib/clerk/models/operations/getreverification_response.rbi +19 -0
- data/lib/clerk/models/operations/getscimdirectory_request.rb +32 -0
- data/lib/clerk/models/operations/getscimdirectory_request.rbi +13 -0
- data/lib/clerk/models/operations/getscimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/getscimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/getuserlist_request.rb +13 -1
- data/lib/clerk/models/operations/getuserlist_request.rbi +2 -0
- data/lib/clerk/models/operations/listallorganizationdomains_request.rb +2 -1
- data/lib/clerk/models/operations/listdirectories_request.rb +39 -0
- data/lib/clerk/models/operations/listdirectories_request.rbi +15 -0
- data/lib/clerk/models/operations/listdirectories_response.rb +44 -0
- data/lib/clerk/models/operations/listdirectories_response.rbi +19 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_request.rb +32 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_request.rbi +13 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/listdirectorygrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/listoauthapplications_request.rb +2 -0
- data/lib/clerk/models/operations/listorganizationdomains_request.rb +2 -1
- data/lib/clerk/models/operations/listscimdirectories_request.rb +39 -0
- data/lib/clerk/models/operations/listscimdirectories_request.rbi +15 -0
- data/lib/clerk/models/operations/listscimdirectories_response.rb +44 -0
- data/lib/clerk/models/operations/listscimdirectories_response.rbi +19 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_request.rb +32 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_request.rbi +13 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/listscimgrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_request.rb +32 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_request.rbi +13 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_response.rb +44 -0
- data/lib/clerk/models/operations/listuserbiometriccredentials_response.rbi +19 -0
- data/lib/clerk/models/operations/listusertrusteddevices_request.rb +32 -0
- data/lib/clerk/models/operations/listusertrusteddevices_request.rbi +13 -0
- data/lib/clerk/models/operations/listusertrusteddevices_response.rb +44 -0
- data/lib/clerk/models/operations/listusertrusteddevices_response.rbi +19 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_request.rb +36 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_request.rbi +15 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_response.rb +44 -0
- data/lib/clerk/models/operations/removebillingsubscriptionitemdiscount_response.rbi +19 -0
- data/lib/clerk/models/operations/removeuserpassword_request.rb +36 -0
- data/lib/clerk/models/operations/removeuserpassword_request.rbi +15 -0
- data/lib/clerk/models/operations/removeuserpassword_requestbody.rb +32 -0
- data/lib/clerk/models/operations/removeuserpassword_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/removeuserpassword_response.rb +44 -0
- data/lib/clerk/models/operations/removeuserpassword_response.rbi +19 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_mapping.rb +40 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_mapping.rbi +17 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_request.rb +36 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_request.rbi +15 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_requestbody.rb +32 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/replacedirectorygrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_mapping.rb +36 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_mapping.rbi +15 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_request.rb +36 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_request.rbi +15 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_requestbody.rb +32 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_response.rb +44 -0
- data/lib/clerk/models/operations/replacescimgrouprolemappings_response.rbi +19 -0
- data/lib/clerk/models/operations/replaceuseremailaddress_identification_status.rb +10 -2
- data/lib/clerk/models/operations/replaceuseremailaddress_requestbody.rb +16 -3
- data/lib/clerk/models/operations/replaceuseremailaddress_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/replaceuserphonenumber_identification_status.rb +10 -2
- data/lib/clerk/models/operations/replaceuserphonenumber_requestbody.rb +9 -2
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_request.rb +36 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_request.rbi +15 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_requestbody.rb +32 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_requestbody.rbi +13 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_response.rb +40 -0
- data/lib/clerk/models/operations/revokeoauthapplicationtoken_response.rbi +17 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_request.rb +36 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_request.rbi +15 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_response.rb +44 -0
- data/lib/clerk/models/operations/revokeuserbiometriccredential_response.rbi +19 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_request.rb +36 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_request.rbi +15 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_response.rb +44 -0
- data/lib/clerk/models/operations/revokeusertrusteddevice_response.rbi +19 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_request.rb +32 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_request.rbi +13 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_response.rb +44 -0
- data/lib/clerk/models/operations/rotatedirectoryapikey_response.rbi +19 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_request.rb +32 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_request.rbi +13 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_response.rb +44 -0
- data/lib/clerk/models/operations/rotatescimdirectoryapikey_response.rbi +19 -0
- data/lib/clerk/models/operations/updatedirectory_request.rb +36 -0
- data/lib/clerk/models/operations/updatedirectory_request.rbi +15 -0
- data/lib/clerk/models/operations/updatedirectory_requestbody.rb +49 -0
- data/lib/clerk/models/operations/updatedirectory_requestbody.rbi +21 -0
- data/lib/clerk/models/operations/updatedirectory_response.rb +44 -0
- data/lib/clerk/models/operations/updatedirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/updateemailaddress_requestbody.rb +7 -1
- data/lib/clerk/models/operations/updateemailaddress_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_custom_attribute.rb +5 -1
- data/lib/clerk/models/operations/updateenterpriseconnection_custom_attribute.rbi +2 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_login_hint.rb +36 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_login_hint.rbi +15 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_mode.rb +21 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_mode.rbi +11 -0
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rb +5 -1
- data/lib/clerk/models/operations/updateenterpriseconnection_saml.rbi +2 -0
- data/lib/clerk/models/operations/updateinstance_request.rb +15 -5
- data/lib/clerk/models/operations/updateinstance_request.rbi +6 -2
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rb +26 -1
- data/lib/clerk/models/operations/updateinstanceoauthapplicationsettings_request.rbi +12 -0
- data/lib/clerk/models/operations/updateinstanceprotect_request.rb +1 -1
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rb +9 -5
- data/lib/clerk/models/operations/updateoauthapplication_requestbody.rbi +4 -2
- data/lib/clerk/models/operations/updateorganization_requestbody.rb +6 -1
- data/lib/clerk/models/operations/updateorganization_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updateorganizationdomain_requestbody.rb +1 -1
- data/lib/clerk/models/operations/updatesamlconnection_login_hint.rb +36 -0
- data/lib/clerk/models/operations/updatesamlconnection_login_hint.rbi +15 -0
- data/lib/clerk/models/operations/updatesamlconnection_mode.rb +21 -0
- data/lib/clerk/models/operations/updatesamlconnection_mode.rbi +11 -0
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rb +5 -1
- data/lib/clerk/models/operations/updatesamlconnection_requestbody.rbi +2 -0
- data/lib/clerk/models/operations/updatescimdirectory_request.rb +36 -0
- data/lib/clerk/models/operations/updatescimdirectory_request.rbi +15 -0
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rb +49 -0
- data/lib/clerk/models/operations/updatescimdirectory_requestbody.rbi +21 -0
- data/lib/clerk/models/operations/updatescimdirectory_response.rb +44 -0
- data/lib/clerk/models/operations/updatescimdirectory_response.rbi +19 -0
- data/lib/clerk/models/operations/updateuser_requestbody.rb +1 -1
- data/lib/clerk/models/operations.rb +80 -0
- data/lib/clerk/oauthaccesstokens.rb +5 -5
- data/lib/clerk/oauthapplications.rb +185 -35
- data/lib/clerk/openapiclient.rb +3 -1
- data/lib/clerk/organizationdomains.rb +32 -32
- data/lib/clerk/organizationinvitations.rb +35 -35
- data/lib/clerk/organizationmemberships.rb +25 -25
- data/lib/clerk/organizationpermissions.rb +25 -25
- data/lib/clerk/organizationroles.rb +35 -35
- data/lib/clerk/organizations.rb +60 -60
- data/lib/clerk/phonenumbers.rb +53 -38
- data/lib/clerk/proxy.rb +3 -3
- data/lib/clerk/proxychecks.rb +5 -5
- data/lib/clerk/redirecturls.rb +20 -20
- data/lib/clerk/rolesets.rb +35 -35
- data/lib/clerk/samlconnections.rb +25 -25
- data/lib/clerk/scimdirectories.rb +1534 -0
- data/lib/clerk/sdk.rb +44 -6
- data/lib/clerk/sdkconfiguration.rb +3 -3
- data/lib/clerk/sessions.rb +181 -35
- data/lib/clerk/signintokens.rb +11 -11
- data/lib/clerk/signups.rb +10 -10
- data/lib/clerk/templates.rb +5 -5
- data/lib/clerk/testingtokens.rb +5 -5
- data/lib/clerk/users.rb +1045 -223
- data/lib/clerk/utils/retries.rb +43 -1
- data/lib/clerk/utils/utils.rb +6 -2
- data/lib/clerk/waitlistentries.rb +30 -30
- data/lib/clerk/webhooks.rb +15 -15
- data/lib/clerk_sdk_ruby.rb +2 -0
- data/test/clerk/jwks_cache_scoping_test.rb +83 -0
- data/test/clerk/org_permissions_v2_test.rb +130 -0
- data/test/clerk/proxy_test.rb +108 -0
- metadata +339 -82
- data/lib/clerk/models/components/clerkerror_meta.rb +0 -27
- data/lib/clerk/models/components/clerkerrors_meta.rb +0 -27
- data/lib/clerk/models/components/emailaddress_verification_saml_meta.rb +0 -27
- data/lib/clerk/models/components/emailaddress_verification_saml_meta.rbi +0 -11
- data/lib/clerk/models/components/enterpriseaccount_verification_oauth_meta.rb +0 -27
- data/lib/clerk/models/components/enterpriseaccount_verification_oauth_meta.rbi +0 -11
- data/lib/clerk/models/components/enterpriseaccount_verification_saml_meta.rb +0 -27
- data/lib/clerk/models/components/enterpriseaccount_verification_saml_meta.rbi +0 -11
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_meta.rb +0 -27
- data/lib/clerk/models/components/externalaccountwithverification_verification_oauth_meta.rbi +0 -11
- data/lib/clerk/models/components/samlaccount_meta.rb +0 -27
- data/lib/clerk/models/components/schemas_commerceplan_object.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_fee.rbi +0 -19
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_monthly_fee.rb +0 -44
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_annual_monthly_fee.rbi +0 -19
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_next_payment_amount.rbi +0 -19
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commercepayer.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commerceplan.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_object_commercesubscriptionitem.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_plan_period.rbi +0 -11
- data/lib/clerk/models/components/schemas_commercesubscriptionitem_status.rbi +0 -11
- data/lib/clerk/models/components/schemas_featureresponse_object.rbi +0 -11
- data/lib/clerk/models/components/verification_from_oauth_meta.rb +0 -27
- data/lib/clerk/models/components/verification_from_oauth_meta.rbi +0 -11
- data/lib/clerk/models/components/verification_google_one_tap_meta.rb +0 -27
- data/lib/clerk/models/components/verification_google_one_tap_meta.rbi +0 -11
data/lib/clerk/sdk.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require 'clerk/jwks_cache'
|
|
4
4
|
require 'clerk/openapiclient'
|
|
5
5
|
# require 'clerk/version'
|
|
6
|
+
require 'digest'
|
|
6
7
|
require 'jwt'
|
|
7
8
|
|
|
8
9
|
module Clerk
|
|
@@ -16,16 +17,33 @@ module Clerk
|
|
|
16
17
|
# How often (in seconds) should JWKs be refreshed
|
|
17
18
|
JWKS_CACHE_LIFETIME = 3600 # 1 hour
|
|
18
19
|
|
|
20
|
+
# One JWKS cache per Clerk instance. A single process-wide cache would let a
|
|
21
|
+
# token minted by one instance verify against another, since the keys it
|
|
22
|
+
# holds are whichever instance refreshed last and no issuer check runs.
|
|
23
|
+
# The cache still outlives individual SDK objects, because
|
|
24
|
+
# `authenticate_request` builds a fresh SDK per request.
|
|
19
25
|
# rubocop:disable Style/ClassVars
|
|
20
|
-
@@
|
|
26
|
+
@@jwks_caches = {}
|
|
27
|
+
@@jwks_caches_mutex = Mutex.new
|
|
21
28
|
# rubocop:enable Style/ClassVars
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
|
|
30
|
+
# Returns the JWKS cache for a single Clerk instance. `scope` must identify
|
|
31
|
+
# that instance; see #jwks_cache_scope.
|
|
32
|
+
def self.jwks_cache(scope)
|
|
33
|
+
@@jwks_caches_mutex.synchronize do
|
|
34
|
+
@@jwks_caches[scope] ||= JWKSCache.new(JWKS_CACHE_LIFETIME)
|
|
35
|
+
end
|
|
25
36
|
end
|
|
26
37
|
|
|
38
|
+
# Opaque identifier for the Clerk instance this SDK talks to. The secret key
|
|
39
|
+
# is hashed so it is never retained as a cache key.
|
|
40
|
+
attr_reader :jwks_cache_scope
|
|
41
|
+
|
|
27
42
|
def initialize(client: nil, retry_config: nil, timeout_ms: nil, secret_key: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil)
|
|
28
43
|
secret_key ||= Clerk.configuration.secret_key
|
|
44
|
+
@jwks_cache_scope = Digest::SHA256.hexdigest(
|
|
45
|
+
[server_url, server_idx, secret_key].join("\0")
|
|
46
|
+
)
|
|
29
47
|
super(
|
|
30
48
|
client: client,
|
|
31
49
|
retry_config: retry_config,
|
|
@@ -56,7 +74,7 @@ module Clerk
|
|
|
56
74
|
jwk_loader = lambda do |options|
|
|
57
75
|
# JWT.decode requires that the 'keys' key in the Hash is a symbol (as
|
|
58
76
|
# opposed to a string which our SDK returns by default)
|
|
59
|
-
{keys: SDK.jwks_cache.fetch(self, kid_not_found: options[:invalidate] || options[:kid_not_found], force_refresh: force_refresh_jwks)}
|
|
77
|
+
{keys: SDK.jwks_cache(@jwks_cache_scope).fetch(self, kid_not_found: options[:invalidate] || options[:kid_not_found], force_refresh: force_refresh_jwks)}
|
|
60
78
|
end
|
|
61
79
|
|
|
62
80
|
begin
|
|
@@ -90,6 +108,10 @@ module Clerk
|
|
|
90
108
|
|
|
91
109
|
private
|
|
92
110
|
|
|
111
|
+
# Decodes the `fea`/`o.per`/`o.fpm` triple of a v2 session token into
|
|
112
|
+
# `org:<feature>:<action>` permission strings. Anything that cannot be
|
|
113
|
+
# decoded with confidence is skipped rather than guessed at, so malformed
|
|
114
|
+
# claims can only ever narrow the permission set, never widen it.
|
|
93
115
|
def compute_org_permissions_from_v2_token(claims)
|
|
94
116
|
features = claims['fea'] ? claims['fea'].split(',') : []
|
|
95
117
|
permissions = claims['o']['per'] ? claims['o']['per'].split(',') : []
|
|
@@ -97,12 +119,28 @@ module Clerk
|
|
|
97
119
|
org_permissions = []
|
|
98
120
|
|
|
99
121
|
mappings.each_with_index do |mapping, i|
|
|
122
|
+
# Each mapping is positionally aligned to a feature. A mapping without a
|
|
123
|
+
# matching feature entry cannot be attributed to anything, so skip it.
|
|
124
|
+
next if features[i].nil?
|
|
125
|
+
|
|
100
126
|
scope, feature = features[i].split(':')
|
|
101
127
|
|
|
128
|
+
next if scope.nil? || feature.nil? # malformed feature entry
|
|
102
129
|
next if !scope.include?('o') # not an orgs-related permission
|
|
130
|
+
# Only a non-negative decimal integer is a valid mask. The backend builds
|
|
131
|
+
# these masks in a signed 64-bit integer, so an action at index 63
|
|
132
|
+
# overflows into a negative value whose binary representation is a minus
|
|
133
|
+
# sign followed by ones ("-111...1"); walking that string character by
|
|
134
|
+
# character would grant every one of those bits. Reject anything that is
|
|
135
|
+
# not a plain non-negative decimal, mirroring `decimalToBinaryBits` in
|
|
136
|
+
# @clerk/shared, which fails closed the same way.
|
|
137
|
+
next if !/\A\d+\z/.match?(mapping)
|
|
103
138
|
|
|
104
139
|
mapping.to_i.to_s(2).reverse.each_char.each_with_index do |bit, j|
|
|
105
|
-
|
|
140
|
+
next if bit != '1'
|
|
141
|
+
next if permissions[j].nil? # mask has more bits than the permission vocabulary
|
|
142
|
+
|
|
143
|
+
org_permissions << "org:#{feature}:#{permissions[j]}"
|
|
106
144
|
end
|
|
107
145
|
end
|
|
108
146
|
|
|
@@ -76,9 +76,9 @@ module Clerk
|
|
|
76
76
|
end
|
|
77
77
|
@language = 'ruby'
|
|
78
78
|
@openapi_doc_version = '2026-05-12'
|
|
79
|
-
@sdk_version = '
|
|
80
|
-
@gen_version = '2.
|
|
81
|
-
@user_agent = 'speakeasy-sdk/ruby
|
|
79
|
+
@sdk_version = '8.0.1'
|
|
80
|
+
@gen_version = '2.938.0'
|
|
81
|
+
@user_agent = 'speakeasy-sdk/ruby 8.0.1 2.938.0 2026-05-12 clerk-sdk-ruby'
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
|
data/lib/clerk/sessions.rb
CHANGED
|
@@ -76,10 +76,10 @@ module Clerk
|
|
|
76
76
|
|
|
77
77
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
78
78
|
timeout ||= @sdk_configuration.timeout
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
|
|
81
81
|
connection = @sdk_configuration.client.dup
|
|
82
|
-
connection.
|
|
82
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
83
83
|
|
|
84
84
|
hook_ctx = SDKHooks::HookContext.new(
|
|
85
85
|
config: @sdk_configuration,
|
|
@@ -92,7 +92,7 @@ module Clerk
|
|
|
92
92
|
error = nil
|
|
93
93
|
http_response = nil
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
begin
|
|
97
97
|
http_response = connection.get(url) do |req|
|
|
98
98
|
req.headers.merge!(headers)
|
|
@@ -129,13 +129,13 @@ module Clerk
|
|
|
129
129
|
response: http_response
|
|
130
130
|
)
|
|
131
131
|
end
|
|
132
|
-
|
|
132
|
+
|
|
133
133
|
if http_response.nil?
|
|
134
134
|
raise error if !error.nil?
|
|
135
135
|
raise 'no response'
|
|
136
136
|
end
|
|
137
137
|
end
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
140
140
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
141
141
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -226,10 +226,10 @@ module Clerk
|
|
|
226
226
|
|
|
227
227
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
228
228
|
timeout ||= @sdk_configuration.timeout
|
|
229
|
-
|
|
229
|
+
|
|
230
230
|
|
|
231
231
|
connection = @sdk_configuration.client.dup
|
|
232
|
-
connection.
|
|
232
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
233
233
|
|
|
234
234
|
hook_ctx = SDKHooks::HookContext.new(
|
|
235
235
|
config: @sdk_configuration,
|
|
@@ -242,7 +242,7 @@ module Clerk
|
|
|
242
242
|
error = nil
|
|
243
243
|
http_response = nil
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
|
|
246
246
|
begin
|
|
247
247
|
http_response = connection.post(url) do |req|
|
|
248
248
|
req.body = body
|
|
@@ -279,13 +279,13 @@ module Clerk
|
|
|
279
279
|
response: http_response
|
|
280
280
|
)
|
|
281
281
|
end
|
|
282
|
-
|
|
282
|
+
|
|
283
283
|
if http_response.nil?
|
|
284
284
|
raise error if !error.nil?
|
|
285
285
|
raise 'no response'
|
|
286
286
|
end
|
|
287
287
|
end
|
|
288
|
-
|
|
288
|
+
|
|
289
289
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
290
290
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
291
291
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -371,10 +371,10 @@ module Clerk
|
|
|
371
371
|
|
|
372
372
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
373
373
|
timeout ||= @sdk_configuration.timeout
|
|
374
|
-
|
|
374
|
+
|
|
375
375
|
|
|
376
376
|
connection = @sdk_configuration.client.dup
|
|
377
|
-
connection.
|
|
377
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
378
378
|
|
|
379
379
|
hook_ctx = SDKHooks::HookContext.new(
|
|
380
380
|
config: @sdk_configuration,
|
|
@@ -387,7 +387,7 @@ module Clerk
|
|
|
387
387
|
error = nil
|
|
388
388
|
http_response = nil
|
|
389
389
|
|
|
390
|
-
|
|
390
|
+
|
|
391
391
|
begin
|
|
392
392
|
http_response = connection.get(url) do |req|
|
|
393
393
|
req.headers.merge!(headers)
|
|
@@ -423,13 +423,13 @@ module Clerk
|
|
|
423
423
|
response: http_response
|
|
424
424
|
)
|
|
425
425
|
end
|
|
426
|
-
|
|
426
|
+
|
|
427
427
|
if http_response.nil?
|
|
428
428
|
raise error if !error.nil?
|
|
429
429
|
raise 'no response'
|
|
430
430
|
end
|
|
431
431
|
end
|
|
432
|
-
|
|
432
|
+
|
|
433
433
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
434
434
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
435
435
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -527,10 +527,10 @@ module Clerk
|
|
|
527
527
|
|
|
528
528
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
529
529
|
timeout ||= @sdk_configuration.timeout
|
|
530
|
-
|
|
530
|
+
|
|
531
531
|
|
|
532
532
|
connection = @sdk_configuration.client.dup
|
|
533
|
-
connection.
|
|
533
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
534
534
|
|
|
535
535
|
hook_ctx = SDKHooks::HookContext.new(
|
|
536
536
|
config: @sdk_configuration,
|
|
@@ -543,7 +543,7 @@ module Clerk
|
|
|
543
543
|
error = nil
|
|
544
544
|
http_response = nil
|
|
545
545
|
|
|
546
|
-
|
|
546
|
+
|
|
547
547
|
begin
|
|
548
548
|
http_response = connection.post(url) do |req|
|
|
549
549
|
req.body = body
|
|
@@ -580,13 +580,13 @@ module Clerk
|
|
|
580
580
|
response: http_response
|
|
581
581
|
)
|
|
582
582
|
end
|
|
583
|
-
|
|
583
|
+
|
|
584
584
|
if http_response.nil?
|
|
585
585
|
raise error if !error.nil?
|
|
586
586
|
raise 'no response'
|
|
587
587
|
end
|
|
588
588
|
end
|
|
589
|
-
|
|
589
|
+
|
|
590
590
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
591
591
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
592
592
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -636,6 +636,152 @@ module Clerk
|
|
|
636
636
|
|
|
637
637
|
|
|
638
638
|
|
|
639
|
+
def get_reverification(session_id:, reverification_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
640
|
+
# get_reverification - Retrieve a reverification
|
|
641
|
+
# Retrieve a reverification scoped to a session. A resource server can use this to validate a reverification id it received from its client: confirm it is real, scoped to the expected session, completed, and how fresh each factor is. Single-use / replay detection is the caller's responsibility (the id is stable, so the caller dedups consumed ids).
|
|
642
|
+
#
|
|
643
|
+
request = Models::Operations::GetReverificationRequest.new(
|
|
644
|
+
session_id: session_id,
|
|
645
|
+
reverification_id: reverification_id
|
|
646
|
+
)
|
|
647
|
+
url, params = @sdk_configuration.get_server_details
|
|
648
|
+
base_url = Utils.template_url(url, params)
|
|
649
|
+
url = Utils.generate_url(
|
|
650
|
+
Models::Operations::GetReverificationRequest,
|
|
651
|
+
base_url,
|
|
652
|
+
'/sessions/{session_id}/reverifications/{reverification_id}',
|
|
653
|
+
request
|
|
654
|
+
)
|
|
655
|
+
headers = {}
|
|
656
|
+
|
|
657
|
+
headers['Accept'] = 'application/json'
|
|
658
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
659
|
+
retries ||= @sdk_configuration.retry_config
|
|
660
|
+
retries ||= Utils::RetryConfig.new(
|
|
661
|
+
backoff: Utils::BackoffStrategy.new(
|
|
662
|
+
exponent: 1.5,
|
|
663
|
+
initial_interval: 500,
|
|
664
|
+
max_elapsed_time: 3_600_000,
|
|
665
|
+
max_interval: 60_000
|
|
666
|
+
),
|
|
667
|
+
retry_connection_errors: true,
|
|
668
|
+
strategy: 'backoff'
|
|
669
|
+
)
|
|
670
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
671
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
672
|
+
|
|
673
|
+
security = @sdk_configuration.security_source&.call
|
|
674
|
+
|
|
675
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
676
|
+
timeout ||= @sdk_configuration.timeout
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
connection = @sdk_configuration.client.dup
|
|
680
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
681
|
+
|
|
682
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
683
|
+
config: @sdk_configuration,
|
|
684
|
+
base_url: base_url,
|
|
685
|
+
oauth2_scopes: nil,
|
|
686
|
+
operation_id: 'GetReverification',
|
|
687
|
+
security_source: @sdk_configuration.security_source
|
|
688
|
+
)
|
|
689
|
+
|
|
690
|
+
error = nil
|
|
691
|
+
http_response = nil
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
begin
|
|
695
|
+
http_response = connection.get(url) do |req|
|
|
696
|
+
req.headers.merge!(headers)
|
|
697
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
698
|
+
Utils.configure_request_security(req, security)
|
|
699
|
+
http_headers&.each do |key, value|
|
|
700
|
+
req.headers[key.to_s] = value
|
|
701
|
+
end
|
|
702
|
+
|
|
703
|
+
@sdk_configuration.hooks.before_request(
|
|
704
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
705
|
+
hook_ctx: hook_ctx
|
|
706
|
+
),
|
|
707
|
+
request: req
|
|
708
|
+
)
|
|
709
|
+
end
|
|
710
|
+
rescue StandardError => e
|
|
711
|
+
error = e
|
|
712
|
+
ensure
|
|
713
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
714
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
715
|
+
error: error,
|
|
716
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
717
|
+
hook_ctx: hook_ctx
|
|
718
|
+
),
|
|
719
|
+
response: http_response
|
|
720
|
+
)
|
|
721
|
+
else
|
|
722
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
723
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
724
|
+
hook_ctx: hook_ctx
|
|
725
|
+
),
|
|
726
|
+
response: http_response
|
|
727
|
+
)
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
if http_response.nil?
|
|
731
|
+
raise error if !error.nil?
|
|
732
|
+
raise 'no response'
|
|
733
|
+
end
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
737
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
738
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
739
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
740
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
741
|
+
hook_ctx: hook_ctx
|
|
742
|
+
),
|
|
743
|
+
response: http_response
|
|
744
|
+
)
|
|
745
|
+
response_data = http_response.env.response_body
|
|
746
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Reverification)
|
|
747
|
+
response = Models::Operations::GetReverificationResponse.new(
|
|
748
|
+
status_code: http_response.status,
|
|
749
|
+
content_type: content_type,
|
|
750
|
+
raw_response: http_response,
|
|
751
|
+
reverification: obj
|
|
752
|
+
)
|
|
753
|
+
|
|
754
|
+
return response
|
|
755
|
+
else
|
|
756
|
+
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'
|
|
757
|
+
end
|
|
758
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '404'])
|
|
759
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
760
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
761
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
762
|
+
hook_ctx: hook_ctx
|
|
763
|
+
),
|
|
764
|
+
response: http_response
|
|
765
|
+
)
|
|
766
|
+
response_data = http_response.env.response_body
|
|
767
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
768
|
+
obj.raw_response = http_response
|
|
769
|
+
raise obj
|
|
770
|
+
else
|
|
771
|
+
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'
|
|
772
|
+
end
|
|
773
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
774
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
775
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
776
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
777
|
+
else
|
|
778
|
+
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'
|
|
779
|
+
|
|
780
|
+
end
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
639
785
|
def revoke(session_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
640
786
|
# revoke - Revoke a session
|
|
641
787
|
# Sets the status of a session as "revoked", which is an unauthenticated state.
|
|
@@ -673,10 +819,10 @@ module Clerk
|
|
|
673
819
|
|
|
674
820
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
675
821
|
timeout ||= @sdk_configuration.timeout
|
|
676
|
-
|
|
822
|
+
|
|
677
823
|
|
|
678
824
|
connection = @sdk_configuration.client.dup
|
|
679
|
-
connection.
|
|
825
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
680
826
|
|
|
681
827
|
hook_ctx = SDKHooks::HookContext.new(
|
|
682
828
|
config: @sdk_configuration,
|
|
@@ -689,7 +835,7 @@ module Clerk
|
|
|
689
835
|
error = nil
|
|
690
836
|
http_response = nil
|
|
691
837
|
|
|
692
|
-
|
|
838
|
+
|
|
693
839
|
begin
|
|
694
840
|
http_response = connection.post(url) do |req|
|
|
695
841
|
req.headers.merge!(headers)
|
|
@@ -725,13 +871,13 @@ module Clerk
|
|
|
725
871
|
response: http_response
|
|
726
872
|
)
|
|
727
873
|
end
|
|
728
|
-
|
|
874
|
+
|
|
729
875
|
if http_response.nil?
|
|
730
876
|
raise error if !error.nil?
|
|
731
877
|
raise 'no response'
|
|
732
878
|
end
|
|
733
879
|
end
|
|
734
|
-
|
|
880
|
+
|
|
735
881
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
736
882
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
737
883
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -828,10 +974,10 @@ module Clerk
|
|
|
828
974
|
|
|
829
975
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
830
976
|
timeout ||= @sdk_configuration.timeout
|
|
831
|
-
|
|
977
|
+
|
|
832
978
|
|
|
833
979
|
connection = @sdk_configuration.client.dup
|
|
834
|
-
connection.
|
|
980
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
835
981
|
|
|
836
982
|
hook_ctx = SDKHooks::HookContext.new(
|
|
837
983
|
config: @sdk_configuration,
|
|
@@ -844,7 +990,7 @@ module Clerk
|
|
|
844
990
|
error = nil
|
|
845
991
|
http_response = nil
|
|
846
992
|
|
|
847
|
-
|
|
993
|
+
|
|
848
994
|
begin
|
|
849
995
|
http_response = connection.post(url) do |req|
|
|
850
996
|
req.body = body
|
|
@@ -881,13 +1027,13 @@ module Clerk
|
|
|
881
1027
|
response: http_response
|
|
882
1028
|
)
|
|
883
1029
|
end
|
|
884
|
-
|
|
1030
|
+
|
|
885
1031
|
if http_response.nil?
|
|
886
1032
|
raise error if !error.nil?
|
|
887
1033
|
raise 'no response'
|
|
888
1034
|
end
|
|
889
1035
|
end
|
|
890
|
-
|
|
1036
|
+
|
|
891
1037
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
892
1038
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
893
1039
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -985,10 +1131,10 @@ module Clerk
|
|
|
985
1131
|
|
|
986
1132
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
987
1133
|
timeout ||= @sdk_configuration.timeout
|
|
988
|
-
|
|
1134
|
+
|
|
989
1135
|
|
|
990
1136
|
connection = @sdk_configuration.client.dup
|
|
991
|
-
connection.
|
|
1137
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
992
1138
|
|
|
993
1139
|
hook_ctx = SDKHooks::HookContext.new(
|
|
994
1140
|
config: @sdk_configuration,
|
|
@@ -1001,7 +1147,7 @@ module Clerk
|
|
|
1001
1147
|
error = nil
|
|
1002
1148
|
http_response = nil
|
|
1003
1149
|
|
|
1004
|
-
|
|
1150
|
+
|
|
1005
1151
|
begin
|
|
1006
1152
|
http_response = connection.post(url) do |req|
|
|
1007
1153
|
req.body = body
|
|
@@ -1038,13 +1184,13 @@ module Clerk
|
|
|
1038
1184
|
response: http_response
|
|
1039
1185
|
)
|
|
1040
1186
|
end
|
|
1041
|
-
|
|
1187
|
+
|
|
1042
1188
|
if http_response.nil?
|
|
1043
1189
|
raise error if !error.nil?
|
|
1044
1190
|
raise 'no response'
|
|
1045
1191
|
end
|
|
1046
1192
|
end
|
|
1047
|
-
|
|
1193
|
+
|
|
1048
1194
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1049
1195
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
1050
1196
|
if Utils.match_content_type(content_type, 'application/json')
|
data/lib/clerk/signintokens.rb
CHANGED
|
@@ -81,10 +81,10 @@ module Clerk
|
|
|
81
81
|
|
|
82
82
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
83
83
|
timeout ||= @sdk_configuration.timeout
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
|
|
86
86
|
connection = @sdk_configuration.client.dup
|
|
87
|
-
connection.
|
|
87
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
88
88
|
|
|
89
89
|
hook_ctx = SDKHooks::HookContext.new(
|
|
90
90
|
config: @sdk_configuration,
|
|
@@ -97,7 +97,7 @@ module Clerk
|
|
|
97
97
|
error = nil
|
|
98
98
|
http_response = nil
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
begin
|
|
102
102
|
http_response = connection.post(url) do |req|
|
|
103
103
|
req.body = body
|
|
@@ -134,13 +134,13 @@ module Clerk
|
|
|
134
134
|
response: http_response
|
|
135
135
|
)
|
|
136
136
|
end
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
if http_response.nil?
|
|
139
139
|
raise error if !error.nil?
|
|
140
140
|
raise 'no response'
|
|
141
141
|
end
|
|
142
142
|
end
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
145
145
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
146
146
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -163,7 +163,7 @@ module Clerk
|
|
|
163
163
|
else
|
|
164
164
|
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'
|
|
165
165
|
end
|
|
166
|
-
elsif Utils.match_status_code(http_response.status, ['404', '422'])
|
|
166
|
+
elsif Utils.match_status_code(http_response.status, ['403', '404', '422'])
|
|
167
167
|
if Utils.match_content_type(content_type, 'application/json')
|
|
168
168
|
http_response = @sdk_configuration.hooks.after_success(
|
|
169
169
|
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
@@ -226,10 +226,10 @@ module Clerk
|
|
|
226
226
|
|
|
227
227
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
228
228
|
timeout ||= @sdk_configuration.timeout
|
|
229
|
-
|
|
229
|
+
|
|
230
230
|
|
|
231
231
|
connection = @sdk_configuration.client.dup
|
|
232
|
-
connection.
|
|
232
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
233
233
|
|
|
234
234
|
hook_ctx = SDKHooks::HookContext.new(
|
|
235
235
|
config: @sdk_configuration,
|
|
@@ -242,7 +242,7 @@ module Clerk
|
|
|
242
242
|
error = nil
|
|
243
243
|
http_response = nil
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
|
|
246
246
|
begin
|
|
247
247
|
http_response = connection.post(url) do |req|
|
|
248
248
|
req.headers.merge!(headers)
|
|
@@ -278,13 +278,13 @@ module Clerk
|
|
|
278
278
|
response: http_response
|
|
279
279
|
)
|
|
280
280
|
end
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
if http_response.nil?
|
|
283
283
|
raise error if !error.nil?
|
|
284
284
|
raise 'no response'
|
|
285
285
|
end
|
|
286
286
|
end
|
|
287
|
-
|
|
287
|
+
|
|
288
288
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
289
289
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
290
290
|
if Utils.match_content_type(content_type, 'application/json')
|
data/lib/clerk/signups.rb
CHANGED
|
@@ -77,10 +77,10 @@ module Clerk
|
|
|
77
77
|
|
|
78
78
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
79
79
|
timeout ||= @sdk_configuration.timeout
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
|
|
82
82
|
connection = @sdk_configuration.client.dup
|
|
83
|
-
connection.
|
|
83
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
84
84
|
|
|
85
85
|
hook_ctx = SDKHooks::HookContext.new(
|
|
86
86
|
config: @sdk_configuration,
|
|
@@ -93,7 +93,7 @@ module Clerk
|
|
|
93
93
|
error = nil
|
|
94
94
|
http_response = nil
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
begin
|
|
98
98
|
http_response = connection.get(url) do |req|
|
|
99
99
|
req.headers.merge!(headers)
|
|
@@ -129,13 +129,13 @@ module Clerk
|
|
|
129
129
|
response: http_response
|
|
130
130
|
)
|
|
131
131
|
end
|
|
132
|
-
|
|
132
|
+
|
|
133
133
|
if http_response.nil?
|
|
134
134
|
raise error if !error.nil?
|
|
135
135
|
raise 'no response'
|
|
136
136
|
end
|
|
137
137
|
end
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
140
140
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
141
141
|
if Utils.match_content_type(content_type, 'application/json')
|
|
@@ -232,10 +232,10 @@ module Clerk
|
|
|
232
232
|
|
|
233
233
|
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
234
234
|
timeout ||= @sdk_configuration.timeout
|
|
235
|
-
|
|
235
|
+
|
|
236
236
|
|
|
237
237
|
connection = @sdk_configuration.client.dup
|
|
238
|
-
connection.
|
|
238
|
+
connection.use Utils::RetryMiddleware, retry_options
|
|
239
239
|
|
|
240
240
|
hook_ctx = SDKHooks::HookContext.new(
|
|
241
241
|
config: @sdk_configuration,
|
|
@@ -248,7 +248,7 @@ module Clerk
|
|
|
248
248
|
error = nil
|
|
249
249
|
http_response = nil
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
|
|
252
252
|
begin
|
|
253
253
|
http_response = connection.patch(url) do |req|
|
|
254
254
|
req.body = body
|
|
@@ -285,13 +285,13 @@ module Clerk
|
|
|
285
285
|
response: http_response
|
|
286
286
|
)
|
|
287
287
|
end
|
|
288
|
-
|
|
288
|
+
|
|
289
289
|
if http_response.nil?
|
|
290
290
|
raise error if !error.nil?
|
|
291
291
|
raise 'no response'
|
|
292
292
|
end
|
|
293
293
|
end
|
|
294
|
-
|
|
294
|
+
|
|
295
295
|
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
296
296
|
if Utils.match_status_code(http_response.status, ['200'])
|
|
297
297
|
if Utils.match_content_type(content_type, 'application/json')
|