- Invoke optional AfterPersistentPreRun after root PersistentPreRunE setup so overlays can wire non-MCP clients (e.g. A2A gateway). - Add pkg/runtimetoken.ResolveAccessToken mirroring MCP auth resolution. - Export MCP identity headers via pkg/cli for auxiliary HTTP transports. - Fix staticcheck: SA1012 nil-context test guard, ST1005 error string in verify. Made-with: Cursor
22 lines
888 B
Go
22 lines
888 B
Go
// Copyright 2026 Alibaba Group
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package app
|
|
|
|
// MCPIdentityHeaders returns the same header map used for MCP HTTP requests
|
|
// (agent identity, env trace headers, edition MergeHeaders). Intended for
|
|
// non-MCP transports such as the A2A gateway client.
|
|
func MCPIdentityHeaders() map[string]string {
|
|
return resolveIdentityHeaders()
|
|
}
|