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

Add header x-correlator #83

Merged
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
66 changes: 65 additions & 1 deletion code/API_definitions/sim-swap-notification-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ paths:
summary: 'Create a sim swap event subscription for a phone number'
description: Create a sim swap event subscription for a phone number
operationId: createSimSwapSubscription
parameters:
- $ref: '#/components/parameters/x-correlator'
security:
- openId:
- sim-swap:subscriptions:create
Expand All @@ -94,6 +96,8 @@ paths:
Important: this endpoint is to be implemented by the API consumer.
The sim swap server will call this endpoint whenever a swapped event occurs.
operationId: postNotification
parameters:
- $ref: '#/components/parameters/x-correlator'
requestBody:
required: true
content:
Expand All @@ -108,6 +112,9 @@ paths:
responses:
"204":
description: Successful notification
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"400":
$ref: "#/components/responses/Generic400"
"401":
Expand All @@ -125,12 +132,18 @@ paths:
responses:
"201":
description: Created
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionInfo'
"202":
description: Request accepted to be processed. It applies for async creation process.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -153,12 +166,17 @@ paths:
summary: 'Retrieve a list of sim swap event subscription'
description: Retrieve a list of sim swap event subscription(s)
operationId: retrieveSubscriptionList
parameters:
- $ref: '#/components/parameters/x-correlator'
security:
- openId:
- sim-swap:subscriptions:read
responses:
"200":
description: List of event subscription details
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -180,16 +198,20 @@ paths:
tags:
- Sim swap notification subscription
summary: 'Retrieve a sim swap event subscription for a phone number'
operationId: retrieveSubscription
description: retrieve event subscription information for a given subscription.
operationId: retrieveSubscription
security:
- openId:
- sim-swap:subscriptions:read
parameters:
- $ref: "#/components/parameters/SubscriptionId"
- $ref: '#/components/parameters/x-correlator'
responses:
"200":
description: OK
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand Down Expand Up @@ -217,11 +239,18 @@ paths:
- sim-swap:subscriptions:delete
parameters:
- $ref: "#/components/parameters/SubscriptionId"
- $ref: '#/components/parameters/x-correlator'
responses:
"204":
description: event subscription deleted
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"202":
description: Request accepted to be processed. It applies for async deletion process.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand Down Expand Up @@ -251,6 +280,17 @@ components:
required: true
schema:
$ref: '#/components/schemas/SubscriptionId'
x-correlator:
name: x-correlator
in: header
description: Correlation id for the different services
schema:
type: string
headers:
x-correlator:
description: Correlation id for the different services
schema:
type: string
schemas:
PhoneNumber:
type: string
Expand Down Expand Up @@ -498,6 +538,9 @@ components:
responses:
Generic400:
description: Problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -508,6 +551,9 @@ components:
message: "Client specified an invalid argument, request body or query param"
Generic401:
description: Authentication problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -518,6 +564,9 @@ components:
message: "Request not authenticated due to missing, invalid, or expired credentials"
Generic403:
description: Client does not have sufficient permission
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -528,6 +577,9 @@ components:
message: "Client does not have sufficient permissions to perform this action"
Generic404:
description: Resource Not Found
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -538,6 +590,9 @@ components:
message: "The specified resource is not found"
Generic409:
description: Conflict
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -548,6 +603,9 @@ components:
message: "The specified resource is in a conflict"
Generic500:
description: Server error
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -558,6 +616,9 @@ components:
message: "Server error"
Generic503:
description: Service unavailable. Typically the server is down.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -568,6 +629,9 @@ components:
message: "Service unavailable"
SubscriptionIdRequired:
description: Problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand Down
46 changes: 46 additions & 0 deletions code/API_definitions/sim_swap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ paths:
- Retrieve SIM swap date
description: Get timestamp of last MSISDN <-> IMSI pairing change for a mobile user account provided with MSIDN.
operationId: retrieveSimSwapDate
parameters:
- $ref: '#/components/parameters/x-correlator'
requestBody:
description: |
Create a SIM swap date request for a MSISDN identifier.
Expand All @@ -80,6 +82,9 @@ paths:
responses:
"200":
description: Contains information about SIM swap change
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand Down Expand Up @@ -109,6 +114,8 @@ paths:
- Check SIM swap
description: Check if SIM swap has been performed during a past period
operationId: checkSimSwap
parameters:
- $ref: '#/components/parameters/x-correlator'
requestBody:
description: |
Create a check SIM swap request for a MSISDN identifier.
Expand All @@ -120,6 +127,9 @@ paths:
responses:
"200":
description: Returns whether a SIM swap has been performed during a past period
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -145,6 +155,18 @@ components:
openId:
type: openIdConnect
openIdConnectUrl: https://example.com/.well-known/openid-configuration
parameters:
x-correlator:
name: x-correlator
in: header
description: Correlation id for the different services
schema:
type: string
headers:
x-correlator:
description: Correlation id for the different services
schema:
type: string
schemas:
SimSwapInfo:
type: object
Expand Down Expand Up @@ -203,6 +225,9 @@ components:
responses:
Generic400:
description: Problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -213,6 +238,9 @@ components:
message: Client specified an invalid argument, request body or query param
Generic401:
description: Authentication problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -223,6 +251,9 @@ components:
message: Request not authenticated due to missing, invalid, or expired credentials
Generic403:
description: Client does not have sufficient permission
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -240,6 +271,9 @@ components:
message: Phone number cannot be deducted from access token context
Generic404:
description: Resource Not Found
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -250,6 +284,9 @@ components:
message: SIM Swap can't be checked because the phone number is unknown
Generic409:
description: Conflict
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -260,6 +297,9 @@ components:
message: Another request is created for the same MSISDN
Generic500:
description: Server error
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -270,6 +310,9 @@ components:
message: Server error
Generic503:
description: Service unavailable. Typically the server is down
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
Expand All @@ -280,6 +323,9 @@ components:
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:
Expand Down