From 33cd3dc31f2235ab08ae20d4acd013abbc8b10c5 Mon Sep 17 00:00:00 2001 From: Mayuresh Nirhali Date: Fri, 12 Dec 2025 13:06:11 +0530 Subject: [PATCH] adding missing file for transport wrapper --- pkg/plugin/definition/transport.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pkg/plugin/definition/transport.go diff --git a/pkg/plugin/definition/transport.go b/pkg/plugin/definition/transport.go new file mode 100644 index 0000000..370c65e --- /dev/null +++ b/pkg/plugin/definition/transport.go @@ -0,0 +1,18 @@ +package definition + +import ( + "context" + "net/http" +) + +// TransportWrapper is a plugin that wraps an http.RoundTripper, +// allowing modification of outbound requests (like adding auth). +type TransportWrapper interface { + // Wrap takes a base transport and returns a new transport that wraps it. + Wrap(base http.RoundTripper) http.RoundTripper +} + +// TransportWrapperProvider defines the factory for a TransportWrapper. +type TransportWrapperProvider interface { + New(ctx context.Context, config map[string]any) (TransportWrapper, func(), error) +}