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

feat(core-api): decouple web service install & registration #771

Closed
petermetz opened this issue Apr 7, 2021 · 0 comments · Fixed by #772
Closed

feat(core-api): decouple web service install & registration #771

petermetz opened this issue Apr 7, 2021 · 0 comments · Fixed by #772
Assignees
Labels
API_Server Core_API Changes related to the Core API Package duplicate This issue or pull request already exists enhancement New feature or request Significant_Change Applying this label triggers the more stringent review of the maintainers and the 2+1 PR rule.

Comments

@petermetz
Copy link
Contributor

Description

As a contributor to the API server I want to have the option to retrieve the web service endpoint instances prior to registering them onto ExpressJS so that I can implement custom behavior/features in the API server that depend on being able to hook into the Express application object first (e.g. before the endpoints hook themselves up at registration time).

This came up during the development of the authorization MVP which needs exactly this to be able to handle endpoints that want to declare themselves non-secure (e.g. accessible anonymously over the internet)

Acceptance Criteria

  1. The install web services method on the core-api interface for web service plugins is split into two
  2. First method just instantiates the endpoints (or returns a cache of them if already called before).
  3. Second one just retrieves the list of endpoint instances and then calls their registration hook.

cc: @takeutak @sfuji822 @hartm @jonathan-m-hamilton @AzaharaC @jordigiam @kikoncuo @jagpreetsinghsasan

@petermetz petermetz added API_Server Core_API Changes related to the Core API Package duplicate This issue or pull request already exists enhancement New feature or request Significant_Change Applying this label triggers the more stringent review of the maintainers and the 2+1 PR rule. labels Apr 7, 2021
@petermetz petermetz self-assigned this Apr 7, 2021
petermetz added a commit to petermetz/cacti that referenced this issue Apr 7, 2021
…er-cacti#771

Primary change:
==============

Divide the endpoint installation method into two smaller
ones where the first one only instantiates the endpoints
and the other one "registers" them as-in it hooks the
endpoint up onto the ExpressJS web app object so that
it will actually be responded to as HTTP requests come
in.

Why though?
We'll need this for the authorization MVP which will
need to be able to introspect the endpoints **prior**
to them getting registered so that it can determine
authz specific parameters like "is this endpoint
secured or non-secure?" or what scopes are necessary
for this endpoint? Etc.

Additional changes:
==================

Everything else that was needed to make the project
compile again and the tests passnig (which is a lot
because this is a very central, heavily used
interface that we just modified).

Fixes hyperledger-cacti#771

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
kikoncuo pushed a commit that referenced this issue Apr 8, 2021
Primary change:
==============

Divide the endpoint installation method into two smaller
ones where the first one only instantiates the endpoints
and the other one "registers" them as-in it hooks the
endpoint up onto the ExpressJS web app object so that
it will actually be responded to as HTTP requests come
in.

Why though?
We'll need this for the authorization MVP which will
need to be able to introspect the endpoints **prior**
to them getting registered so that it can determine
authz specific parameters like "is this endpoint
secured or non-secure?" or what scopes are necessary
for this endpoint? Etc.

Additional changes:
==================

Everything else that was needed to make the project
compile again and the tests passnig (which is a lot
because this is a very central, heavily used
interface that we just modified).

Fixes #771

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server Core_API Changes related to the Core API Package duplicate This issue or pull request already exists enhancement New feature or request Significant_Change Applying this label triggers the more stringent review of the maintainers and the 2+1 PR rule.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant