Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add client data origin validation #15

Merged
merged 3 commits into from
May 24, 2018
Merged

Conversation

brauliomartinezlm
Copy link
Member

No description provided.

Copy link
Contributor

@grzuy grzuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments.

👍

}.to raise_exception(RuntimeError, "Missing client_data_json")
end

describe "origin validation" do
let(:base_url) { "http:https://localhost" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about calling this original_origin instead of base_url? Feel like it might help understandability.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍


describe "origin validation" do
let(:base_url) { "http:https://localhost" }
let(:challenge) { Base64.urlsafe_encode64(SecureRandom.random_bytes(16)) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reasoning here, original_challenge instead of challenge?


def hash_to_encoded_cbor(hash)
Base64.urlsafe_encode64(CBOR.encode(hash))
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👏

end
end
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a .rubocop.yml in place with just a few cops enabled, very minimal. The goal was to keep some kind of consistency from the start.

Do you mind checking if bundle exec rubocop is green for this branch? If you have an opinion about changing any of the enabled cops let me know :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know about it :). Will address!

@brauliomartinezlm
Copy link
Member Author

@grzuy comments addressed. Merging!

@brauliomartinezlm brauliomartinezlm merged commit 304583f into master May 24, 2018
@brauliomartinezlm brauliomartinezlm deleted the origin_validation branch May 24, 2018 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants