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

Plugin Support #662

Open
malud opened this issue Jan 20, 2023 · 0 comments · May be fixed by #645
Open

Plugin Support #662

malud opened this issue Jan 20, 2023 · 0 comments · May be fixed by #645
Assignees
Labels
enhancement New feature or request plugin proposal
Milestone

Comments

@malud
Copy link
Collaborator

malud commented Jan 20, 2023

Couper should be easy to use but sometimes there may be more complex requirements from the surrounding architecture or a contributor may add a specific feature without the requirement to know the whole Couper source code. A subset of the plugin interface could be enough.

Technically we will make use of the Go Plugin functionality which enables Couper to load .so files on the fly while providing the path(es) as cli argument. This won't be supported on Windows systems but there would always a build from source fallback for such cases. The plugin must be build with same symbols as the Couper version which loads the plugin. Means same go version and debug -vs- non-debug build.

Mountpoints

Couper must have some code entrypoints to call(back) the plugin implementation, lets call them mountpoint.

  • load and schema definition: register the hcl schema to extend the existing Couper hcl configuration
  • construct and register: with parsed config values of given schema
  • define the plugin type: handle access_control or being part of an endpoint or handling other connection types for a backend then http
    • endpoint: the plugin component will still be part of our sequence feature, so it would be valid that a http request will trigger a sequence with a normal request block and the "plugin" block can access the resulting variable and produce also variables which could be used for a response therefore the result type must be a cty.Object

That being said we have to "open" some internal packages to make a plugin developers life easier.

@malud malud added enhancement New feature or request proposal labels Jan 20, 2023
@malud malud linked a pull request Jan 20, 2023 that will close this issue
@malud malud added this to the 1.12 milestone Jan 20, 2023
@malud malud self-assigned this Jan 25, 2023
@malud malud added the plugin label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant