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

Separate endpoint yamls proposal for direct API #152

Merged
merged 13 commits into from
Jul 3, 2024
Merged

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:

Separate endpoint yaml for reachability & roaming.

Which issue(s) this PR fixes:

Fixes #125
issue for Device error identifier to be added.

Special notes for reviewers:

Yaml for both roaming & reachability subscription provided once new subscription model merged in Commonalities
API name & endpoint to be validated by the team

Changelog input

 release-note
- Split yaml device status in 4 separate yaml for reachability-retrieval, roaming-retrieval, reachability-subscriptions, roaming-subscriptions.
- Align device error messages following commonalities device identifier error definition.

Additional documentation

This section can be blank.

docs

Separate endpoint yaml for reachability & roaming.

This comment was marked as outdated.

Copy link
Collaborator Author

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

Fixed mega-Linter

- name: Device reachability status
description: Operations to get the current reachability status of a device
paths:
/retrieve-reachability-status:
Copy link
Collaborator

@fernandopradocabrillo fernandopradocabrillo Jun 10, 2024

Choose a reason for hiding this comment

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

@bigludo7 I see that for example in location-retrieval the WG opted for "/retrieve", in location-verification for "/verify", etc
If we have reachability-retrieval maybe we can go with "/retrieve" too? wdyt

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hello @fernandopradocabrillo
Yes make sense !
For the API name, today is reachability-retrieval - do you think we need to shift to reachability-status and then have an endpoint /retrieve - This is perhaps more straighforward?

Same will happen for roaming.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sounds good to me, it looks clearer

Copy link
Collaborator

Choose a reason for hiding this comment

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

/retrieve would be good.
API name: I would prefer device-reachability-status, which contains the context 'device' for the case other reachability status API will come later.

@maxl2287
Copy link
Contributor

@bigludo7 @akoshunyadi
Do we want to do here in this PR the split into 4 Yamls as well?

@akoshunyadi
Copy link
Collaborator

@maxl2287 we can do the 2 subscription APIs in a 2nd PR to the splitting issue

@bigludo7
Copy link
Collaborator Author

@maxl2287 we can do the 2 subscription APIs in a 2nd PR to the splitting issue

Both work for me
The most convenient for you Max.

@maxl2287
Copy link
Contributor

2nd PR is #161 for splitting /subscriptions

- name: Device reachability status
description: Operations to get the current reachability status of a device
paths:
/retrieve-reachability-status:
Copy link
Collaborator

Choose a reason for hiding this comment

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

/retrieve would be good.
API name: I would prefer device-reachability-status, which contains the context 'device' for the case other reachability status API will come later.

title: Device Reachability Status Retrieval
description: |
This API provides the customer with the ability to query device:
- Reachability status
Copy link
Collaborator

Choose a reason for hiding this comment

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

This list suggests that other infos might come later, but this is a specialized API.

"403":
$ref: "#/components/responses/ReachabilityPermissionDenied403"
"404":
$ref: "#/components/responses/ReachabilityNotFound404"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can see that we have the generic NOT_FOUND in addition to the DeviceIdentifierNotFound.
In which scenario does the API return an standard NOT_FOUND?

Copy link
Contributor

@maxl2287 maxl2287 Jun 13, 2024

Choose a reason for hiding this comment

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

I agree with @fernandopradocabrillo

Maybe later for such a case we should more go the way of having a reachability Status UNKNOWN with HTTP - 200 than a HTTP-404 for Reachability not found.

see #148

@bigludo7 wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@maxl2287 @fernandopradocabrillo I can remove the NOT_FOUND. No problem.

BTW we're still waiting outcomes for #148 which is a fair point. I will comment there.

