Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

change check_url route to use query param instead of path #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PATH
remote: .
specs:
prove_keybase (0.1.2)
active_model_serializers
faraday
faraday_middleware
prove_keybase (0.1.3)
active_model_serializers (~> 0.10)
faraday (~> 0.15)
faraday_middleware (~> 0.13)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -215,15 +215,15 @@ PLATFORMS
ruby

DEPENDENCIES
bcrypt
bcrypt (~> 3.1)
prove_keybase!
pry
rails (~> 5.2.3)
rspec-rails
rspec-rails (~> 3.8)
rubocop
sqlite3
travis
webmock
sqlite3 (~> 1.4)
travis (~> 1.8)
webmock (~> 3.7)

BUNDLED WITH
1.17.2
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ProveKeybase::Engine.routes.draw do
get 'config', to: 'config#show'
resources :proofs, only: [:new, :create]
get 'api/v1/proofs/:username', to: 'api_v1_proofs#show', as: :check_proof
get 'api/v1/proofs', to: 'api_v1_proofs#show', as: :check_proof
end
2 changes: 1 addition & 1 deletion spec/controllers/config_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

config = JSON.parse(response.body)
expect(config['profile_url']).to eq 'https://example.test/users/%{username}'
expect(config['check_url']).to eq "https://example.test/prove_keybase/api/v1/proofs/%{username}"
expect(config['check_url']).to eq "https://example.test/prove_keybase/api/v1/proofs?username=%{username}"
end
end
end
2 changes: 1 addition & 1 deletion spec/integration/proof_creation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def keybase_proof_live_response(request)
# dumbed-down version of what keybase is actually doing
# to determine whether or not a proof is "live"
username = request.uri.query_values['username']
get "/prove_keybase/api/v1/proofs/#{username}"
get "/prove_keybase/api/v1/proofs?username=#{username}"

local_api_response = JSON.parse(response.body)['signatures']
proof_live = (local_api_response == [{ 'sig_hash' => token, 'kb_username' => kb_username }])
Expand Down