Skip to content

Commit

Permalink
chore: [AUTH-2906] Release include_refresh_token changes (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-stytch authored Mar 20, 2024
1 parent 31494a1 commit ac76d08
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 13 deletions.
6 changes: 6 additions & 0 deletions lib/stytch/b2b_discovery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def initialize(connection)
# mfa_required::
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
# The type of this field is nilable +MfaRequired+ (+object+).
# primary_required::
# (no documentation yet)
# The type of this field is nilable +PrimaryRequired+ (+object+).
def exchange(
intermediate_session_token:,
organization_id:,
Expand Down Expand Up @@ -312,6 +315,9 @@ def initialize(connection)
# mfa_required::
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
# The type of this field is nilable +MfaRequired+ (+object+).
# primary_required::
# (no documentation yet)
# The type of this field is nilable +PrimaryRequired+ (+object+).
def create(
intermediate_session_token:,
organization_name:,
Expand Down
7 changes: 6 additions & 1 deletion lib/stytch/b2b_magic_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def initialize(connection)
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
#
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
# intermediate_session_token::
# (no documentation yet)
# The type of this field is nilable +String+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -133,7 +136,8 @@ def authenticate(
session_jwt: nil,
session_duration_minutes: nil,
session_custom_claims: nil,
locale: nil
locale: nil,
intermediate_session_token: nil
)
headers = {}
request = {
Expand All @@ -145,6 +149,7 @@ def authenticate(
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
request[:locale] = locale unless locale.nil?
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?

post_request('/v1/b2b/magic_links/authenticate', request, headers)
end
Expand Down
10 changes: 9 additions & 1 deletion lib/stytch/b2b_oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def initialize(connection)
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
#
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
# intermediate_session_token::
# (no documentation yet)
# The type of this field is nilable +String+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -128,14 +131,18 @@ def initialize(connection)
# mfa_required::
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
# The type of this field is nilable +MfaRequired+ (+object+).
# primary_required::
# (no documentation yet)
# The type of this field is nilable +PrimaryRequired+ (+object+).
def authenticate(
oauth_token:,
session_token: nil,
session_duration_minutes: nil,
session_jwt: nil,
session_custom_claims: nil,
pkce_code_verifier: nil,
locale: nil
locale: nil,
intermediate_session_token: nil
)
headers = {}
request = {
Expand All @@ -147,6 +154,7 @@ def authenticate(
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
request[:pkce_code_verifier] = pkce_code_verifier unless pkce_code_verifier.nil?
request[:locale] = locale unless locale.nil?
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?

post_request('/v1/b2b/oauth/authenticate', request, headers)
end
Expand Down
32 changes: 27 additions & 5 deletions lib/stytch/b2b_organizations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def get(
# for more information about role assignment.
#
# If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.implicit-roles` action on the `stytch.organization` Resource.
# The type of this field is nilable list of +String+.
# The type of this field is nilable list of +EmailImplicitRoleAssignment+.
# mfa_methods::
# The setting that controls which MFA methods can be used by Members of an Organization. The accepted values are:
#
Expand Down Expand Up @@ -592,6 +592,10 @@ def initialize(connection)
# The type of this field is nilable +String+.
# email_address::
# Updates the Member's `email_address`, if provided.
# If a Member's email address is changed, other Members in the same Organization cannot use the old email address, although the Member may update back to their old email address.
# A Member's email address can only be useable again by other Members if the Member is deleted.
#
# If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.email` action on the `stytch.member` Resource. Members cannot update their own email address.
# The type of this field is nilable +String+.
#
# == Returns:
Expand Down Expand Up @@ -1074,6 +1078,9 @@ def initialize(connection)
# member_id::
# Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
# The type of this field is +String+.
# include_refresh_token::
# (no documentation yet)
# The type of this field is nilable +Boolean+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -1101,12 +1108,18 @@ def initialize(connection)
# status_code::
# The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
# The type of this field is +Integer+.
# refresh_token::
# (no documentation yet)
# The type of this field is nilable +String+.
def google(
organization_id:,
member_id:
member_id:,
include_refresh_token: nil
)
headers = {}
query_params = {}
query_params = {
include_refresh_token: include_refresh_token
}
request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/oauth_providers/google", query_params)
get_request(request, headers)
end
Expand All @@ -1122,6 +1135,9 @@ def google(
# member_id::
# Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
# The type of this field is +String+.
# include_refresh_token::
# (no documentation yet)
# The type of this field is nilable +Boolean+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -1149,12 +1165,18 @@ def google(
# status_code::
# The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
# The type of this field is +Integer+.
# refresh_token::
# (no documentation yet)
# The type of this field is nilable +String+.
def microsoft(
organization_id:,
member_id:
member_id:,
include_refresh_token: nil
)
headers = {}
query_params = {}
query_params = {
include_refresh_token: include_refresh_token
}
request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/oauth_providers/microsoft", query_params)
get_request(request, headers)
end
Expand Down
14 changes: 12 additions & 2 deletions lib/stytch/b2b_passwords.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ def migrate(
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
#
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
# intermediate_session_token::
# (no documentation yet)
# The type of this field is nilable +String+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -305,7 +308,8 @@ def authenticate(
session_duration_minutes: nil,
session_jwt: nil,
session_custom_claims: nil,
locale: nil
locale: nil,
intermediate_session_token: nil
)
headers = {}
request = {
Expand All @@ -318,6 +322,7 @@ def authenticate(
request[:session_jwt] = session_jwt unless session_jwt.nil?
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
request[:locale] = locale unless locale.nil?
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?

post_request('/v1/b2b/passwords/authenticate', request, headers)
end
Expand Down Expand Up @@ -473,6 +478,9 @@ def reset_start(
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
#
# The type of this field is nilable +ResetRequestLocale+ (string enum).
# intermediate_session_token::
# (no documentation yet)
# The type of this field is nilable +String+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -526,7 +534,8 @@ def reset(
session_jwt: nil,
code_verifier: nil,
session_custom_claims: nil,
locale: nil
locale: nil,
intermediate_session_token: nil
)
headers = {}
request = {
Expand All @@ -539,6 +548,7 @@ def reset(
request[:code_verifier] = code_verifier unless code_verifier.nil?
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
request[:locale] = locale unless locale.nil?
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?

post_request('/v1/b2b/passwords/email/reset', request, headers)
end
Expand Down
4 changes: 4 additions & 0 deletions lib/stytch/b2b_sessions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def revoke(
# To create a new member via domain matching, use the [Exchange Intermediate Session](https://stytch.com/docs/b2b/api/exchange-intermediate-session) flow instead.
#
# Only Email Magic Link, OAuth, and SMS OTP factors can be transferred between sessions. Other authentication factors, such as password factors, will not be transferred to the new session.
# Any OAuth Tokens owned by the Member will not be transferred to the new Organization.
# SMS OTP factors can be used to fulfill MFA requirements for the target Organization if both the original and target Member have the same phone number and the phone number is verified for both Members.
#
# If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
Expand Down Expand Up @@ -295,6 +296,9 @@ def revoke(
# mfa_required::
# Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
# The type of this field is nilable +MfaRequired+ (+object+).
# primary_required::
# (no documentation yet)
# The type of this field is nilable +PrimaryRequired+ (+object+).
def exchange(
organization_id:,
session_token: nil,
Expand Down
11 changes: 8 additions & 3 deletions lib/stytch/b2b_sso.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def delete_connection(
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
#
# The type of this field is nilable +AuthenticateRequestLocale+ (string enum).
# intermediate_session_token::
# (no documentation yet)
# The type of this field is nilable +String+.
#
# == Returns:
# An object with the following fields:
Expand Down Expand Up @@ -234,7 +237,8 @@ def authenticate(
session_jwt: nil,
session_duration_minutes: nil,
session_custom_claims: nil,
locale: nil
locale: nil,
intermediate_session_token: nil
)
headers = {}
request = {
Expand All @@ -246,6 +250,7 @@ def authenticate(
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
request[:locale] = locale unless locale.nil?
request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil?

post_request('/v1/b2b/sso/authenticate', request, headers)
end
Expand Down Expand Up @@ -469,15 +474,15 @@ def create_connection(
# The type of this field is nilable +String+.
# saml_connection_implicit_role_assignments::
# All Members who log in with this SAML connection will implicitly receive the specified Roles. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment) for more information about role assignment.
# The type of this field is nilable list of +String+.
# The type of this field is nilable list of +SAMLConnectionImplicitRoleAssignment+.
# saml_group_implicit_role_assignments::
# Defines the names of the SAML groups
# that grant specific role assignments. For each group-Role pair, if a Member logs in with this SAML connection and
# belongs to the specified SAML group, they will be granted the associated Role. See the
# [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment) for more information about role assignment.
# Before adding any group implicit role assignments, you must add a "groups" key to your SAML connection's
# `attribute_mapping`. Make sure that your IdP is configured to correctly send the group information.
# The type of this field is nilable list of +String+.
# The type of this field is nilable list of +SAMLGroupImplicitRoleAssignment+.
# alternative_audience_uri::
# An alternative URL to use for the Audience Restriction. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime.
# The type of this field is nilable +String+.
Expand Down
2 changes: 1 addition & 1 deletion lib/stytch/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Stytch
VERSION = '7.4.0'
VERSION = '7.5.0'
end

0 comments on commit ac76d08

Please sign in to comment.