Improve plugin interface
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with engine/adaptation.go, engine/builtin.go, and the daemon's main function to trace plugin creation through engine.New, wrapBuiltins, and newInternalRuntime. Read the runtime, engine.Plugin, and plugin.Resolver interfaces and map their dependencies on secrets.Resolver. Done means the design supports plugin types beyond resolvers without coupling the runtime to secrets.Resolver.
Written by the indexing model from the issue text.
Description
Plugins in the secrets engine were built and tailored around the concept of a Resolver interface which has a singular function to retrieve a secret from a provider based on a pattern.
A request might look as follows:
POST http://localhost/resolver.v1.ResolverService/GetSecret -H "Content-Type: application/json" -d '{"pattern": "foo"}'
-> http.Handler
-> protobuf handler
-> `engine.regResolver`
-> `engine.regResolver.GetSecrets()`
-> list all registered providers from `engine.regResolver.registry.GetAll()`
-> `engine.runtime.GetSecrets()`
-> resolver service
-> resolver.GetSecret
-> builtin plugin GetSecret
As shown above, this is a high-level call trace for a built-in plugin. We implement the secrets.Resolver interface in multiple places instead of just for a specific plugin type. We tightly coupled the handler endpoint with the underlying plugin.
A built-in plugin gets defined inside the engine/builtins/<plugin> directory, where they implement the engine.Plugin interface.
https://github.com/docker/secrets-engine/blob/main/engine/adaptation.go#L42-L46
Plugins are created individually inside the daemon func main and passed along to the engine.New function. Here they are eventually managed the wrapBuiltins function.
https://github.com/docker/secrets-engine/blob/main/engine/builtin.go#L114-L122
This translates into a call to newInternalRuntime which accepts the engine.Plugin interface.
https://github.com/docker/secrets-engine/blob/main/engine/builtin.go#L22
The engine.Plugin interface is tightly coupled with the plugin.Resolver interface which is an alias of secrets.Resolver.
This makes it difficult to create a plugin that is not a resolver. Creating plugins that could by of another plugin type would mean adding a new internalRuntime type which implements the runtime interface. The runtime interface also depends upon the secrets.Resolver interface. Which means we would need to simplify the runtime interface and remove the hard dependency upon secrets.Resolver. A more general resolver service is needed to instead of just specifying GetSecrets it needs to be dynamic, based upon the underlying type (i.e. it cannot just accept a secrets.Resolver type).
- Dominant language
- Go
- Stars
- 91
- Forks
- 16
- Avg merge
- 9h 3m
- Merged PRs (30d)
- 24
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker/secrets-engine
-
Linux keychain dials a new D-Bus connection per operation, defeating per-entry access confirmation Open
Difficulty 5/5 Over a week Newbie friendliness 42/100
docker/secrets-engine#648 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
docker/secrets-engine#584 · 1 comment · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
docker/secrets-engine#551 · 2 comments · 3 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
docker/secrets-engine#534 · 15 comments · 4 reactions ·
-
Dynamic Scopes Open
docker/secrets-engine#393 · 1 assignee ·
All issues in docker/secrets-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·