Open shilpa-padgaonkar opened 4 months ago
Whatever is decided we need to remember that the APIs need to support federation and are interoperable. If a parameter is optional then it needs to be supported by EVERYONE.
Thanks @shilpa-padgaonkar This is an excellent consolidation.
Yes now let's have specific issue to discuss each topic and get feedback from our community.
As said during the meeting, in the issue 6 we can mention https://github.com/camaraproject/Commonalities/issues/140 issue as we have already there some comments.
Thanks !
Ludovic
Problem description As discussed here - https://github.com/camaraproject/Commonalities/issues/140#issuecomment-1946047374, I am creating a consolidated issue for the current (explicit) subscription topic. I have broken this topic already into smaller (possible) issues and can create separate issues if we agree to do so. This issue is to to give an overview and please feel free to add comments to extend the scope if needed:
Lifecycle management of subscriptions using common subscriptions.yaml file (issue 1)
Do we need API subproject(domain) specific distinct ways of creating, updating, deleting and retrieving subscriptions? Designing the subscription lifecycle management individually in every API sub-project would lead to the subprojects reinventing the same wheel of subscription lifecycle management each time. They should instead be able to focus on domain specific events. We also need a consistent way for event consumers to subscribe to events across domains.
The subscription lifecycle management related events (SUBSCRIPTION_REQUESTED, SUBSCRIPTION_CREATED, SUBSCRIPTION_UPDATED, SUBSCRIPTION_DELETED, SUBSCRIPTION_ENDED) can also be handled in a common way. Another big change would be that domain specific information cannot be added to subscriptionDetail as is probably done today.
This issue was raised earlier in Commonalities and we decided to park (point4) for later at that time https://github.com/camaraproject/Commonalities/issues/44#issuecomment-1715855946
If we would agree that we need a common way of handling subscription life cycle management, there could be the following 2 options:
One subscription for multiple event types (issue 2)
Camara could define a standard way for subscription managers to allow event consumers to subscribe to multiple event types using subscription/s, instead of making the event consumer create a new subscription for every single event type.
The "types" array in CloudEvents subscription schema can allow a consumer to specify the CloudEvent types eligible to be delivered by the subscription.
This decision also needs to consider the scope issue listed below as (issue4).
**Filters** allow for subscriptions to specify that only a subset of events are to be delivered based on a set of criteria and can be used to request precise types amongst other things. Do we want to include filters for our subscriptions and at some point support advanced filter dialects **(issue 3)**
Scopes (issue 4)
For APIs, the ICM and commonalities WG has clear requirements in terms of defining scopes and managing authorization and authentication to ensure that we have implemented privacy by design thinking.
Currently, we use the same pattern for scopes as defined in API guidelines also for explicit subscriptions. This (might) work if we have a 1-1 relation between subscription and event type.
For e.g. geofencing:subscriptions:write
But if we move to the model where we support multiple event types delivery under a single subscription, it would get tricky. This pattern won't work anymore as the scopes need to reflect subscriptions for every event-type rather than the api-name. What if we have a different scope naming format for explicit subscriptions which would include event-type-short-name instead of api-name? More feedback on this is welcome.Consent (issue 5)
How would opt-out by an end-user at a later point in time (after the subscription was created) impact the subscription lifecycle management? Should we document something in this regard in our guidelines?
Common Configurations for event transmissions (issue 6)
Currently in Camara we use the following config settings:
- subscriptionExpireTime
- initialEvent (currently requested in an issue)
Some of these configs could be needed by all subprojects and some might only be useful for certain subprojects. Here the cloudevent subscription config field which allows key/value pairs can be useful.Other points (issue 7 and issue 8)
Possible evolution
If we agree that (any) issue/s listed above is worth discussing, we could split the issues and decide on an aligned a way forward.
Alternative solution
Additional context
https://github.com/cloudevents/spec/blob/main/subscriptions/spec.md
Here are some (abstract) examples: