Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gemspec

gem 'oauth2'
gem 'typhoeus'
gem 'warning'
gem 'zeitwerk'

group :development do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ GEM
unicode-display_width (2.6.0)
uri (1.0.3)
version_gem (1.1.7)
warning (1.5.0)
zeitwerk (2.6.18)

PLATFORMS
Expand All @@ -190,6 +191,7 @@ DEPENDENCIES
steep
testcontainers
typhoeus
warning
zeitwerk
zitadel-client!

Expand Down
10 changes: 8 additions & 2 deletions lib/patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

module OAuth2
module Strategy
# noinspection RbsMissingTypeSignature
class Assertion < Base
# rubocop:disable Style/Documentation
module AssertionPatch
private

# noinspection RbsMissingTypeSignature
def build_assertion(claims, opts)
raise ArgumentError, 'encoding_opts must include :algorithm and :key' unless
opts.is_a?(Hash) && opts.key?(:algorithm) && opts.key?(:key)
Expand All @@ -14,5 +15,10 @@ def build_assertion(claims, opts)
JWT.encode(claims, opts[:key], opts[:algorithm], headers)
end
end
# rubocop:enable Style/Documentation

class Assertion < Base
prepend AssertionPatch
end
end
end
3 changes: 3 additions & 0 deletions lib/zitadel_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

require 'zeitwerk'
require 'oauth2'
require 'warning'
require_relative 'patch'

Warning.ignore(:method_redefined, __dir__)

# Main entrypoint for the ZitadelClient Ruby SDK.
#
# This module encapsulates all functionality for authenticating with and accessing
Expand Down
3 changes: 3 additions & 0 deletions sig/lib/warning/warning.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Warning
def self.ignore: (Regexp | Symbol | Array[Symbol], String?) -> void
end
8 changes: 7 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
# Override the HTMLFormatter so that it writes its report inside build/coverage/html
module SimpleCov
module Formatter
class HTMLFormatter
# rubocop:disable Style/Documentation
module HTMLFormatterPatch
def output_path
File.join(SimpleCov.coverage_path, 'html')
end
end
# rubocop:enable Style/Documentation

class HTMLFormatter
prepend HTMLFormatterPatch
end
end
end

Expand Down
9 changes: 8 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'warning'
require 'dotenv'
require 'simplecov'
require 'simplecov-lcov'
Expand All @@ -17,11 +18,17 @@
# Override the HTMLFormatter so that it writes its report inside build/coverage/html
module SimpleCov
module Formatter
class HTMLFormatter
# rubocop:disable Style/Documentation
module HTMLFormatterPatch
def output_path
File.join(SimpleCov.coverage_path, 'html')
end
end
# rubocop:enable Style/Documentation

class HTMLFormatter
prepend HTMLFormatterPatch
end
end
end

Expand Down
Loading