feature/plugins
→ develop
: Plugin Support (WIP)
#1150
+1,136
−285
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.
⚙️ Overview
This PR adds initial support for Plugins using the
go-plugin
package from HashiCorp.In this setup, the Plugin handles all user authentication, with the Server having no "knowledge" or record of user credentials/tokens (e.g.
example-users.csv
).🔄 Sequence Diagram
⚡ Quick Start
1. Start the Server
2. Send Requests
In another terminal, send the request using of the examples below —
Required Inputs ⚙️
Authorization: Bearer Alyssa P. Hacker
@example-tasks/hello-world.json
Example Users ⚙️
All "Authorized" users may be found in the "User Database" —
example-users.csv
:Here the use of a simple text file to contain users is to show how a plugin can be written and integrated into Funnel — real world use cases might involve more complex mechanisms for tracking users (e.g OAuth)...
Example: Authorized User
Here we send a request to authenticate a user named 'Alyssa P. Hacker' who is an
Authorized
user (i.e. found in the "User Database" —example-users.csv
):Example: Unauthorized User
Here's an example of attempting to authenticate a user named 'Foo', representing an
Unauthorized
user:FAQ 🕵️
Yes, plugins will modify the local worker configuration the local worker used during the task's duration. This information is not stored globally or shared between different tasks or workflows.
Yes — the entire TES task is passed from the Worker to the plugin. This allows the plugin to authorize users based on task information (like tags).
Yes, the Worker and Executor support both AWS S3 endpoints as well as custom S3 endpoints such as MinIO, Ceph, etc.
Yes, the plugins will have access to the Worker config and all values in it.
Yes, the plugin supports passing any arbitrary data such as JWT tokens.
🚧 Next Steps
📚 Additional Resources