From f3a78a9e46ac524c6e5f7531d14e402608411bde Mon Sep 17 00:00:00 2001 From: Stoica Alexandru Date: Tue, 9 Jan 2024 18:43:34 +0000 Subject: [PATCH] Add `create_jwt_token` helper method (#24) The method can be used to generate the JWT token used for authentication. A scenario where this is useful is for tests that require time travel and would end up generating and invalid JWT due to being in the past. --- lib/ruby_snowflake/client.rb | 7 +++++++ lib/ruby_snowflake/version.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ruby_snowflake/client.rb b/lib/ruby_snowflake/client.rb index 1448cdc..f61866e 100644 --- a/lib/ruby_snowflake/client.rb +++ b/lib/ruby_snowflake/client.rb @@ -156,6 +156,13 @@ def self.env_option(env_var_name, default_value) value = ENV[env_var_name] value.nil? || value.empty? ? default_value : ENV[env_var_name].to_i end + + # This method can be used to populate the JWT token used for authentication + # in tests that require time travel. + def create_jwt_token + @key_pair_jwt_auth_manager.jwt_token + end + private_class_method :env_option private diff --git a/lib/ruby_snowflake/version.rb b/lib/ruby_snowflake/version.rb index 7dc6d99..d9c21f8 100644 --- a/lib/ruby_snowflake/version.rb +++ b/lib/ruby_snowflake/version.rb @@ -1,3 +1,3 @@ module RubySnowflake - VERSION = "1.0.0" + VERSION = "1.0.1" end