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 400 OUT_OF_RANGE error when the maxAge is above 2400 #189

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

Conversation

bigludo7
Copy link
Collaborator

@bigludo7 bigludo7 commented Feb 25, 2025

What type of PR is this?

Add one of the following kinds:

  • enhancement/feature

What this PR does / why we need it:

  • Add 400 OUT_OF_RANGE error when the maxAge is above 2400

Which issue(s) this PR fixes:

Fixes #187

Special notes for reviewers:

Changelog input

 release-note
- Add 403 with code OUT_OF_RANGE when the maxAge is above 2400


Additional documentation

This section can be blank.

docs

Copy link

🦙 MegaLinter status: ✅ SUCCESS

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

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@hdamker hdamker changed the title Add 403 OUT_OF_RANGE error when the maxAge is above 2400 Add 400 OUT_OF_RANGE error when the maxAge is above 2400 Feb 25, 2025
@hdamker
Copy link
Collaborator

hdamker commented Feb 25, 2025

@bigludo7 I edited the title and the description of the PR, as the content is a 400, not a 403 error response.

value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a very generic definition. A client which will receive such error code will have to guess what exactly value is out of the range and what this range is. The error must explicitly say this.
If we introduce this error for maxAge > 24000 only - we can describe this in he API description. So, a client knows what the error is really about.

Copy link
Collaborator Author

@bigludo7 bigludo7 Feb 27, 2025

Choose a reason for hiding this comment

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

As we have very few attribute in this check request (only the maxAge in 3-legs, maxAge & phoneNumber in the 2-legs scenario) I have no problem to custom our message to SIM_SWAP.MAX_AGE_OUT_OF_RANGE.
@gregory1g @fernandopradocabrillo @QaunainM work for you?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to stick with the generic one from commonalities artifact. The message is a free text field that can be customized by the implementation. If you feel that it is something critical we can use a message like: "Client specified a value of maxAge outside the defined range"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@fernandopradocabrillo Yes make sense - I've forget our message capability - This seems to me a better approach.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To have in mind for this PR: #184 (reply in thread)

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

Successfully merging this pull request may close these issues.

Add 400 with OUT_OF_RANGE code in sim-swap 2.0.0
4 participants