-
Notifications
You must be signed in to change notification settings - Fork 434
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
Service Instance Generic Extensions/Actions (Take 2) #670
base: master
Are you sure you want to change the base?
Service Instance Generic Extensions/Actions (Take 2) #670
Conversation
✅ Hey Samze! The commit authors and yourself have already signed the CLA. |
763e056
to
763f8c4
Compare
Why is the path part of the ID? I think the extension ID should be something globally unique to distinguish - let's say - two different backup and restore specifications. Here are a few opinions:
|
|
||
| Response Field | Type | Description | | ||
| --- | --- | --- | | ||
| id* | string | A Uniform Resource Name ([URN](https://tools.ietf.org/html/rfc2141)) that uniquely identifies the extension. It MUST include the namespace identifier(NID) `osbext` and a specific string(NSS) for the extension. For example `urn:osbext:/v1/backup`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be and a NAMESPACE specific string(NSS)
(emphasis mine)? what namespace is this in reference to exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it could be if we think it will makes it more clear.
It's a reference to the URN syntax and the parts it consist of. https://tools.ietf.org/html/rfc2141#section-2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just writing down some concerns from the OSB meeting:
- is this ID intended to be unique PER BROKER, or globally unique among ALL BROKERS when pointing to a specific extension? (i.e. all extensions that point http://example.com/extensions/backup_restore.yaml on ALL brokers are intended to be named the same thing on all brokers?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two main reasons for an identifier:
The first is to support the use-case of the community coming up with a standard extensions and perhaps writing platform specific tooling for these extensions. Brokers may then want to opt-in to that already defined extension.
Then we have a separate requirement that a broker itself needs to be able to namespace extensions that it provides, say a broker wants to provide two backup and restore options and the openapi documents have colliding paths. We can use the urn as part of the broker provided path to trigger the extension.
We were hoping that having all extensions provide a globally unique urn would solve both of these problems, so I imagined that the ID (URN) was globally unique. I think perhaps our example here is misleading.
As for the structure of the URN this is something I'm not too sure about. I imagine the domain should be in there e.g. urn:osbext:pivotal.io/v1/mysqlbackups
or urn:osbext:openservicebrokerapi.org/v1/community-back
. Open to ideas around what this should look like and if URNs are the right thing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think the recommendation should be something like urn:osbext:<domain>/<some string>
. But whatever we do, all the examples in the spec should follow the recommended pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed all examples to follow the pattern: urn:osbext:some-domain:some-version
Two outstanding things for this PR:
|
I would expect the extension ID to be globally unique and not having the extension base path in it.
If the broker also supports another backup extension, it is free to set a different path for that extension. |
The current proposal specifies the extension path implicitly from the openapi urn. |
We discussed this on the call and decided:
I will update the PR. |
763f8c4
to
5cba556
Compare
be39e7c
to
2701590
Compare
This has been updated. |
Some folks from Heroku are playing around with an experiment for this right now. They may leave comments in this PR when they have them. If they have something worthy of presenting they will bring to the group for review. Thanks! |
any update? |
"id": "urn:osbext:custom-extension", | ||
"path": "/broker-extension-path", | ||
"description": "Allows backing up of Service Instance data.", | ||
"openapi_url": "/extensions/custom-extension.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have couple of questions:
- The
openapi_uri
is this relative to something or absolute to the broker when hostname is not provided? - For APIs that have relatively small OAS could there be an option to inline it in the Extension object, I recall that OAS supports JSON as well as YAML?
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
In the description of
openapi_url
we state...If this is an absolute URI then it MUST have no authentication and be publicly available. If this is a relative URI then it is MUST be hosted on the Service Broker and behind the [Service Broker Authentication](#platform-to-service-broker-authentication).
Is this descriptive enough? -
We could do this. It adds some complication to the spec but may make Broker authors lives easier. Do you think most of your extensions would want to be embedded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Samze for clarifying on the description 👍
I don't have strong feelings against either but do like the optionality. Though, the requirement of having created a service instance to get the extension specs makes me lean further away from the embedded part.
I'm 👍 to go as is. Thanks!
spec.md
Outdated
"extensions": [ | ||
{ | ||
"id": "urn:osbext:/v1/backup-and-restore", | ||
"path": "instance-backup", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path
does not match the format of the example (/broker-extension-path) in that it is missing a leading slash. I think it may be worth calling out explicitly that it must start with a slash if it is going to follow the Path Object spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't actually need a /
, but we should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have kept the slash (and added it where missing) to show that it is a relative path, but I'm not sure we need to make this explicitly required in the spec.
ca176bd
2701590
to
ca176bd
Compare
|
fd32965
to
d55069c
Compare
Could you elaborate on this? |
Co-authored-by: Georgi Lozev <[email protected]>
d55069c
to
0430946
Compare
I may be reviving a necro-thread here, but... I mostly wonder why we're opting to couple extensions to service instances? More to the point: can we generalize this proposal further so that the broker itself can be extended? I'm thinking about additional broker authz/n implementations, for example. This wouldn't mean a loss in functionality from the current proposal either. In theory, a broker could still specify an Thoughts? |
@Samze Can you provide some insights here or hand off to someone else? |
@WalkerGriggs Yeah there are definitely use-cases for both extensions on brokers and on instances. The original idea was to break down the problem into two, start with extensions on instances and then follow up with extensions on the service broker itself. We started on extensions for instances as we had the most practical usecases for that. e.g. backup an instance. @pivotal-marcela-campo yeah happy to chat more about this proposal if someone wants to take over driving this. It really stalled because while we had agreement in the PMC about this approach, neither CF or Service catalog had done any experimentation to validate this approach. |
Why
The specification defines endpoints that allow the lifecycle management of service instances and service bindings. However, a common complaint is that it does not support some of those important “day 2” operations that developers might want, e.g backup and restore. Also that it does not allow service specific operations, e.g. MySQL set leader. To accomplish this Service Brokers authors have the option to either go off-spec or to misuse the spec (e.g.
cf update-service -p ‘{“trigger-backup”: true}’
).The specification needs an extension mechanism to allow authors to define new endpoints.
There was a previous PR attempt to provide this functionality through “generic extensions” which was opened in 26 Jan 2018. This PR proved complex to implement in part extensions could be hosted anywhere and it allowed any authentication via OpenAPI security schemas.
What
This is our first attempt to revive generic extensions!
This PR is similar to the previous PR in that:
It differs in that:
In order to not limit platform implementations we have not provided guidance on HOW the extension is triggered. Since the endpoint is hosted by the broker it is likely that platform makes a request to trigger the extension on the user’s behalf. This is the same as how all endpoints are called today from known platforms.
Open questions:
Notes
This PR came from this doc.
Sam & @georgi-lozev
(If this is unmerged in 2025, please close)
Closes #114