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 management of monitoredPeriod in sim swap for retrieve-date operation #153

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bigludo7
Copy link
Collaborator

What type of PR is this?

Add one of the following kinds:

  • enhancement/feature

What this PR does / why we need it:

Add monitoredPeriod attribute management.

Which issue(s) this PR fixes:

Fixes #124

Special notes for reviewers:

Changelog input

 release-note
- Add management of the `monitoredPeriod` in the retrieve-date operation response.

Additional documentation

This section can be blank.

docs

Add monitoredPeriod attribute management.
Copy link

github-actions bot commented Sep 18, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 2 0 0.02s
✅ OPENAPI spectral 2 0 3.26s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY secretlint yes no 0.73s
✅ YAML yamllint 2 0 0.58s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@bigludo7 bigludo7 changed the title Update sim-swap.yaml Add management of monitoredPerioperationod in sim swap retrieve-date Sep 18, 2024
@bigludo7 bigludo7 changed the title Add management of monitoredPerioperationod in sim swap retrieve-date Add management of monitoredPeriod in sim swap for retrieve-date operation Sep 18, 2024
Make Mega Linter happy
Make megalinter happy
code/API_definitions/sim-swap.yaml Outdated Show resolved Hide resolved
code/API_definitions/sim-swap.yaml Outdated Show resolved Hide resolved
@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: could it make sense to use hours instead of days here, to align this attribute with "maxAge" parameter from the "check" operation?
When I use check operation , maxAge is internally compared to the monitoredPeriod and the API returns a error when maxAge >monitoredPeriod.
From this perspective it could make sense to use same UoM for both.
On the other hand monitoredPeriod represented in hours promises to be a big number.
Would like to hear other opinions here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I asked myself same question when i proposed this design. It seems to me that the use of day is more aligned with this attribute meaning and I preferred it that unit consistency across the API.

BTW Thanks @gregory1g for your helpful review :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree, even be not fully aligned with maxAge, "days" still looks better here.

Improve documentation following @gregory1g suggestion.
@bigludo7
Copy link
Collaborator Author

I need your help on this one @rartych !
I do not see how to solve the linting issue.
Thanks


- If no swap has been performed and the MNO supports unlimited SimSwap monitoring timeframe, the API will return the SIM activation date (the timestamp of the first time that the SIM connected to the network).

- If the latest SIM swap date (or the activation date if no SIM swap) cannot be communicated due to local regulations (or MNO internal privacy policies) 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 monitored time frame (in days) supported by the MNO. In this case the response must be treated as "there was no sim swap events during 'monitoredPeriod'. Either the parameter is optional, it is recommended to support it in SimSwap implementations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"there was no sim swap events" -> "there were no sim swap events"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree, even be not fully aligned with maxAge, "days" still looks better here.

bigludo7 and others added 2 commits September 30, 2024 11:09
was to were in line 35
@fernandopradocabrillo
Copy link
Collaborator

@bigludo7 there seems to be an error in the linting but I don't find what it is

@bigludo7
Copy link
Collaborator Author

bigludo7 commented Oct 3, 2024

@bigludo7 there seems to be an error in the linting but I don't find what it is

Yes - It's because I have 'null' in some example. @rartych find the cause but he hasn't yet the resolution. If we did not find it I will remove the example but as we're not particularly on rush we can let some time to Rafal to find a trick.

Co-authored-by: Fernando Prado Cabrillo <[email protected]>
Update following @rartych guidance to avoid issue
@bigludo7
Copy link
Collaborator Author

@fernandopradocabrillo @gregory1g @QaunainM As we're not preparing the Spring25 release we can move forward on this one.
Welcome to get your approval to merge this one.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spring25 Spring25 release preparation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add MonitoredPeriod into the API Response if a Telco cannot show the date / data for for Privacy Reasons
4 participants