Skip to content

Commit

Permalink
Update sim-swap.yaml
Browse files Browse the repository at this point in the history
Add monitoredPeriod attribute management.
  • Loading branch information
bigludo7 authored Sep 18, 2024
1 parent 597489e commit 7acbc2c
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions code/API_definitions/sim-swap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ info:
The API provides 2 operations:
- POST retrieve-date : Provides timestamp of latest SIM swap, if any, for a given phone number. If no swap has been performed, the API will return the SIM activation date (the timestamp of the first time that the sim connected to the network) by default, unless this is not possible due to local regulations preventing the safekeeping of the information for longer than the stated period of time. If this is the case, a `null` value will be returned.
- POST retrieve-date : Provides timestamp of latest SIM swap, if any, for a given phone number.
- If no swap has been performed, the API will return the SIM activation date (the timestamp of the first time that the SIM connected to the network).

Check failure on line 33 in code/API_definitions/sim-swap.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

33:156 [trailing-spaces] trailing spaces

Check failure on line 34 in code/API_definitions/sim-swap.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

34:1 [trailing-spaces] trailing spaces
- If the latest SIM swap date (or the activation date if no SIM swap) cannot be communicated due to local regulations preventing the safekeeping of the information for longer than the stated period, a `null` value will be returned. Optionally, a `monitoredPeriod` could be provided to indicate that no SIM swap has occurred during this timeframe (in days).
- POST check: Checks if SIM swap has been performed during a past period (defined in the request with 'maxAge' attribute) for a given phone number.
Expand Down Expand Up @@ -73,13 +77,13 @@ info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
version: wip
x-camara-commonalities: 0.4.0
externalDocs:
description: Product documentation at Camara
url: https://github.com/camaraproject/SimSwap
servers:
- url: "{apiRoot}/sim-swap/v1"
- url: "{apiRoot}/sim-swap/wip"
variables:
apiRoot:
default: http://localhost:9091
Expand Down Expand Up @@ -116,6 +120,13 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/SimSwapInfo"
examples:
RETRIEVE_DATE:
$ref: "#/components/examples/RETRIEVE_DATE"
RETRIEVE_MONITORED_PERIOD:
$ref: "#/components/examples/RETRIEVE_MONITORED_PERIOD"
RETRIEVE_MONITORED_NULL:
$ref: "#/components/examples/RETRIEVE_MONITORED_NULL"

Check failure on line 129 in code/API_definitions/sim-swap.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

129:72 [trailing-spaces] trailing spaces
"400":
$ref: "#/components/responses/Generic400"
"401":
Expand Down Expand Up @@ -208,6 +219,10 @@ components:
description: Timestamp of latest SIM swap performed. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone. Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z)
nullable: true
example: "2023-07-03T14:27:08.312+02:00"
monitoredPeriod:
type: integer
description: Timeframe in days for SIM card change supervision for the phone number. It could be valued in the response if the latest SIM swap occurred before this monitored period.
example: 120
CheckSimSwapInfo:
type: object
required:
Expand Down Expand Up @@ -398,3 +413,17 @@ components:
status: 504
code: TIMEOUT
message: Request timeout exceeded.
examples:
RETRIEVE_DATE:
summary: Lastest SIM swap date is send back
value:
latestSimChange: 2024-09-18T07:37:53.471829447Z
RETRIEVE_MONITORED_NULL:
summary: Only null value is retrieved
value:
latestSimChange: null
RETRIEVE_MONITORED_PERIOD:
summary: null is send back for the date but a monitoredPeriod is provided
value:
latestSimChange: null
monitoredPeriod: 120

0 comments on commit 7acbc2c

Please sign in to comment.