-
Notifications
You must be signed in to change notification settings - Fork 21
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
Numberverify verify Test definition #124
Changes from 8 commits
a03682d
849e20d
6e52ca9
bcc87e9
cfe09c0
564359d
9fe46ce
79181e6
da3c3bb
d012be8
82f02e9
ada4a18
2c488bf
fc899f8
e0e2c58
fcea400
50949f4
796b9c6
414a57f
6d6d58f
f8513aa
4c775ca
81072eb
f3fbd39
fa334b2
393d7da
a61b1c4
5b35bde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
|
||
|
||
@NumberVerification_verify | ||
Feature: Camara Number Verification API verify | ||
|
||
# Input to be provided by the implementation to the tests | ||
# References to OAS spec schemas refer to schemas specified in | ||
# https://raw.githubusercontent.com/camaraproject/NumberVerification/main/code/API_definitions/number_verification.yaml | ||
# | ||
# Implementation indications: | ||
# * api_root: API root of the server URL | ||
# | ||
# Testing assets: | ||
# * a mobile device with SIM card with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
# * a mobile device with SIM card with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER2 | ||
|
||
|
||
|
||
Background: Common Number Verification verify setup | ||
Given the resource "/number-verification/v0" as base url | ||
And the header "Content-Type" is set to "application/json" | ||
And the header "Authorization" is set to a valid access token | ||
And the header "x-correlator" is set to a UUID value | ||
And the request body is compliant with the schema NumberVerificationRequestBody | ||
And the response body is compliant with the schema NumberVerificationMatchResponse | ||
And the header "x-correlator" is set to a UUID value | ||
And NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 is compliant with the schema DevicePhoneNumber | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER2 is compliant with the schema DevicePhoneNumber | ||
And NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 is different to NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER2 | ||
|
||
@NumberVerification_verify0_phoneNumber_does_not_match_schema | ||
Scenario Outline: phoneNumber value does not comply with the schema | ||
Given the request body property "$.phoneNumber" is set to: <phone_number_value> | ||
When the HTTP "POST" request is sent | ||
Then the response status code is 400 | ||
And the response property "$.status" is 400 | ||
And the response property "$.code" is "INVALID_ARGUMENT" | ||
And the response property "$.message" contains a user friendly text | ||
|
||
Examples: | ||
| phone_number_value | | ||
| string_value | | ||
| 1234567890 | | ||
| +12334foo22222 | | ||
| +00012230304913849 | | ||
| 123 | | ||
| ++49565456787 | | ||
|
||
|
||
@NumberVerification_verify100_match_true | ||
Scenario: verify phone number NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1, network connection and access token matches NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
Given they use the base url over a mobile connection | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just the first step of the Authorization Code flow ( The If so, what do you think about moving the mobile connection requirement to the Background section? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think about that. Usually, it is a security issue if several requests are not bound together and/or come from different sources. I wanted to add sender-constrained tokens to Camara, but I was told that operators have never heard of that and too few implemented it, so ICM should not demand it. Thanks for the comment. |
||
And the resource is "/verify" | ||
And they acquired a valid access token associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 through OIDC authorization code flow | ||
And one of the scopes associated with the access token is number-verification:verify | ||
When the HTTPS "POST" request is sent | ||
And the mobile connection is associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
And the request body has the field phoneNumber with a value of NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
And the response header "x-correlator" has same value as the request header "x-correlator" | ||
And the response header "Content-Type" is "application/json" | ||
And the response body complies with the OAS schema at "/components/schemas/SendCodeResponse" | ||
Then the response status code is 200 | ||
And the response property "$.devicePhoneNumberVerified" is true | ||
|
||
|
||
@NumberVerification_verify101_match_false | ||
Scenario: verify phone number NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1, network connection and access token matches NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER2 | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Given they use the base url over a mobile connection | ||
And the resource is "/verify" | ||
And they acquired a valid access token associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 through OIDC authorization code flow | ||
And one of the scopes associated with the access token is number-verification:verify | ||
When the HTTPS "POST" request is sent | ||
And the mobile connection is associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
And the request body has the field phoneNumber with a value of NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER2 | ||
And the response header "x-correlator" has same value as the request header "x-correlator" | ||
And the response header "Content-Type" is "application/json" | ||
And the response body complies with the OAS schema at "/components/schemas/SendCodeResponse" | ||
Then the response status code is 200 | ||
And the response property "$.devicePhoneNumberVerified" is false | ||
|
||
@NumberVerification_verify200_missing_phone_number_in_request | ||
Scenario: verify phone number but no phonenumber in request | ||
Given they use the base url over a mobile connection | ||
And the resource is "/verify" | ||
And they acquired a valid access token associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 through OIDC authorization code flow | ||
And one of the scopes associated with the access token is number-verification:verify | ||
When the HTTPS "POST" request is sent | ||
And the mobile connection is associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
And the request body has NO the field phoneNumber | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And the response header "x-correlator" has same value as the request header "x-correlator" | ||
And the response header "Content-Type" is "application/json" | ||
And the response body complies with the OAS schema at "/components/schemas/SendCodeResponse" | ||
Then the response property "$.status" is 400 | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And the response property "$.code" is "INVALID_ARGUMENT" | ||
And the response property "$.message" contains a user friendly text | ||
|
||
@NumberVerification_verify201_missing_scope | ||
Scenario: verify phone number with valid access token but scope number-verification:verify is missing | ||
Given they use the base url over a mobile connection | ||
And the resource is "/verify" | ||
And they acquired a valid access token associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 through OIDC authorization code flow | ||
And none of the scopes associated with the access token is number-verification:verify | ||
When the HTTPS "POST" request is sent | ||
And the mobile connection is associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
And the request body has NO the field phoneNumber | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And the response header "x-correlator" has same value as the request header "x-correlator" | ||
And the response header "Content-Type" is "application/json" | ||
And the response body complies with the OAS schema at "/components/schemas/SendCodeResponse" | ||
Then the response property "$.status" is 401 | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And the response property "$.code" is "UNAUTHENTICATED" | ||
And the response property "$.message" is "Request not authenticated due to missing, invalid, or expired credentials." | ||
|
||
@NumberVerification_verify202_expired_access_token | ||
Scenario: verify phone number with expired access token | ||
Given they use the base url over a mobile connection | ||
And the resource is "/verify" | ||
And they acquired a valid access token associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 through OIDC authorization code flow or CIBA | ||
And one of the scopes associated with the access token is number-verification:verify | ||
When the HTTPS "POST" request is sent | ||
And the access token has expired | ||
And the mobile connection is associated with NUMBERVERIFY_VERIFY_MATCH_PHONENUMBER1 | ||
And the request body has NO the field phoneNumber | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And the response header "x-correlator" has same value as the request header "x-correlator" | ||
And the response header "Content-Type" is "application/json" | ||
And the response body complies with the OAS schema at "/components/schemas/SendCodeResponse" | ||
Then the response property "$.status" is 401 | ||
And the response property "$.code" is "AUTHENTICATION_REQUIRED" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or UNAUTHENTICATED, still don't know which one should apply in this case |
||
And the response property "$.message" is "New authentication is required." | ||
AxelNennker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test included for veryfy operation:
Pending test to be included:
cc: @bigludo7 @AxelNennker