MCPcopy
hub / github.com/kagent-dev/kagent / Before

Method Before

go/adk/pkg/tools/remote_a2a_tool.go:114–130  ·  view source on GitHub ↗
(ctx context.Context, req *a2aclient.Request)

Source from the content-addressed store, hash-verified

112}
113
114func (a *authzForwardingInterceptor) Before(ctx context.Context, req *a2aclient.Request) (context.Context, error) {
115 callCtx, ok := a2asrv.CallContextFrom(ctx)
116 if !ok {
117 return ctx, nil
118 }
119 meta := callCtx.RequestMeta()
120 if meta == nil {
121 return ctx, nil
122 }
123 if len(req.Meta.Get(constants.AuthorizationHeader)) > 0 {
124 return ctx, nil
125 }
126 if vals, ok := meta.Get(constants.AuthorizationHeader); ok && len(vals) > 0 && vals[0] != "" {
127 req.Meta.Append(constants.AuthorizationHeader, vals[0])
128 }
129 return ctx, nil
130}
131
132// remoteA2AInput is the typed argument for the remote A2A function tool.
133type remoteA2AInput struct {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected