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

Update sim-swap-notification-subscription.yaml #111

Merged
merged 13 commits into from
Jul 15, 2024
Merged

Conversation

bigludo7
Copy link
Collaborator

@bigludo7 bigludo7 commented Jun 5, 2024

What type of PR is this?

Add one of the following kinds:

  • correction

What this PR does / why we need it:

Modify sim-swap-notification-subscription.yaml accordingly to the new format defined in Commonalities.
This format is aligned with CloudEvents.

Which issue(s) this PR fixes:

Fixes #108
#113

Special notes for reviewers:

Changelog input

 release-note
- align subscription model accordingly to the new format defined in Commonalities.
This format is aligned with CloudEvents.
- Fixes examples for phoneNumber

Additional documentation

This section can be blank.

docs

Align with CloudEvents model for subscription
Copy link

github-actions bot commented Jun 5, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 2 0 0.03s
✅ OPENAPI spectral 2 0 3.22s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY secretlint yes no 0.72s
✅ YAML yamllint 2 0 0.51s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link

@maxl2287 maxl2287 left a comment

Choose a reason for hiding this comment

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

@bigludo7 I have added some points.
Wdyt?

@maxl2287
Copy link

maxl2287 commented Jun 7, 2024

Maybe you also need to create an example for the request, as the example request for POST /subscriptions is not showing the required "protocol" - property.

Or do you have an idea how to tell the example to use "type": "HTTP" ?

image

@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jun 7, 2024

💯 thanks @maxl2287 for your review !
I will consider all these.

@maxl2287
Copy link

maxl2287 commented Jun 7, 2024

Maybe you also need to create an example for the request, as the example request for POST /subscriptions is not showing the required "protocol" - property.

Or do you have an idea how to tell the example to use "type": "HTTP" ?

image

I added an issue for this behaviour / bug:
camaraproject/Commonalities#226

@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jun 7, 2024

Fixed all points raised by @maxl2287 (I hope so)

bigludo7 added 2 commits June 10, 2024 09:52
Added quote for phoneNumber in the examples.
@maxl2287
Copy link

LGTM 🎉

Copy link

@maxl2287 maxl2287 left a comment

Choose a reason for hiding this comment

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

Updating the name of the file to sim-swap-subscriptions.yaml ?
At least the plural -subscriptions has to be at the end.

Removing -notifications- would also include updating the whole file to remove Notifications also for, e.g., tags.

Copy link

@maxl2287 maxl2287 left a comment

Choose a reason for hiding this comment

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

@bigludo7 I added some comments.
Please take a look 🐦

security:
- openId:
- sim-swap:subscriptions:create
- sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:read

Choose a reason for hiding this comment

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

For creating a subscription we should use here create as an action.

security:
- openId:
- sim-swap:subscriptions:read
- sim-swap-subscriptions:read

Choose a reason for hiding this comment

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

sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:read

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hummm - I dont think so regarding the template yaml for the GET operation which is on the subscription itself and not the event.

summary: 'Retrieve a sim swap event subscription for a phone number'
description: retrieve event subscription information for a given subscription.
operationId: retrieveSubscription
security:
- openId:
- sim-swap:subscriptions:read
- sim-swap-subscriptions:read

Choose a reason for hiding this comment

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

sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:read

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hummm - I dont think so regarding the template yaml for the GET operation which is on the subscription itself and not the event.

summary: 'Delete a sim swap event subscription'
operationId: deleteSubscription
description: delete a given event subscription.
security:
- openId:
- sim-swap:subscriptions:delete
- sim-swap-subscriptions:delete

Choose a reason for hiding this comment

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

sim-swap-subscriptions:org.camaraproject.sim-swap-subscriptions.v0.swapped:delete

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hummm - I dont think so regarding the template yaml for the DELETE operation which is on the subscription itself and not the event.

@@ -239,33 +262,33 @@ paths:
$ref: "#/components/responses/Generic503"
delete:
tags:
- Sim swap notification subscription
- Sim Swap Notification Subscription
summary: 'Delete a sim swap event subscription'
operationId: deleteSubscription
description: delete a given event subscription.

Choose a reason for hiding this comment

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

two whitespaces between a given

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated the tag

Comment on lines 369 to 377
types:
description: |
Camara Event types eligible for subscription:
- org.camaraproject.sim-swap-subscriptions.v0.swapped: receive a notification when a sim swap is performed on the line.
type: array
example:
- "org.camaraproject.sim-swap-subscriptions.v0.swapped"
items:
type: string

Choose a reason for hiding this comment

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

I recommend adding here like for DeviceLocation and DeviceStatus the minItems and maxItems and set them to 1

        types:
          description: |
            Camara Event types eligible to be delivered by this subscription.
            Note: As of now we enforce to have only event type per subscription.
          type: array
          minItems: 1
          maxItems: 1
          items:
            $ref: "#/components/schemas/SubscriptionEventType"

Also think about using here the enum, even for the single one.
It enforces then to avoid requesting with unsupported event-types 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.

done !

Comment on lines 551 to 559
types:
description: |
Camara Event types eligible for subscription:
- org.camaraproject.sim-swap-subscriptions.v0.swapped: receive a notification when a sim swap is performed on the line.
Note: for the Commonalities meta-release v0.4 we enforce to have only event type per subscription then for following meta-release use of array MUST be decided
at API project level.
type: array
items:
type: string

Choose a reason for hiding this comment

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

The same like for the request.
Extracting the types into an own component and setting the min and maxItems

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done !

…-subscriptions.yaml

Updated following Max review
@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jul 2, 2024

Updating the name of the file to sim-swap-subscriptions.yaml ? At least the plural -subscriptions has to be at the end.

Removing -notifications- would also include updating the whole file to remove Notifications also for, e.g., tags.

You're right - done !

@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jul 2, 2024

@maxl2287 I've considered all your comments.

@bigludo7
Copy link
Collaborator Author

bigludo7 commented Jul 5, 2024

@maxl2287 @gregory1g @fernandopradocabrillo Gentle reminder for this one. As it is opened & discussed for long time are they still pending issue on your side preventing merging?

@maxl2287
Copy link

LGTM thanks @bigludo7 👌🏻

@fernandopradocabrillo fernandopradocabrillo self-requested a review July 15, 2024 08:11
Co-authored-by: Fernando Prado Cabrillo <fernando.pradocabrillo@telefonica.com>
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

@fernandopradocabrillo
Copy link
Collaborator

Thanks for the work on the subscriptios @bigludo7 !
Approved from my side, I don't see anything else. If something comes up we can fix it in the future

@bigludo7 bigludo7 merged commit 5b43bf7 into main Jul 15, 2024
1 check passed
@bigludo7 bigludo7 deleted the sim-swap-subscription branch July 15, 2024 13:22
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.

Align sim-swap notification subscription Yaml with new subscription model
4 participants