OpenAPI convert client to application #3
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In an effort to standardize the terminology and abstraction layer of the interface we're trying to build, it makes sense to transition away from emitting the
client
concept in the API and instead use theapplication
concept. Here is an overview of the new API:As you can see, we've moved the creation of an application to
applications/oauth2
. By restricting the creation of applications to be a specific type, we get several benefits:Take, for instance, an alternative approach that I investigated:
This API allows hooks for the creation of the application, and then the subsequent registering of the application as an OAuth2 client. This separates the application creation process from the registering of the application as a particular kind of client. This has several drawbacks:
Overall, we want to avoid having to have state in our application. The purpose of our SPI is to provide simply a bridge between the Portal Server's source of truth and and backing storage for credentials. This layer should be as minimal as possible, and this API accomplishes that.
Keep in mind also that this means for a single logical application in Portal, we will have to create independent applications of different types if, say, we eventually support a
applications/api-keys
endpoint. I think this tradeoff is well worth it for the implementation and cognitive complexity savings this approach allows for.