Comment on lines 289 to 293
ReachabilityPermissionDenied403:
description: |
Client does not have sufficient permission.
In addition to regular scenario of `PERMISSION_DENIED`, other scenarios may exist:
- Phone number cannot be deducted from access token context.(`{"code": "NUMBER_VERIFICATION.INVALID_TOKEN_CONTEXT","message": "Phone number cannot be deducted from access token context"}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

@bigludo7, is this a valid 403 error?
Currently, we are not extracting or verifying a phone number from the access token. This situation seems more related to Number Verification rather than Device Status.

Do you agree?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question :)
For me this API could be sent from the device itself in frontend flow and in this case we got the phoneNumber from the network (see ICM proposal here). I need to update the yaml to not have device mandatory anymore.

So I think we should keep this error to manage this case but of course shifting prefix from NUMBER_VERIFICATION to DEVICE_REACHEABILTY_STATUS.

WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we make the device not mandatory then, for me, it makes sense to keep the invalid token context error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes @fernandopradocabrillo - This is my preferred option.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we offer this possibility over the access token, then we should extend the documentation. Otherwise the user has no idea when he needs to add the device.
btw. the example still contains number-verification

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@akoshunyadi Thanks - Fixed!
I've applied what we have in commonalities here

PR233 will change this but I will prefer we look for merge this one and craft new PR for additional alignement because then it is complicated to maintain.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Applied same fix for device-roaming-status api

Changed endpoint to /retrieve
Took suggestion on documentation
Device is not anymore mandatory
Add 422 for Network issue - Unable to provide reachability status

I think we're not on same page on the api name.
Copy link
Collaborator Author

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

Applied updates on device-reachability-status yaml:

  • Changed endpoint name to /retrieve
  • Took suggestion on documentation from @akoshunyadi
  • Device is not anymore mandatory
  • Add 422 for Network issue - Unable to provide reachability status

About the api name.
@akoshunyadi propose device-reachability-status (I proposed reachability-status) but ok for me to move forward with Akos proposal - any issue from the team for the name.

Note: I will apply same on device-roaming-status API

bigludo7 added 2 commits June 13, 2024 16:55
Aligned with device-reachability-status update.
@bigludo7 bigludo7 changed the title Separate endpoint yamls proposal Separate endpoint yamls proposal for direct API Jun 13, 2024
@bigludo7
Copy link
Collaborator Author

Aligned device-roaming-status with the work done with device-reacheability-status.
Need review by the team (@akoshunyadi @fernandopradocabrillo @maxl2287 @sachinvodafone) :)

@akoshunyadi akoshunyadi added Fall24 and removed v0.6.0 Planned for release v0.6.0 labels Jun 18, 2024
openapi: 3.0.3
info:
title: Device Reachability Status Retrieval
description: |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Applied

@bigludo7
Copy link
Collaborator Author

Hi team
Seems that I've mixed myself for Device Reachability Status yaml (commit 7e002c9 overrides b1b96c5 corrections).

I've fixed that (I hope so) + added Authorization and authentication § in the doc as suggested by @fernandopradocabrillo for both yaml.

Sorry for the confusion.

@akoshunyadi
Copy link
Collaborator

Where do we want to delete the old yaml? We could do it in this PR.

@maxl2287
Copy link
Contributor

I aggree with @akoshunyadi.

@bigludo7
Copy link
Collaborator Author

@akoshunyadi @maxl2287 added delete the old file in this PR

Client does not have sufficient permission.
In addition to regular scenario of `PERMISSION_DENIED`, other scenarios may exist:
- Phone number cannot be deducted from access token context.(`{"code": "NUMBER_VERIFICATION.INVALID_TOKEN_CONTEXT","message": "Phone number cannot be deducted from access token context"}`)
headers:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here it's a remaining of NUMBER_VERIFICATION, should be replaced

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bigludo7 could you please do this update, so we can approve and merge this PR? Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@akoshunyadi Done :)

Fixed line 343 - wrong description.
akoshunyadi
akoshunyadi previously approved these changes Jul 1, 2024
Copy link
Collaborator

@akoshunyadi akoshunyadi left a comment

Choose a reason for hiding this comment

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

LGTM

@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jul 1, 2024

@sachinvodafone @fernandopradocabrillo may I ask you to review this one for blocking point as we target to merge this one soon. Thanks

@fernandopradocabrillo fernandopradocabrillo self-requested a review July 1, 2024 11:48
sachinvodafone
sachinvodafone previously approved these changes Jul 3, 2024
Copy link
Collaborator

@fernandopradocabrillo fernandopradocabrillo left a comment

Choose a reason for hiding this comment

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

LGTM

@bigludo7 bigludo7 dismissed stale reviews from sachinvodafone and akoshunyadi via 0924159 July 3, 2024 10:12
@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jul 3, 2024

@akoshunyadi Due to git hub conflict issue I reinserted the 'old' device-status.yaml file and will remove it an a separate PR.
Let's hope it will work.

reachabilityStatus: CONNECTED_DATA
Not-Connected:
value:
lastStatusTime: "2024-02-20T10:41:38.657Z"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have an example where network is connected to both SMS and Data and we need to send a response accordingly like: {
"lastStatusTime": "2024-02-20T10:41:38.657Z",
"reachabilityStatus": "CONNECTED_SMS_DATA"
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For me no as my understanding DATA means that SMS is also available.
@sachinvodafone I will merge this PR so probably we could continue the conversation in Discussions tab as it does not impact this merging.

@bigludo7 bigludo7 merged commit fb334e9 into main Jul 3, 2024
1 check passed
@bigludo7 bigludo7 deleted the SeparatenEndpoints branch July 3, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate endpoints into different APIs
5 participants