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

Initial contribution of Age_Verification.yaml #50

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Changes from 7 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2c40283
Initial contribution of Age_Verification.yaml
ToshiWakayama-KDDI Feb 2, 2024
ed7003f
Update age-verification.yaml
GillesInnov35 Feb 2, 2024
0335b85
Update age-vefification.yaml
GillesInnov35 Feb 16, 2024
ea5d63a
Update age-vefification.yaml
GillesInnov35 Mar 5, 2024
da5d59c
Update age-vefification.yaml
GillesInnov35 Mar 6, 2024
6673fe5
Update age-vefification.yaml
GillesInnov35 Mar 12, 2024
ae2c024
Update age-vefification.yaml
GillesInnov35 Mar 27, 2024
d35564d
Update age-vefification.yaml
GillesInnov35 Apr 10, 2024
52f2ca6
Update age-vefification.yaml
GillesInnov35 May 22, 2024
754c2e0
Update age-vefification.yaml
GillesInnov35 May 29, 2024
82647d1
Update age-vefification.yaml
GillesInnov35 May 29, 2024
830e390
Update age-vefification.yaml
GillesInnov35 May 29, 2024
4bd8a34
Update age-vefification.yaml
GillesInnov35 Jun 10, 2024
c4863dd
Update age-vefification.yaml
GillesInnov35 Jun 18, 2024
007c6c0
Update age-vefification.yaml
GillesInnov35 Jun 18, 2024
abc4093
Update age-vefification.yaml
GillesInnov35 Jun 19, 2024
b4a2009
Update age-vefification.yaml
GillesInnov35 Oct 9, 2024
dd5d701
Update age-vefification.yaml
GillesInnov35 Oct 10, 2024
1f55416
Update age-vefification.yaml
GillesInnov35 Oct 22, 2024
6b6bdb0
Update age-vefification.yaml
GillesInnov35 Oct 22, 2024
e6a6acf
Update age-vefification.yaml
GillesInnov35 Nov 7, 2024
9cac56f
Update age-vefification.yaml
GillesInnov35 Nov 7, 2024
54ec998
Update age-vefification.yaml
GillesInnov35 Nov 8, 2024
35eeb39
Update age-vefification.yaml
GillesInnov35 Nov 14, 2024
a9ad64d
Update age-vefification.yaml
GillesInnov35 Nov 25, 2024
a7526d1
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 26, 2024
6b505d2
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 26, 2024
d645e58
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 27, 2024
81ff0fc
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 27, 2024
e9029f2
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 27, 2024
0f344ce
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 27, 2024
ee4538f
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 27, 2024
5d4be80
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 28, 2024
71fe78d
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 28, 2024
a38da87
Update code/API_definitions/age-vefification.yaml
GillesInnov35 Nov 28, 2024
bb7e933
Update age-vefification.yaml
GillesInnov35 Nov 28, 2024
b382392
Update age-vefification.yaml
GillesInnov35 Nov 29, 2024
cb50467
Update and rename age-vefification.yaml to age-verification.yaml
GillesInnov35 Nov 29, 2024
42b9298
Update age-verification.yaml
GillesInnov35 Dec 2, 2024
f9ed877
Update code/API_definitions/age-verification.yaml
GillesInnov35 Dec 5, 2024
a9a9787
Update code/API_definitions/age-verification.yaml
GillesInnov35 Dec 5, 2024
e60ddc3
Update code/API_definitions/age-verification.yaml
GillesInnov35 Dec 10, 2024
a0dd209
Update code/API_definitions/age-verification.yaml
GillesInnov35 Dec 10, 2024
22359e3
Update code/API_definitions/age-verification.yaml
GillesInnov35 Dec 10, 2024
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
337 changes: 337 additions & 0 deletions code/API_definitions/age-vefification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,337 @@
openapi: 3.0.3
info:
title: Know Your Customer Age Verification

termsOfService: http://swagger.io/terms/
contact:
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html

version: 0.1.0-wip


servers:
- url: '{apiRoot}/{basePath}'
variables:
apiRoot:
default: http://localhost:9091
description: API root
basePath:
default: kyc-ageverify/v0
description: Base path for the KYC-AgeVerify API

tags:
- name: Ageverify

description: Operations to verify the age of a user.

paths:
/ageverify:
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't the endpoint be just /verify?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, but no, we can't. This path name was agreed by Sub Project in the early stage and it has not been changed since then. Technically, maybe yes, but we KDDI would not agree to change it.

Thanks,
Toshi

Copy link
Collaborator

Choose a reason for hiding this comment

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

hi @fernandopradocabrillo , @ToshiWakayama-KDDI , /verify is already used for number-verification API.
For Tenure API /check-tenure has been choosen. May be verify-age could be proposed if the previous one is not approved by all.
Gilles

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not really a big deal, just a comment to simplify, I hadn't noticed it before. For me /verify or /verify-age is more align with the rest of CAMARA APIs, but I'm late to this conversation so I will live with whatever you decide 😶

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, @fernandopradocabrillo , Thanks, @GillesInnov35 ,

I would like to stick to the existing 'ageverify', if it can be accepted by all. I think 'ageverify' is not prohibited by Commonalities, and alignment with other CAMARA APIs may be a subjective matter. But if you have problem with 'ageverify', please let me/us know. Otherwise, let's keep it.

Best regards,
Toshi

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fine for me then!

