From 797b8668865874aa9674551db10b1e8e3b695cc6 Mon Sep 17 00:00:00 2001 From: Aaron Zhong Date: Thu, 27 Jun 2024 10:21:38 +1200 Subject: [PATCH 1/2] Update action_code param to action for consistency --- lib/authsignal.rb | 4 ++-- lib/authsignal/client.rb | 4 ++-- lib/authsignal/version.rb | 2 +- spec/authsignal/authsignal_spec.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/authsignal.rb b/lib/authsignal.rb index 53178af..3a2838d 100644 --- a/lib/authsignal.rb +++ b/lib/authsignal.rb @@ -26,8 +26,8 @@ def get_user(user_id:, redirect_url: nil) response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym) end - def get_action(user_id:, action_code:, idempotency_key:) - response = Client.new.get_action(user_id, action_code, idempotency_key) + def get_action(user_id:, action:, idempotency_key:) + response = Client.new.get_action(user_id, action, idempotency_key) response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym) end diff --git a/lib/authsignal/client.rb b/lib/authsignal/client.rb index eb2e1db..a619e05 100644 --- a/lib/authsignal/client.rb +++ b/lib/authsignal/client.rb @@ -52,8 +52,8 @@ def validate_challenge(user_id: nil, token:) handle_response(response) end - def get_action(user_id, action_code, idempotency_key) - get("/users/#{ERB::Util.url_encode(user_id)}/actions/#{action_code}/#{ERB::Util.url_encode(idempotency_key)}") + def get_action(user_id, action, idempotency_key) + get("/users/#{ERB::Util.url_encode(user_id)}/actions/#{action}/#{ERB::Util.url_encode(idempotency_key)}") end def identify(user_id, user_payload) diff --git a/lib/authsignal/version.rb b/lib/authsignal/version.rb index 8616db8..b5349d2 100644 --- a/lib/authsignal/version.rb +++ b/lib/authsignal/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Authsignal - VERSION = "2.0.0" + VERSION = "2.1.0" end diff --git a/spec/authsignal/authsignal_spec.rb b/spec/authsignal/authsignal_spec.rb index 5d52c34..85d3e65 100644 --- a/spec/authsignal/authsignal_spec.rb +++ b/spec/authsignal/authsignal_spec.rb @@ -96,7 +96,7 @@ response = Authsignal.get_action( user_id: 1, - action_code: "testAction", + action: "testAction", idempotency_key: "15cac140-f639-48c5-92db-835ec8d3d144") From 27675de33004000bc2781dca9183430f1a647f23 Mon Sep 17 00:00:00 2001 From: Aaron Zhong Date: Thu, 27 Jun 2024 10:28:27 +1200 Subject: [PATCH 2/2] Update Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index be27ac9..dd4b2f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - authsignal-ruby (2.0.0) + authsignal-ruby (2.1.0) httparty (~> 0.21.0) GEM