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
2 changes: 1 addition & 1 deletion lib/cognito_idp/authorization_uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CognitoIdp
class AuthorizationUri
attr_accessor :client_id, :code_challenge_method, :code_challenge, :domain,
attr_reader :client_id, :code_challenge_method, :code_challenge, :domain,
:idp_identifier, :identity_provider, :nonce, :redirect_uri, :response_type,
:scope, :state

Expand Down
2 changes: 1 addition & 1 deletion lib/cognito_idp/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

module CognitoIdp
class Client
attr_accessor :adapter, :client_id, :client_secret, :domain
attr_reader :adapter, :client_id, :client_secret, :domain

def initialize(client_id:, domain:, client_secret: nil, adapter: Faraday.default_adapter, stubs: nil)
@adapter = adapter
Expand Down
2 changes: 1 addition & 1 deletion lib/cognito_idp/logout_uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module CognitoIdp
class LogoutUri
attr_accessor :client_id, :domain, :logout_uri, :redirect_uri, :response_type, :scope, :state
attr_reader :client_id, :domain, :logout_uri, :redirect_uri, :response_type, :scope, :state

def initialize(client_id:, domain:, **options)
@client_id = client_id
Expand Down
2 changes: 1 addition & 1 deletion lib/cognito_idp/user_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def method_missing(method, ...)
end

def respond_to_missing?(method, include_private = false)
true
@attributes.respond_to?(method, include_private) || super
end
end
end
12 changes: 12 additions & 0 deletions spec/cognito_idp/user_info_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
it { expect(user_info.email_verified).to be_nil }
it { expect(user_info.phone_number_verified).to be_nil }

describe "#respond_to?" do
context "when attribute exists" do
let(:user_info_hash) { {"email" => "jane@example.com"} }

it { expect(user_info).to respond_to(:email) }
end

context "when attribute does not exist" do
it { expect(user_info).not_to respond_to(:nonexistent) }
end
end

context "when given attributes" do
let(:user_info_hash) do
{
Expand Down