From 2fadbfb96b0aa0610063806374a9fa961d87552e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 8 Aug 2024 17:41:41 +0100 Subject: [PATCH 1/4] user_management: add Apple to list of providers. This may be me completely understanding this code but: this looked like an omission here so I thought I'd open a PR for discussion. --- lib/workos/user_management.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workos/user_management.rb b/lib/workos/user_management.rb index d145591d..361c239c 100644 --- a/lib/workos/user_management.rb +++ b/lib/workos/user_management.rb @@ -19,7 +19,7 @@ class Provider Microsoft = 'MicrosoftOAuth' AuthKit = 'authkit' - ALL = [GitHub, Google, Microsoft, AuthKit].freeze + ALL = [Apple, GitHub, Google, Microsoft, AuthKit].freeze end # The AuthFactorType is a declaration of a From 15e2c805f6d8767f95d0355ef4c679910ca93699 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 8 Aug 2024 17:44:27 +0100 Subject: [PATCH 2/4] types/provider: add another missing Apple addition. --- lib/workos/types/provider.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workos/types/provider.rb b/lib/workos/types/provider.rb index 65aba393..c0bbd2c0 100644 --- a/lib/workos/types/provider.rb +++ b/lib/workos/types/provider.rb @@ -10,7 +10,7 @@ module Provider Google = 'GoogleOAuth' Microsoft = 'MicrosoftOAuth' - ALL = [GitHub, Google, Microsoft].freeze + ALL = [Apple, GitHub, Google, Microsoft].freeze end end end From 96341b057577ec87ea93de8bd7e47f472f7f8d89 Mon Sep 17 00:00:00 2001 From: Michael Hadley Date: Thu, 8 Aug 2024 17:18:41 -0700 Subject: [PATCH 3/4] Fix specs --- spec/lib/workos/sso_spec.rb | 2 +- spec/lib/workos/user_management_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/workos/sso_spec.rb b/spec/lib/workos/sso_spec.rb index 3dea8e32..d051c1b8 100644 --- a/spec/lib/workos/sso_spec.rb +++ b/spec/lib/workos/sso_spec.rb @@ -281,7 +281,7 @@ described_class.authorization_url(**args) end.to raise_error( ArgumentError, - 'Okta is not a valid value. `provider` must be in ["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]', + 'Okta is not a valid value. `provider` must be in ["AppleOAuth", "GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]', ) end end diff --git a/spec/lib/workos/user_management_spec.rb b/spec/lib/workos/user_management_spec.rb index d2f3616b..bea5b56a 100644 --- a/spec/lib/workos/user_management_spec.rb +++ b/spec/lib/workos/user_management_spec.rb @@ -213,7 +213,7 @@ end.to raise_error( ArgumentError, 'Okta is not a valid value. `provider` must be in ' \ - '["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth", "authkit"]', + '["AppleOAuth", "GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth", "authkit"]', ) end end From 057b9d53324186bd3b653c0ad10075c2307e0299 Mon Sep 17 00:00:00 2001 From: Michael Hadley Date: Thu, 8 Aug 2024 17:20:20 -0700 Subject: [PATCH 4/4] Fix Rubocop offense --- spec/lib/workos/sso_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/lib/workos/sso_spec.rb b/spec/lib/workos/sso_spec.rb index d051c1b8..591e83d9 100644 --- a/spec/lib/workos/sso_spec.rb +++ b/spec/lib/workos/sso_spec.rb @@ -281,7 +281,8 @@ described_class.authorization_url(**args) end.to raise_error( ArgumentError, - 'Okta is not a valid value. `provider` must be in ["AppleOAuth", "GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]', + 'Okta is not a valid value. `provider` must be in ' \ + '["AppleOAuth", "GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]', ) end end