From 2f66400f7e564ed632e25aa3324850718353098e Mon Sep 17 00:00:00 2001 From: Fernando Prado Date: Mon, 11 Dec 2023 18:38:19 +0100 Subject: [PATCH] include x-correlator --- .../sim-swap-notification-subscription.yaml | 66 ++++++++++++++++++- code/API_definitions/sim_swap.yaml | 46 +++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/code/API_definitions/sim-swap-notification-subscription.yaml b/code/API_definitions/sim-swap-notification-subscription.yaml index f311fb9..9673e59 100644 --- a/code/API_definitions/sim-swap-notification-subscription.yaml +++ b/code/API_definitions/sim-swap-notification-subscription.yaml @@ -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 @@ -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: @@ -108,6 +112,9 @@ paths: responses: "204": description: Successful notification + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' "400": $ref: "#/components/responses/Generic400" "401": @@ -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: @@ -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: @@ -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: @@ -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: @@ -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 @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/code/API_definitions/sim_swap.yaml b/code/API_definitions/sim_swap.yaml index 3e2f780..c177fcb 100644 --- a/code/API_definitions/sim_swap.yaml +++ b/code/API_definitions/sim_swap.yaml @@ -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. @@ -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: @@ -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. @@ -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: @@ -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 @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: