Skip to content

Commit

Permalink
Remove the unused type method
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinj committed Jul 22, 2024
1 parent 236bc49 commit 1b125ce
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 36 deletions.
4 changes: 0 additions & 4 deletions lib/jwt/claims/audience.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ def validate!(context:, **_args)
raise JWT::InvalidAudError, "Invalid audience. Expected #{expected_audience}, received #{aud || '<none>'}" if ([*aud] & [*expected_audience]).empty?
end

def type?(type)
type == :claim
end

private

attr_reader :expected_audience
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/expiration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ def validate!(context:, **_args)
raise JWT::ExpiredSignature, 'Signature has expired' if context.payload['exp'].to_i <= (Time.now.to_i - leeway)
end

def type?(type)
type == :claims
end

private

attr_reader :leeway
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/issued_at.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ def validate!(context:, **_args)
iat = context.payload['iat']
raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(::Numeric) || iat.to_f > Time.now.to_f
end

def type?(type)
type == :claims
end
end
end
end
4 changes: 0 additions & 4 deletions lib/jwt/claims/issuer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def validate!(context:, **_args)
end
end

def type?(type)
type == :claims
end

private

attr_reader :issuers
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/jwt_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ def validate!(context:, **_args)
end
end

def type?(type)
type == :claims
end

private

attr_reader :validator
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/not_before.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ def validate!(context:, **_args)
raise JWT::ImmatureSignature, 'Signature nbf has not been reached' if context.payload['nbf'].to_i > (Time.now.to_i + leeway)
end

def type?(type)
type == :claims
end

private

attr_reader :leeway
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/numeric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ def self.validate!(payload:, **_args)
new(payload).validate!
end

def self.type?(type)
type == :claims
end

NUMERIC_CLAIMS = %i[
exp
iat
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/required.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ def validate!(context:, **_args)
end
end

def type?(type)
type == :claims
end

private

attr_reader :required_claims
Expand Down
4 changes: 0 additions & 4 deletions lib/jwt/claims/subject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ def validate!(context:, **_args)
raise(JWT::InvalidSubError, "Invalid subject. Expected #{expected_subject}, received #{sub || '<none>'}") unless sub.to_s == expected_subject
end

def type?(type)
type == :claims
end

private

attr_reader :expected_subject
Expand Down

0 comments on commit 1b125ce

Please sign in to comment.