Skip to content

Commit

Permalink
Remove get_signup_assessment method from the lib
Browse files Browse the repository at this point in the history
This endpoint was discontinued by Incognia.
  • Loading branch information
julianalucena committed Jul 5, 2024
1 parent 93916f9 commit 9557c10
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 68 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ assessment = api.register_signup(
# => #<OpenStruct id="...", device_id="...", risk_assessment="..", evidence=...>
```

### Getting a Signup

This method allows you to query the latest assessment for a given signup event, returning signup assessment, containing the risk assessment and supporting evidence:

```ruby
assessment = api.get_signup_assessment(signup_id: "95a9fc56-f65e-436b-a87f-a1338043678f")

# => #<OpenStruct id="...", request_id="...", device_id="...", risk_assessment="..", evidence=...>

```

### Registering a Login

This method registers a new login for the given installation and account, returning a login assessment, containing the risk assessment and supporting evidence:
Expand Down
9 changes: 0 additions & 9 deletions lib/incognia_api/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ def register_signup(installation_id:, address: nil, **opts)
SignupAssessment.from_hash(response.body) if response.success?
end

def get_signup_assessment(signup_id:)
response = connection.request(
:get,
"v2/onboarding/signups/#{signup_id}"
)

SignupAssessment.from_hash(response.body) if response.success?
end

def register_login(installation_id:, account_id:, **opts)
params = {
type: :login,
Expand Down
13 changes: 1 addition & 12 deletions spec/helpers/api_spec_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.included(rspec)
rspec.let(:unknown_login_fixture) do
File.new("spec/fixtures/login-unknown.json").read
end
rspec.let(:unknown_payment_fixture) do
rspec.let(:unknown_payment_fixture) do
File.new("spec/fixtures/payment-unknown.json").read
end
rspec.let(:missing_required_params_fixture) do
Expand Down Expand Up @@ -65,17 +65,6 @@ def stub_signup_request_500
headers: { 'Content-Type' => 'application/json' })
end

def stub_get_signup_request(signup_id:)
json_body = JSON.parse(unknown_signup_fixture, symbolize_names: true)
json_body.merge(id: signup_id)

stub_request(:get, "https://api.incognia.com/api/v2/onboarding/signups/#{signup_id}").
to_return(
status: 200,
body: json_body.to_json,
headers: { 'Content-Type' => 'application/json' })
end

def stub_login_request
stub_request(
:post, "https://api.incognia.com/api/v2/authentication/transactions"
Expand Down
36 changes: 0 additions & 36 deletions spec/incognia_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,42 +157,6 @@ module Incognia

end

describe "#get_signup_assessment" do
let(:signup_id) { 'id' }

it "when successful returns the resource" do
stub_token_request
stub_get_signup_request(signup_id: signup_id)

signup = api.get_signup_assessment(signup_id: signup_id)

expected = JSON.parse(unknown_signup_fixture, symbolize_names: true)
expect(signup.id).
to eql expected[:id]
expect(signup.risk_assessment).
to eql expected[:risk_assessment]
expect_evidences_to_match(signup, expected)
end

context "HTTP request" do
it "hits the endpoint with signup id at URL" do
stub_token_request

stub = stub_get_signup_request(signup_id: signup_id)
stub.with(
headers: {
'Authorization' => /Bearer.*/
}
)

api.get_signup_assessment(signup_id: signup_id)

expect(stub).to have_been_made.once
end
end

end

describe "#register_login" do
let(:installation_id) { SecureRandom.uuid }
let(:account_id) { SecureRandom.uuid }
Expand Down

0 comments on commit 9557c10

Please sign in to comment.