post:
tags:
- Ageverify
summary: Verify if the age of a user is under the provided age value submitted in order to automatically denied access to gaming, alcohol, or other age-restricted sites. There are restrictions applied to the service. User phone number must be the contact's phone number declared in the contract.

operationId: KYC_AgeVerify

security:
- openId:
- know-your-customer:AgeVerify


parameters:
- $ref: '#/components/parameters/x-correlator'

requestBody:
required: true
content:
application/json:

schema:
$ref: '#/components/schemas/KYC_RequestBody'
examples:
RequestExample:
value:
phoneNumber: '+34629255833'
givenName: 'Federica'
middleNames: 'Sanchez'
familyName: 'Arjona'
email: "[email protected]"
age: 18

responses:
'200':
description: OK
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'

content:
application/json:

schema:
$ref: '#/components/schemas/KYC_ResponseBody'
examples:
KYC_200Example:
value:
phoneNumber: '+34629255833'
age: 18
isVerified: true
assuranceLeve: 95

'400':
$ref: '#/components/responses/Generic400'

'401':
$ref: '#/components/responses/Generic401'

'403':
$ref: '#/components/responses/Generic403'

'404':
$ref: '#/components/responses/Generic404'

'500':
$ref: '#/components/responses/Generic500'

'503':
$ref: '#/components/responses/Generic503'

'504':
$ref: '#/components/responses/Generic504'

components:
securitySchemes:
openId:
type: openIdConnect
openIdConnectUrl: https://example.com/.well-known/openid-configuration


headers:
x-correlator:
description: Correlation id for the different services
schema:
type: "string"

parameters:
x-correlator:
name: x-correlator
in: header
description: Correlation id for the different services
schema:
type: "string"

schemas:
KYC_RequestBody:
description: "Requested information to be compare with customer personal information"
required:
- "givenName"
- "familyName"
- "age"
type: "object"

properties:
phoneNumber:
type: "string"
description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, optionally prefixed with '+'.
GillesInnov35 marked this conversation as resolved.
Show resolved Hide resolved

givenName:
type: "string"
description: First name/given name of the customer. It may include a compound first name or a second/middle name.

middleNames:
type: string
description: Middle name/s of the customer.

familyName:
type: "string"
description: Surname/family name of the customer. It may include a compound last name or an additional last name.

email:
type: string
description: Email address of the customer in the RFC specified format (local-part@domain), stored on the OB systems.

age:
type: "integer"
description: age to be verified.

KYC_ResponseBody:
type: "object"
properties:

phoneNumber:
type: "string"
description: A public identifier addressing a telephone subscription.

age:
type: "integer"
description: age which has been verified.

isVerified:
type: "boolean"
default: True
description: Indicates if the age has been verified (True) or if it has not been possible (False).

assuranceLevel:
type: "integer"
description: Assurance level the MNO has to provide a result of the age verification.

ErrorInfo:
type: "object"
required:
- status
- code
- message
properties:
status:
type: "integer"
description: HTTP response status code
code:
type: "string"
description: Code given to this error
message:
type: "string"
description: Detailed error description

responses:
Generic400:
description: |-
Problem with the client request.
In addition to regular scenario of `INVALID_ARGUMENT`, another scenario may exist.

- Indicated param combination is invalid (`"code": "KNOW_YOUR_CUSTOMER.INVALID_PARAM_COMBINATION","message": "Indicated parameter combination is invalid"`)
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:

application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
examples:
InvalidArgument:
value:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param
GillesInnov35 marked this conversation as resolved.
Show resolved Hide resolved
InvalidParamCombination:
value:
status: 400
code: KNOW_YOUR_CUSTOMER.INVALID_PARAM_COMBINATION
message: Indicated parameter combination is invalid

Generic401:
description: Authentication problem with the client request. Unauthorized error. Access Token related errors.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
examples:
Unauthenticated:
value:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials
GillesInnov35 marked this conversation as resolved.
Show resolved Hide resolved

Generic403:
description: |
Client does not have sufficient permission.
In addition to regular scenario of `PERMISSION_DENIED`, another scenarios may exist:

- Phone number cannot be deducted from access token context.(`{"code": "KNOW_YOUR_CUSTOMER.INVALID_TOKEN_CONTEXT","message": "Phone number mismatch with access token context"}`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Align according to the decision on what errors to include


headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:

application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
examples:
PermissionDenied:
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action
InvalidTokenContext:
value:
status: 403
code: KNOW_YOUR_CUSTOMER.INVALID_TOKEN_CONTEXT
message: Phone number mismatch with access token context
GillesInnov35 marked this conversation as resolved.
Show resolved Hide resolved

Generic404:
description: |
Not Found error. Error if URL is wrong / user is not found.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
examples:
NotFound:
value:
status: 404

code: NOT_FOUND
message: not_found_contractor/not_found
GillesInnov35 marked this conversation as resolved.
Show resolved Hide resolved

Generic500:
description: Server error. Problem with MNO's server side. Some processing error within MNO's servers.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
examples:
ServerError:
value:
status: 500
code: INTERNAL
message: Server error

Generic503:
description: Service unavailable. Typically the server is down. Problem with MNO's server side. Any unexpected error within MNO's servers.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
examples:
ServiceUnavailable:
value:
status: 503
code: UNAVAILABLE
message: Service unavailable

Generic504:
description: Request time exceeded. If it happens repeatedly, consider reducing the request complexity
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:

schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 504
code: TIMEOUT
message: Request timeout exceeded. Try later.