| 112 | } |
| 113 | |
| 114 | func (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. |
| 133 | type remoteA2AInput struct { |