Skip to content

Commit

Permalink
Add create_jwt_token helper method (#24)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexstoick authored Jan 9, 2024
1 parent a25f7c2 commit f3a78a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/ruby_snowflake/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_snowflake/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RubySnowflake
VERSION = "1.0.0"
VERSION = "1.0.1"
end

0 comments on commit f3a78a9

Please sign in to comment.