diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 9b84745b19..c850ce62b4 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1384,8 +1384,8 @@ "git+https://github.com/hyperium/h3?rev=e07e69412876f7e26f026bd75a48b2704d8c8283#e07e69412876f7e26f026bd75a48b2704d8c8283_h3": "{\"dependencies\":[{\"name\":\"bytes\",\"req\":\"1\"},{\"name\":\"fastrand\",\"req\":\"2.0.1\"},{\"default_features\":false,\"features\":[\"io\"],\"name\":\"futures-util\",\"optional\":false,\"req\":\"0.3\"},{\"name\":\"http\",\"req\":\"1\"},{\"default_features\":false,\"features\":[],\"name\":\"pin-project-lite\",\"optional\":false,\"req\":\"0.2\"},{\"default_features\":true,\"features\":[\"sync\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"tracing\",\"optional\":true,\"req\":\"0.1.40\"}],\"features\":{\"i-implement-a-third-party-backend-and-opt-into-breaking-changes\":[],\"tracing\":[\"dep:tracing\"]},\"strip_prefix\":\"h3\"}", "git+https://github.com/hyperium/h3?rev=e07e69412876f7e26f026bd75a48b2704d8c8283#e07e69412876f7e26f026bd75a48b2704d8c8283_h3-quinn": "{\"dependencies\":[{\"name\":\"bytes\",\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"futures\",\"optional\":false,\"req\":\"0.3.28\"},{\"default_features\":true,\"features\":[],\"name\":\"h3\",\"optional\":false,\"req\":\"0.0.8\"},{\"default_features\":true,\"features\":[],\"name\":\"h3-datagram\",\"optional\":true,\"req\":\"0.0.2\"},{\"default_features\":false,\"features\":[\"futures-io\"],\"name\":\"quinn\",\"optional\":false,\"req\":\"0.11.7\"},{\"default_features\":false,\"features\":[\"io-util\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-util\",\"optional\":false,\"req\":\"0.7.9\"},{\"default_features\":true,\"features\":[],\"name\":\"tracing\",\"optional\":true,\"req\":\"0.1.40\"}],\"features\":{\"datagram\":[\"dep:h3-datagram\"],\"tracing\":[\"dep:tracing\"]},\"strip_prefix\":\"h3-quinn\"}", "git+https://github.com/microsoft/mxc?rev=b21120168d70befe12356411423266bfef168446#b21120168d70befe12356411423266bfef168446_mxc-sdk": "{\"dependencies\":[{\"name\":\"anyhow\",\"req\":\"1\"},{\"name\":\"base64\",\"req\":\"0.22\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":false,\"req\":\"0.4\"},{\"name\":\"cidr\",\"req\":\"0.3.2\"},{\"name\":\"flatbuffers\",\"req\":\"25\"},{\"name\":\"getrandom\",\"req\":\"0.2\"},{\"name\":\"libc\",\"req\":\"0.2\"},{\"default_features\":true,\"features\":[],\"name\":\"libloading\",\"optional\":true,\"req\":\"0.8\"},{\"default_features\":true,\"features\":[\"fs\",\"mount\",\"sched\",\"signal\",\"net\",\"process\",\"user\",\"term\"],\"name\":\"nix\",\"optional\":false,\"req\":\"0.29\"},{\"name\":\"same-file\",\"req\":\"1\"},{\"name\":\"schemars\",\"optional\":true,\"req\":\"0.8\"},{\"default_features\":true,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":false,\"req\":\"1\"},{\"default_features\":true,\"features\":[\"raw_value\"],\"name\":\"serde_json\",\"optional\":false,\"req\":\"1\"},{\"name\":\"serde_path_to_error\",\"req\":\"0.1\"},{\"name\":\"sha2\",\"req\":\"0.11\"},{\"default_features\":true,\"features\":[],\"name\":\"tar\",\"optional\":true,\"req\":\"0.4\"},{\"name\":\"tempfile\",\"req\":\"3\"},{\"name\":\"thiserror\",\"req\":\"2\"},{\"default_features\":true,\"features\":[\"full\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1\"},{\"name\":\"unicode-general-category\",\"req\":\"1\"},{\"name\":\"url\",\"req\":\"2\"},{\"default_features\":true,\"features\":[\"v4\"],\"name\":\"uuid\",\"optional\":false,\"req\":\"1\"},{\"name\":\"widestring\",\"req\":\"1\"},{\"kind\":\"build\",\"name\":\"semver\",\"req\":\"1\"},{\"default_features\":true,\"features\":[\"derive\"],\"kind\":\"build\",\"name\":\"serde\",\"optional\":false,\"req\":\"1\"},{\"default_features\":true,\"features\":[\"raw_value\"],\"kind\":\"build\",\"name\":\"serde_json\",\"optional\":false,\"req\":\"1\"},{\"kind\":\"build\",\"name\":\"sha2\",\"req\":\"0.11\"},{\"default_features\":true,\"features\":[\"v4\"],\"kind\":\"build\",\"name\":\"uuid\",\"optional\":false,\"req\":\"1\"},{\"default_features\":false,\"features\":[\"deflate\"],\"kind\":\"build\",\"name\":\"zip\",\"optional\":true,\"req\":\"2\"},{\"default_features\":true,\"features\":[],\"name\":\"flate2\",\"optional\":true,\"req\":\"1\",\"target\":\"cfg(target_arch = \\\"x86_64\\\")\"},{\"default_features\":false,\"features\":[],\"name\":\"hyperlight-unikraft\",\"optional\":true,\"req\":\"=0.17.0\",\"target\":\"cfg(target_arch = \\\"x86_64\\\")\"},{\"default_features\":true,\"features\":[],\"name\":\"ureq\",\"optional\":true,\"req\":\"3\",\"target\":\"cfg(target_arch = \\\"x86_64\\\")\"},{\"name\":\"tracelogging\",\"req\":\"1.2\",\"target\":\"cfg(target_os = \\\"windows\\\")\"},{\"default_features\":true,\"features\":[\"Foundation\",\"UI\",\"Win32_Foundation\",\"Win32_Globalization\",\"Win32_NetworkManagement_WindowsFirewall\",\"Win32_Networking_WinSock\",\"Win32_Security\",\"Win32_Security_Authorization\",\"Win32_Security_Credentials\",\"Win32_Security_Cryptography\",\"Win32_Security_Isolation\",\"Win32_Security_WinTrust\",\"Win32_Storage_FileSystem\",\"Win32_System_Com\",\"Win32_System_Console\",\"Win32_System_Diagnostics_Debug\",\"Win32_System_Diagnostics_Etw\",\"Win32_System_Diagnostics_ToolHelp\",\"Win32_System_Environment\",\"Win32_System_EventLog\",\"Win32_System_IO\",\"Win32_System_JobObjects\",\"Win32_System_LibraryLoader\",\"Win32_System_Memory\",\"Win32_System_Ole\",\"Win32_System_Pipes\",\"Win32_System_ProcessStatus\",\"Win32_System_Registry\",\"Win32_System_SystemInformation\",\"Win32_System_SystemServices\",\"Win32_System_Threading\",\"Win32_System_Time\",\"Win32_System_Variant\",\"Win32_System_WindowsProgramming\",\"Win32_UI_Shell\"],\"name\":\"windows\",\"optional\":false,\"req\":\"0.62\",\"target\":\"cfg(target_os = \\\"windows\\\")\"},{\"default_features\":true,\"features\":[],\"name\":\"windows-collections\",\"optional\":true,\"req\":\"0.3\",\"target\":\"cfg(target_os = \\\"windows\\\")\"},{\"name\":\"windows-core\",\"req\":\"0.62\",\"target\":\"cfg(target_os = \\\"windows\\\")\"},{\"default_features\":true,\"features\":[],\"name\":\"windows-future\",\"optional\":true,\"req\":\"0.3\",\"target\":\"cfg(target_os = \\\"windows\\\")\"},{\"name\":\"winreg\",\"req\":\"0.55\",\"target\":\"cfg(target_os = \\\"windows\\\")\"}],\"features\":{\"default\":[],\"force-tier-testing\":[],\"hyperlight\":[\"dep:hyperlight-unikraft\",\"dep:ureq\",\"dep:flate2\",\"dep:tar\"],\"isolation_session\":[\"dep:windows-collections\",\"dep:windows-future\"],\"link-wslcsdk\":[\"dep:zip\"],\"microvm\":[],\"schema-gen\":[\"dep:schemars\"],\"test-support\":[],\"tier2_bfs\":[],\"wslc\":[\"link-wslcsdk\",\"dep:libloading\",\"dep:tar\"]},\"strip_prefix\":\"mxc-sdk\"}", - "git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471_rmcp": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"async-trait\",\"optional\":true,\"req\":\"0.1.89\"},{\"default_features\":true,\"features\":[],\"name\":\"base64\",\"optional\":true,\"req\":\"0.23\"},{\"default_features\":true,\"features\":[],\"name\":\"bytes\",\"optional\":true,\"req\":\"1\"},{\"name\":\"futures\",\"req\":\"0.3\"},{\"default_features\":true,\"features\":[],\"name\":\"hmac\",\"optional\":true,\"req\":\"0.13\"},{\"default_features\":true,\"features\":[],\"name\":\"http\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"http-body\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"http-body-util\",\"optional\":true,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[\"client\",\"http1\"],\"name\":\"hyper\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[\"tokio\"],\"name\":\"hyper-util\",\"optional\":true,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[\"serde\"],\"name\":\"indexmap\",\"optional\":false,\"req\":\"2\"},{\"default_features\":true,\"features\":[\"aws_lc_rs\"],\"name\":\"jsonwebtoken\",\"optional\":true,\"req\":\"11\"},{\"default_features\":false,\"features\":[],\"name\":\"oauth2\",\"optional\":true,\"req\":\"5.0\"},{\"default_features\":true,\"features\":[],\"name\":\"pastey\",\"optional\":true,\"req\":\"0.2.0\"},{\"name\":\"pin-project-lite\",\"req\":\"0.2\"},{\"default_features\":true,\"features\":[\"tokio1\"],\"name\":\"process-wrap\",\"optional\":true,\"req\":\"10.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rand\",\"optional\":true,\"req\":\"0.10\"},{\"default_features\":false,\"features\":[\"json\",\"stream\"],\"name\":\"reqwest\",\"optional\":true,\"req\":\"0.13.2\"},{\"default_features\":true,\"features\":[],\"name\":\"rmcp-macros\",\"optional\":true,\"req\":\"3.5.1\"},{\"default_features\":true,\"features\":[\"chrono04\"],\"name\":\"schemars\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"derive\",\"rc\"],\"name\":\"serde\",\"optional\":false,\"req\":\"1.0\"},{\"name\":\"serde_json\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"sha2\",\"optional\":true,\"req\":\"0.11\"},{\"default_features\":true,\"features\":[],\"name\":\"sse-stream\",\"optional\":true,\"req\":\"0.2.4\"},{\"name\":\"thiserror\",\"req\":\"2\"},{\"default_features\":true,\"features\":[\"sync\",\"macros\",\"rt\",\"time\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-stream\",\"optional\":true,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-util\",\"optional\":false,\"req\":\"0.7\"},{\"default_features\":true,\"features\":[],\"name\":\"tower-service\",\"optional\":true,\"req\":\"0.3\"},{\"default_features\":true,\"features\":[],\"name\":\"tracing\",\"optional\":false,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[],\"name\":\"url\",\"optional\":true,\"req\":\"2.4\"},{\"default_features\":true,\"features\":[\"v4\"],\"name\":\"uuid\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"which\",\"optional\":true,\"req\":\"8\"},{\"default_features\":true,\"features\":[],\"name\":\"zeroize\",\"optional\":true,\"req\":\"1\"},{\"default_features\":false,\"features\":[\"serde\",\"clock\",\"std\",\"oldtime\"],\"name\":\"chrono\",\"optional\":false,\"req\":\"0.4.38\",\"target\":\"cfg(all(target_family = \\\"wasm\\\", target_os = \\\"unknown\\\"))\"},{\"default_features\":false,\"features\":[\"serde\",\"now\"],\"name\":\"chrono\",\"optional\":false,\"req\":\"0.4.38\",\"target\":\"cfg(not(all(target_family = \\\"wasm\\\", target_os = \\\"unknown\\\")))\"},{\"name\":\"libc\",\"req\":\"0.2\",\"target\":\"cfg(target_os = \\\"linux\\\")\"}],\"features\":{\"__reqwest\":[\"dep:reqwest\"],\"auth\":[\"dep:async-trait\",\"dep:oauth2\",\"__reqwest\",\"dep:url\"],\"auth-client-credentials-jwt\":[\"auth\",\"dep:jsonwebtoken\",\"uuid\"],\"auth-enterprise-managed\":[\"auth\",\"base64\"],\"client\":[\"dep:tokio-stream\"],\"client-side-sse\":[\"dep:sse-stream\",\"dep:http\",\"dep:bytes\",\"base64\"],\"default\":[\"base64\",\"macros\",\"server\"],\"elicitation\":[\"dep:url\"],\"local\":[\"rmcp-macros?/local\"],\"macros\":[\"dep:rmcp-macros\",\"dep:pastey\"],\"request-state\":[\"dep:hmac\",\"dep:sha2\",\"dep:zeroize\",\"base64\"],\"reqwest\":[\"__reqwest\",\"reqwest?/rustls\"],\"reqwest-native-tls\":[\"__reqwest\",\"reqwest?/native-tls\"],\"reqwest-tls-no-provider\":[\"__reqwest\",\"reqwest?/rustls-no-provider\"],\"schemars\":[\"dep:schemars\"],\"server\":[\"transport-async-rw\",\"schemars\",\"dep:pastey\",\"uuid\"],\"server-side-http\":[\"uuid\",\"dep:rand\",\"dep:tokio-stream\",\"dep:http\",\"dep:http-body\",\"dep:http-body-util\",\"dep:bytes\",\"dep:sse-stream\",\"tower\",\"base64\"],\"tower\":[\"dep:tower-service\"],\"transport-async-rw\":[\"tokio/io-util\",\"tokio-util/codec\"],\"transport-child-process\":[\"transport-async-rw\",\"tokio/process\",\"dep:process-wrap\"],\"transport-io\":[\"transport-async-rw\",\"tokio/io-std\",\"tokio/net\"],\"transport-streamable-http-client\":[\"client-side-sse\",\"transport-worker\"],\"transport-streamable-http-client-reqwest\":[\"transport-streamable-http-client\",\"__reqwest\"],\"transport-streamable-http-client-unix-socket\":[\"transport-streamable-http-client\",\"dep:hyper\",\"dep:hyper-util\",\"dep:http-body-util\",\"dep:http\",\"dep:bytes\",\"tokio/net\"],\"transport-streamable-http-server\":[\"transport-streamable-http-server-session\",\"server-side-http\",\"transport-worker\"],\"transport-streamable-http-server-session\":[\"transport-async-rw\",\"dep:async-trait\",\"dep:tokio-stream\"],\"transport-worker\":[\"dep:tokio-stream\"],\"which-command\":[\"transport-child-process\",\"dep:which\"]},\"strip_prefix\":\"./crates/rmcp\"}", - "git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471_rmcp-macros": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"darling\",\"optional\":false,\"req\":\"0.24\"},{\"name\":\"proc-macro2\",\"req\":\"1\"},{\"name\":\"quote\",\"req\":\"1\"},{\"name\":\"serde_json\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"full\"],\"name\":\"syn\",\"optional\":false,\"req\":\"3\"}],\"features\":{\"local\":[]},\"strip_prefix\":\"./crates/rmcp-macros\"}", + "git+https://github.com/modelcontextprotocol/rust-sdk?rev=b11a40d889e022087d7f2b8cd23aa28e19ceaf5b#b11a40d889e022087d7f2b8cd23aa28e19ceaf5b_rmcp": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"async-trait\",\"optional\":true,\"req\":\"0.1.89\"},{\"default_features\":true,\"features\":[],\"name\":\"base64\",\"optional\":true,\"req\":\"0.23\"},{\"default_features\":true,\"features\":[],\"name\":\"bytes\",\"optional\":true,\"req\":\"1\"},{\"name\":\"futures\",\"req\":\"0.3\"},{\"default_features\":true,\"features\":[],\"name\":\"hmac\",\"optional\":true,\"req\":\"0.13\"},{\"default_features\":true,\"features\":[],\"name\":\"http\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"http-body\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"http-body-util\",\"optional\":true,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[\"client\",\"http1\"],\"name\":\"hyper\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[\"tokio\"],\"name\":\"hyper-util\",\"optional\":true,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[\"serde\"],\"name\":\"indexmap\",\"optional\":false,\"req\":\"2\"},{\"default_features\":true,\"features\":[\"aws_lc_rs\"],\"name\":\"jsonwebtoken\",\"optional\":true,\"req\":\"11\"},{\"default_features\":false,\"features\":[],\"name\":\"oauth2\",\"optional\":true,\"req\":\"5.0\"},{\"default_features\":true,\"features\":[],\"name\":\"pastey\",\"optional\":true,\"req\":\"0.2.0\"},{\"name\":\"pin-project-lite\",\"req\":\"0.2\"},{\"default_features\":true,\"features\":[\"tokio1\"],\"name\":\"process-wrap\",\"optional\":true,\"req\":\"10.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rand\",\"optional\":true,\"req\":\"0.10\"},{\"default_features\":false,\"features\":[\"json\",\"stream\"],\"name\":\"reqwest\",\"optional\":true,\"req\":\"0.13.2\"},{\"default_features\":true,\"features\":[],\"name\":\"rmcp-macros\",\"optional\":true,\"req\":\"3.6.0\"},{\"default_features\":true,\"features\":[\"chrono04\"],\"name\":\"schemars\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"derive\",\"rc\"],\"name\":\"serde\",\"optional\":false,\"req\":\"1.0\"},{\"name\":\"serde_json\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"sha2\",\"optional\":true,\"req\":\"0.11\"},{\"default_features\":true,\"features\":[],\"name\":\"sse-stream\",\"optional\":true,\"req\":\"0.2.4\"},{\"name\":\"thiserror\",\"req\":\"2\"},{\"default_features\":true,\"features\":[\"sync\",\"macros\",\"rt\",\"time\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-stream\",\"optional\":true,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-util\",\"optional\":false,\"req\":\"0.7\"},{\"default_features\":true,\"features\":[],\"name\":\"tower-service\",\"optional\":true,\"req\":\"0.3\"},{\"default_features\":true,\"features\":[],\"name\":\"tracing\",\"optional\":false,\"req\":\"0.1\"},{\"default_features\":true,\"features\":[],\"name\":\"url\",\"optional\":true,\"req\":\"2.4\"},{\"default_features\":true,\"features\":[\"v4\"],\"name\":\"uuid\",\"optional\":true,\"req\":\"1\"},{\"default_features\":true,\"features\":[],\"name\":\"which\",\"optional\":true,\"req\":\"8\"},{\"default_features\":true,\"features\":[],\"name\":\"zeroize\",\"optional\":true,\"req\":\"1\"},{\"default_features\":false,\"features\":[\"serde\",\"clock\",\"std\",\"oldtime\"],\"name\":\"chrono\",\"optional\":false,\"req\":\"0.4.38\",\"target\":\"cfg(all(target_family = \\\"wasm\\\", target_os = \\\"unknown\\\"))\"},{\"default_features\":false,\"features\":[\"serde\",\"now\"],\"name\":\"chrono\",\"optional\":false,\"req\":\"0.4.38\",\"target\":\"cfg(not(all(target_family = \\\"wasm\\\", target_os = \\\"unknown\\\")))\"},{\"name\":\"libc\",\"req\":\"0.2\",\"target\":\"cfg(target_os = \\\"linux\\\")\"}],\"features\":{\"__reqwest\":[\"dep:reqwest\"],\"auth\":[\"dep:async-trait\",\"dep:oauth2\",\"__reqwest\",\"dep:url\"],\"auth-client-credentials-jwt\":[\"auth\",\"dep:jsonwebtoken\",\"uuid\"],\"auth-enterprise-managed\":[\"auth\",\"base64\"],\"client\":[\"dep:tokio-stream\"],\"client-side-sse\":[\"dep:sse-stream\",\"dep:http\",\"dep:bytes\",\"base64\"],\"default\":[\"base64\",\"macros\",\"server\"],\"elicitation\":[\"dep:url\"],\"local\":[\"rmcp-macros?/local\"],\"macros\":[\"dep:rmcp-macros\",\"dep:pastey\"],\"request-state\":[\"dep:hmac\",\"dep:sha2\",\"dep:zeroize\",\"base64\"],\"reqwest\":[\"__reqwest\",\"reqwest?/rustls\"],\"reqwest-native-tls\":[\"__reqwest\",\"reqwest?/native-tls\"],\"reqwest-tls-no-provider\":[\"__reqwest\",\"reqwest?/rustls-no-provider\"],\"schemars\":[\"dep:schemars\"],\"server\":[\"transport-async-rw\",\"schemars\",\"dep:pastey\",\"uuid\"],\"server-side-http\":[\"uuid\",\"dep:rand\",\"dep:tokio-stream\",\"dep:http\",\"dep:http-body\",\"dep:http-body-util\",\"dep:bytes\",\"dep:sse-stream\",\"tower\",\"base64\"],\"tower\":[\"dep:tower-service\"],\"transport-async-rw\":[\"tokio/io-util\",\"tokio-util/codec\"],\"transport-child-process\":[\"transport-async-rw\",\"tokio/process\",\"dep:process-wrap\"],\"transport-io\":[\"transport-async-rw\",\"tokio/io-std\",\"tokio/net\"],\"transport-streamable-http-client\":[\"client-side-sse\",\"transport-worker\"],\"transport-streamable-http-client-reqwest\":[\"transport-streamable-http-client\",\"__reqwest\"],\"transport-streamable-http-client-unix-socket\":[\"transport-streamable-http-client\",\"dep:hyper\",\"dep:hyper-util\",\"dep:http-body-util\",\"dep:http\",\"dep:bytes\",\"tokio/net\"],\"transport-streamable-http-server\":[\"transport-streamable-http-server-session\",\"server-side-http\",\"transport-worker\"],\"transport-streamable-http-server-session\":[\"transport-async-rw\",\"dep:async-trait\",\"dep:tokio-stream\"],\"transport-worker\":[\"dep:tokio-stream\"],\"which-command\":[\"transport-child-process\",\"dep:which\"]},\"strip_prefix\":\"./crates/rmcp\"}", + "git+https://github.com/modelcontextprotocol/rust-sdk?rev=b11a40d889e022087d7f2b8cd23aa28e19ceaf5b#b11a40d889e022087d7f2b8cd23aa28e19ceaf5b_rmcp-macros": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"darling\",\"optional\":false,\"req\":\"0.24\"},{\"name\":\"proc-macro2\",\"req\":\"1\"},{\"name\":\"quote\",\"req\":\"1\"},{\"name\":\"serde_json\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"full\"],\"name\":\"syn\",\"optional\":false,\"req\":\"3\"}],\"features\":{\"local\":[]},\"strip_prefix\":\"./crates/rmcp-macros\"}", "git+https://github.com/openai-oss-forks/crossterm?rev=ed1cdab335221515706178d68495bba2aed1924f#ed1cdab335221515706178d68495bba2aed1924f_crossterm": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"base64\",\"optional\":true,\"req\":\"0.23\"},{\"default_features\":true,\"features\":[],\"name\":\"bitflags\",\"optional\":false,\"req\":\"2.9\"},{\"default_features\":true,\"features\":[\"is_variant\"],\"name\":\"derive_more\",\"optional\":true,\"req\":\"2.0.0\"},{\"default_features\":true,\"features\":[],\"name\":\"document-features\",\"optional\":true,\"req\":\"0.2.11\"},{\"default_features\":false,\"features\":[],\"name\":\"futures-core\",\"optional\":true,\"req\":\"0.3.31\"},{\"name\":\"parking_lot\",\"req\":\"0.12.1\"},{\"default_features\":true,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"1.0.103\"},{\"default_features\":true,\"features\":[],\"name\":\"filedescriptor\",\"optional\":true,\"req\":\"0.8\",\"target\":\"cfg(unix)\"},{\"default_features\":false,\"features\":[],\"name\":\"libc\",\"optional\":true,\"req\":\"0.2.168\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[\"os-poll\"],\"name\":\"mio\",\"optional\":true,\"req\":\"1.0.1\",\"target\":\"cfg(unix)\"},{\"default_features\":false,\"features\":[\"std\",\"stdio\",\"termios\"],\"name\":\"rustix\",\"optional\":false,\"req\":\"1\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[],\"name\":\"signal-hook\",\"optional\":true,\"req\":\"0.3.17\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[\"support-v1_0\"],\"name\":\"signal-hook-mio\",\"optional\":true,\"req\":\"0.2.4\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[],\"name\":\"crossterm_winapi\",\"optional\":true,\"req\":\"0.9.1\",\"target\":\"cfg(windows)\"},{\"default_features\":true,\"features\":[\"winuser\",\"winerror\"],\"name\":\"winapi\",\"optional\":true,\"req\":\"0.3.9\",\"target\":\"cfg(windows)\"}],\"features\":{\"bracketed-paste\":[],\"default\":[\"bracketed-paste\",\"derive-more\",\"events\",\"windows\"],\"derive-more\":[\"dep:derive_more\"],\"document-features\":[\"dep:document-features\"],\"event-stream\":[\"dep:futures-core\",\"events\"],\"events\":[\"dep:mio\",\"dep:signal-hook\",\"dep:signal-hook-mio\"],\"osc52\":[\"dep:base64\"],\"serde\":[\"dep:serde\",\"bitflags/serde\"],\"use-dev-tty\":[\"filedescriptor\",\"rustix/process\"],\"windows\":[\"dep:winapi\",\"dep:crossterm_winapi\"]},\"strip_prefix\":\"\"}", "git+https://github.com/openai-oss-forks/rusty_v8.git?rev=90a65f887a0c0f048f3784afbcb320b373c8a2e0#90a65f887a0c0f048f3784afbcb320b373c8a2e0_v8": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"2.5\"},{\"name\":\"paste\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"zoneinfo64\"],\"name\":\"temporal_capi\",\"optional\":false,\"req\":\"0.2.3\"},{\"kind\":\"build\",\"name\":\"bindgen\",\"req\":\"0.72\"},{\"kind\":\"build\",\"name\":\"fslock\",\"req\":\"0.2\"},{\"kind\":\"build\",\"name\":\"gzip-header\",\"req\":\"1.0.0\"},{\"kind\":\"build\",\"name\":\"home\",\"req\":\"0\"},{\"kind\":\"build\",\"name\":\"miniz_oxide\",\"req\":\"0.8.8\"},{\"kind\":\"build\",\"name\":\"which\",\"req\":\"6\"}],\"features\":{\"default\":[\"use_custom_libcxx\"],\"simdutf\":[],\"use_custom_libcxx\":[],\"v8_enable_pointer_compression\":[],\"v8_enable_sandbox\":[\"v8_enable_pointer_compression\"],\"v8_enable_v8_checks\":[]},\"strip_prefix\":\"\"}", "git+https://github.com/openai-oss-forks/tokio-tungstenite?rev=7447c427513cfe685f236e1ac0513c4ea3dd9c0b#7447c427513cfe685f236e1ac0513c4ea3dd9c0b_tokio-tungstenite": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"sink\",\"std\"],\"name\":\"futures-util\",\"optional\":false,\"req\":\"0.3.28\"},{\"name\":\"log\",\"req\":\"0.4.17\"},{\"default_features\":true,\"features\":[],\"name\":\"native-tls-crate\",\"optional\":true,\"package\":\"native-tls\",\"req\":\"0.2.11\"},{\"default_features\":false,\"features\":[],\"name\":\"rustls\",\"optional\":true,\"req\":\"0.23.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"0.8.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":false,\"features\":[\"io-util\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1.0.0\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-native-tls\",\"optional\":true,\"req\":\"0.3.1\"},{\"default_features\":false,\"features\":[],\"name\":\"tokio-rustls\",\"optional\":true,\"req\":\"0.26.0\"},{\"default_features\":false,\"features\":[],\"name\":\"tungstenite\",\"optional\":false},{\"default_features\":true,\"features\":[],\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"0.26.0\"}],\"features\":{\"__rustls-tls\":[\"rustls\",\"rustls-pki-types\",\"tokio-rustls\",\"stream\",\"tungstenite/__rustls-tls\",\"handshake\"],\"connect\":[\"stream\",\"tokio/net\",\"tokio/time\",\"handshake\"],\"default\":[\"connect\",\"handshake\"],\"handshake\":[\"tungstenite/handshake\"],\"native-tls\":[\"native-tls-crate\",\"tokio-native-tls\",\"stream\",\"tungstenite/native-tls\",\"handshake\"],\"native-tls-vendored\":[\"native-tls\",\"native-tls-crate/vendored\",\"tungstenite/native-tls-vendored\"],\"proxy\":[\"tungstenite/proxy\",\"tokio/net\",\"handshake\"],\"rustls-tls-native-roots\":[\"__rustls-tls\",\"rustls-native-certs\"],\"rustls-tls-webpki-roots\":[\"__rustls-tls\",\"webpki-roots\"],\"stream\":[],\"url\":[\"tungstenite/url\"]},\"strip_prefix\":\"\"}", @@ -1398,7 +1398,7 @@ "git_archive_integrity:https://codeload.github.com/helix-editor/nucleo/tar.gz/4253de9faabb4e5c6d81d946a5e35a90f87347ee": "sha256-0WdqwzqCxZA//t5oznPJ2SRmaqihArtkmo+5JqemHOE=", "git_archive_integrity:https://codeload.github.com/hyperium/h3/tar.gz/e07e69412876f7e26f026bd75a48b2704d8c8283": "sha256-O52KnRCEH+J/uGyXoGvs4UEfywrPrcDKhXtjZdTl0po=", "git_archive_integrity:https://codeload.github.com/microsoft/mxc/tar.gz/b21120168d70befe12356411423266bfef168446": "sha256-y1jhNgvGsVfkERZ48U4StdlXS9UIoCzKUUphwvu6+m8=", - "git_archive_integrity:https://codeload.github.com/modelcontextprotocol/rust-sdk/tar.gz/98a54789b80110ad210495c4ad845c89e1980471": "sha256-u1NcSLjm/O48vcV54D6qYiUrp0n/IW7+GZ2DcSLJ/lI=", + "git_archive_integrity:https://codeload.github.com/modelcontextprotocol/rust-sdk/tar.gz/b11a40d889e022087d7f2b8cd23aa28e19ceaf5b": "sha256-XnxwrRom1XXDnqU9ncs0vl6FAGjugZOqqNTMcjIhjF4=", "git_archive_integrity:https://codeload.github.com/openai-oss-forks/crossterm/tar.gz/ed1cdab335221515706178d68495bba2aed1924f": "sha256-NTDNN30IByL2McZWbl7bSESri+j0sYXWvkoru6VZFTE=", "git_archive_integrity:https://codeload.github.com/openai-oss-forks/rusty_v8/tar.gz/90a65f887a0c0f048f3784afbcb320b373c8a2e0": "sha256-sLGI0fHYUavXgzeBiiihXoTxQ7CCzpZpdukgZhdoQ3M=", "git_archive_integrity:https://codeload.github.com/openai-oss-forks/tokio-tungstenite/tar.gz/7447c427513cfe685f236e1ac0513c4ea3dd9c0b": "sha256-RqW7OJVRvLIWfDNmNfxOcxrYW1dy5M6LrBwvXdCqfLw=", diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock index db1a782bd0..077b906662 100644 --- a/codex-rs/Cargo.lock +++ b/codex-rs/Cargo.lock @@ -13566,8 +13566,8 @@ dependencies = [ [[package]] name = "rmcp" -version = "3.5.1" -source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471" +version = "3.6.0" +source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=b11a40d889e022087d7f2b8cd23aa28e19ceaf5b#b11a40d889e022087d7f2b8cd23aa28e19ceaf5b" dependencies = [ "async-trait", "base64 0.23.0", @@ -13602,8 +13602,8 @@ dependencies = [ [[package]] name = "rmcp-macros" -version = "3.5.1" -source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471" +version = "3.6.0" +source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=b11a40d889e022087d7f2b8cd23aa28e19ceaf5b#b11a40d889e022087d7f2b8cd23aa28e19ceaf5b" dependencies = [ "darling 0.24.0", "proc-macro2", diff --git a/codex-rs/Cargo.toml b/codex-rs/Cargo.toml index 4bccad35f3..d426e68d06 100644 --- a/codex-rs/Cargo.toml +++ b/codex-rs/Cargo.toml @@ -477,7 +477,7 @@ regex-automata = { version = "0.4.13", default-features = false, features = ["st regex-lite = "0.1.8" regex-syntax = "0.8.8" reqwest = { version = "0.12", features = ["cookies"] } -rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", rev = "98a54789b80110ad210495c4ad845c89e1980471", version = "=3.5.1", default-features = false } +rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", rev = "b11a40d889e022087d7f2b8cd23aa28e19ceaf5b", version = "=3.6.0", default-features = false } runfiles = { git = "https://github.com/dzbarsky/rules_rust", rev = "b56cbaa8465e74127f1ea216f813cd377295ad81" } rustix = { version = "1.1.4", features = ["net"] } rustls = { version = "0.23.46", default-features = false, features = [ diff --git a/codex-rs/config/src/mcp_types.rs b/codex-rs/config/src/mcp_types.rs index 4a81cabe37..f228d7bc28 100644 --- a/codex-rs/config/src/mcp_types.rs +++ b/codex-rs/config/src/mcp_types.rs @@ -206,7 +206,7 @@ pub enum McpServerAuth { /// still fall back to stored OAuth credentials. #[serde(rename = "chatgpt")] ChatGpt, - /// Exchange an enterprise IdP refresh token for resource-specific authorization. + /// Exchange an enterprise IdP refresh token or, if none was issued, a current ID token for resource-specific authorization. /// Alternate credentials and ordinary OAuth fallback are not permitted. #[serde(rename = "ema_auth")] EmaAuth, diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json index 0347fb96d7..b99d4360b0 100644 --- a/codex-rs/core/config.schema.json +++ b/codex-rs/core/config.schema.json @@ -2903,7 +2903,7 @@ "type": "string" }, { - "description": "Exchange an enterprise IdP refresh token for resource-specific authorization. Alternate credentials and ordinary OAuth fallback are not permitted.", + "description": "Exchange an enterprise IdP refresh token or, if none was issued, a current ID token for resource-specific authorization. Alternate credentials and ordinary OAuth fallback are not permitted.", "enum": [ "ema_auth" ], diff --git a/codex-rs/rmcp-client/src/ema_auth.rs b/codex-rs/rmcp-client/src/ema_auth.rs index de4556a29c..22d4ea4e22 100644 --- a/codex-rs/rmcp-client/src/ema_auth.rs +++ b/codex-rs/rmcp-client/src/ema_auth.rs @@ -106,7 +106,7 @@ pub async fn exchange_ema_auth_token( .ok_or_else(|| anyhow!("MCP authorization metadata is missing an issuer"))?; let EmaIdpIdentity { token_endpoint, - refresh_token, + subject_token, credentials, client_authentication: idp_client_authentication, } = request.idp_identity.await?; @@ -122,7 +122,7 @@ pub async fn exchange_ema_auth_token( idp_client_id: request.idp_client_id, idp_client_authentication, resource_client_authentication, - refresh_token, + subject_token, idp_http_client: request.idp_http_client, resource_http_client: request.resource_http_client, }, diff --git a/codex-rs/rmcp-client/src/ema_auth_tests.rs b/codex-rs/rmcp-client/src/ema_auth_tests.rs index 302b703574..a2561396d1 100644 --- a/codex-rs/rmcp-client/src/ema_auth_tests.rs +++ b/codex-rs/rmcp-client/src/ema_auth_tests.rs @@ -459,7 +459,9 @@ async fn rejected_grants_preserve_their_source_and_release_the_credential_lease( Ok(EmaIdpIdentity { client_authentication: EmaClientAuthentication::None, token_endpoint: format!("{idp}/token"), - refresh_token: "old-grant".to_string(), + subject_token: crate::ema_exchange::EmaSubjectToken::RefreshToken( + oauth2::RefreshToken::new("old-grant".to_string()), + ), credentials: crate::EmaCredentialLease { credentials }, }) }); diff --git a/codex-rs/rmcp-client/src/ema_exchange.rs b/codex-rs/rmcp-client/src/ema_exchange.rs index 8f21e9f75c..ce79c53562 100644 --- a/codex-rs/rmcp-client/src/ema_exchange.rs +++ b/codex-rs/rmcp-client/src/ema_exchange.rs @@ -42,6 +42,12 @@ impl std::fmt::Debug for EmaAccessToken { } } +/// An issuer-bound exchange subject. The IdP verifies the credential during exchange. +pub(crate) enum EmaSubjectToken { + RefreshToken(RefreshToken), + IdToken(String), +} + /// The caller supplies trusted authorization-server metadata and an IdP credential. /// This primitive does not perform resource discovery or interactive login. pub(crate) struct EmaIdJagExchangeRequest<'a> { @@ -55,7 +61,7 @@ pub(crate) struct EmaIdJagExchangeRequest<'a> { pub idp_client_id: &'a str, pub idp_client_authentication: EmaClientAuthentication, pub resource_client_authentication: EmaClientAuthentication, - pub refresh_token: String, + pub subject_token: EmaSubjectToken, pub idp_http_client: Arc, pub resource_http_client: Arc, } @@ -80,31 +86,35 @@ pub(crate) async fn exchange_id_jag( /*has_configured_headers*/ false, StreamableHttpRedirectMode::Legacy, )?; - let refresh_token = RefreshToken::new(request.refresh_token); // Discovery has already verified each registration's authentication method. The SDK owns // token validation and the two exchanges; Codex retains routing and credential policy. - let assertion = EmaExchangeRequest::new( - EmaAuthorizationServer::new( - request.idp_issuer, - request.idp_token_endpoint, - request.idp_client_id, - ) - .with_client_authentication(request.idp_client_authentication), - EmaAuthorizationServer::new( - request.authorization_server_issuer, - request.authorization_server_token_endpoint, - request.mcp_client_id, - ) - .with_client_authentication(request.resource_client_authentication), - request.resource, - &refresh_token, + let idp = EmaAuthorizationServer::new( + request.idp_issuer, + request.idp_token_endpoint, + request.idp_client_id, ) - .with_scopes(request.scopes.iter().cloned()) - .exchange_id_jag(&idp_http) - .await - .map_err(exchange_error)?; - drop(refresh_token); - // Only the IdP uses the refresh token. Release its lease before resource-AS I/O. + .with_client_authentication(request.idp_client_authentication); + let resource_as = EmaAuthorizationServer::new( + request.authorization_server_issuer, + request.authorization_server_token_endpoint, + request.mcp_client_id, + ) + .with_client_authentication(request.resource_client_authentication); + let exchange = match &request.subject_token { + EmaSubjectToken::RefreshToken(token) => { + EmaExchangeRequest::new(idp, resource_as, request.resource, token) + } + EmaSubjectToken::IdToken(token) => { + EmaExchangeRequest::new_with_id_token(idp, resource_as, request.resource, token) + } + }; + let assertion = exchange + .with_scopes(request.scopes.iter().cloned()) + .exchange_id_jag(&idp_http) + .await + .map_err(exchange_error)?; + drop(request.subject_token); + // Only the IdP uses the subject token. Release its lease before resource-AS I/O. let receipt = finish_idp(credentials); let token = assertion .exchange(&resource_http) diff --git a/codex-rs/rmcp-client/src/ema_exchange_tests.rs b/codex-rs/rmcp-client/src/ema_exchange_tests.rs index 37029b75c3..a4ffb09580 100644 --- a/codex-rs/rmcp-client/src/ema_exchange_tests.rs +++ b/codex-rs/rmcp-client/src/ema_exchange_tests.rs @@ -90,7 +90,9 @@ async fn exchange(server: &MockServer, refresh_token: &str) -> Result Result<()> { let client = http_client(); use codex_config::McpEmaTokenEndpointAuthMethod::ClientSecretBasic; use codex_config::McpEmaTokenEndpointAuthMethod::ClientSecretPost; - for (scopes, echo_scope, refresh_token, idp_method) in [ + for (scopes, echo_scope, subject_token, subject_type, idp_method) in [ ( requested_scopes.as_slice(), true, "opaque-refresh-token", + "refresh_token", + None, + ), + ( + &[], + true, + "opaque-refresh-token", + "refresh_token", + Some(ClientSecretBasic), + ), + ( + &[], + false, + "opaque-refresh-token", + "refresh_token", + Some(ClientSecretPost), + ), + (&[], true, "test-id-token", "id_token", None), + (requested_scopes.as_slice(), true, "", "refresh_token", None), + ( + requested_scopes.as_slice(), + true, + " \t", + "refresh_token", None, ), - (&[], true, "opaque-refresh-token", Some(ClientSecretBasic)), - (&[], false, "opaque-refresh-token", Some(ClientSecretPost)), - (requested_scopes.as_slice(), true, "", None), - (requested_scopes.as_slice(), true, " \t", None), ] { let server = MockServer::start().await; let issuer = format!("{}/idp", server.uri()); @@ -129,7 +151,7 @@ async fn client_round_trip_preserves_signed_narrowing() -> Result<()> { .expect("ID-JAG response") .remove("scope"); } - let valid = !refresh_token.trim().is_empty(); + let valid = !subject_token.trim().is_empty(); for (endpoint, response) in [("/idp/token", jag.clone()), ("/as/token", token_response())] { Mock::given(method("POST")) .and(path(endpoint)) @@ -138,7 +160,7 @@ async fn client_round_trip_preserves_signed_narrowing() -> Result<()> { .mount(&server) .await; } - let expected_subject = refresh_token.to_string(); + let expected_subject = subject_token.to_string(); let resource_method = idp_method.map(|method| match method { ClientSecretBasic => ClientSecretPost, ClientSecretPost => ClientSecretBasic, @@ -169,7 +191,11 @@ async fn client_round_trip_preserves_signed_narrowing() -> Result<()> { idp_token_endpoint: &format!("{issuer}/token"), idp_issuer: &issuer, idp_client_id: "idp-client", - refresh_token: refresh_token.to_string(), + subject_token: if subject_type == "id_token" { + EmaSubjectToken::IdToken(subject_token.to_owned()) + } else { + EmaSubjectToken::RefreshToken(RefreshToken::new(subject_token.to_owned())) + }, idp_http_client: Arc::clone(&client), resource_http_client: Arc::clone(&client), }, @@ -254,7 +280,7 @@ async fn client_round_trip_preserves_signed_narrowing() -> Result<()> { ("subject_token".to_string(), expected_subject), ( "subject_token_type".to_string(), - "urn:ietf:params:oauth:token-type:refresh_token".to_string(), + format!("urn:ietf:params:oauth:token-type:{subject_type}"), ), ("audience".to_string(), audience.clone()), ("resource".to_string(), resource.clone()), diff --git a/codex-rs/rmcp-client/src/ema_identity.rs b/codex-rs/rmcp-client/src/ema_identity.rs index c446a8d410..706f0ad190 100644 --- a/codex-rs/rmcp-client/src/ema_identity.rs +++ b/codex-rs/rmcp-client/src/ema_identity.rs @@ -1,4 +1,4 @@ -//! Shared enterprise IdP discovery and stored refresh-token resolution. +//! Shared enterprise IdP discovery and stored exchange-subject resolution. //! Login and token exchange require published metadata bound to the configured issuer. use std::sync::Arc; @@ -11,7 +11,6 @@ use codex_config::McpEmaTokenEndpointAuthMethod; use codex_exec_server::HttpClient; use codex_keyring_store::DefaultKeyringStore; use codex_keyring_store::KeyringStore; -use oauth2::TokenResponse; use rmcp::transport::AuthorizationManager; use rmcp::transport::auth::AuthorizationMetadata; use rmcp::transport::auth::OAuthHttpClient; @@ -24,11 +23,12 @@ use crate::ema_auth_policy::ema_reauthentication_required; use crate::ema_auth_policy::resolve_ema_client_auth; use crate::ema_auth_policy::validate_ema_oauth_endpoint; use crate::ema_claims::ID_JAG_TOKEN_TYPE; +use crate::ema_exchange::EmaSubjectToken; use crate::ema_exchange::TOKEN_EXCHANGE_GRANT_TYPE; use crate::http_client_adapter::StreamableHttpRedirectMode; use crate::oauth::RefreshCredentialLock; use crate::oauth::StoredOAuthTokens; -use crate::oauth::stored_oidc_identity; +use crate::oauth::stored_ema_subject; use crate::oauth_http_client::OAuthHttpClientAdapter; use crate::utils::build_default_headers; use rmcp::transport::auth::enterprise::EmaClientAuthentication; @@ -43,10 +43,10 @@ pub struct EmaIdpIdentityRequest<'a> { pub redirect_mode: StreamableHttpRedirectMode, } -/// An opaque IdP refresh token paired with the credentials admitted for its exchange. +/// An opaque IdP exchange subject paired with the credentials admitted for its exchange. pub struct EmaIdpIdentity { pub(crate) token_endpoint: String, - pub(crate) refresh_token: String, + pub(crate) subject_token: EmaSubjectToken, pub(crate) credentials: L, pub(crate) client_authentication: EmaClientAuthentication, } @@ -57,7 +57,7 @@ impl EmaIdpIdentity { pub fn map_credentials(self, map: impl FnOnce(L) -> U) -> EmaIdpIdentity { EmaIdpIdentity { token_endpoint: self.token_endpoint, - refresh_token: self.refresh_token, + subject_token: self.subject_token, credentials: map(self.credentials), client_authentication: self.client_authentication, } @@ -103,7 +103,7 @@ pub async fn resolve_ema_account_idp_identity( ))?; Ok(EmaIdpIdentity { token_endpoint, - refresh_token, + subject_token: EmaSubjectToken::RefreshToken(oauth2::RefreshToken::new(refresh_token)), credentials, client_authentication, }) @@ -119,7 +119,7 @@ pub fn account_oidc_issuer_hint(id_token: &str, issuer: &str) -> bool { crate::ema_claims::oidc_issuer_hint(id_token, issuer) } -/// Returns whether stored credentials contain a refresh token bound to the configured login. +/// Returns whether stored credentials contain an exchange subject bound to the configured login. pub fn stored_ema_identity_is_usable( tokens: &StoredOAuthTokens, issuer: &str, @@ -128,8 +128,7 @@ pub fn stored_ema_identity_is_usable( tokens.url == issuer && tokens.bound_issuer() == Some(issuer) && tokens.client_id == client_id - && tokens.has_refresh_token() - && stored_oidc_identity(tokens).is_ok() + && stored_ema_subject(tokens).is_ok() } pub(crate) async fn resolve_ema_idp_authorization_manager( @@ -177,7 +176,7 @@ pub(crate) async fn resolve_ema_idp_authorization_manager( Ok((manager, metadata, authentication)) } -/// Resolve a stored refresh-token subject against the configured enterprise IdP metadata. +/// Resolve a stored exchange subject against the configured enterprise IdP metadata. pub async fn resolve_ema_idp_identity( request: EmaIdpIdentityRequest<'_>, ) -> Result { @@ -198,7 +197,7 @@ async fn resolve_ema_idp_identity_in( { bail!("stored enterprise IdP credentials do not match the configured issuer and client"); } - stored_oidc_identity(credentials)?; + stored_ema_subject(credentials)?; let (token_endpoint, client_authentication) = resolve_ema_idp_token_endpoint( request.issuer, request.client_secret, @@ -225,19 +224,9 @@ async fn resolve_ema_idp_identity_in( let latest = credentials .credentials .load_ema_credentials(&keyring_store)?; - let refresh_token = latest - .token_response - .0 - .refresh_token() - .filter(|token| !token.secret().trim().is_empty()) - .ok_or_else(|| { - ema_reauthentication_required( - "enterprise IdP session has no refresh token; sign in again", - ) - })?; Ok(EmaIdpIdentity { token_endpoint, - refresh_token: refresh_token.secret().to_string(), + subject_token: stored_ema_subject(&latest)?, credentials, client_authentication, }) diff --git a/codex-rs/rmcp-client/src/ema_identity_tests.rs b/codex-rs/rmcp-client/src/ema_identity_tests.rs index 113134852a..740f778bb6 100644 --- a/codex-rs/rmcp-client/src/ema_identity_tests.rs +++ b/codex-rs/rmcp-client/src/ema_identity_tests.rs @@ -259,14 +259,59 @@ async fn refresh_subject_rereads_pinned_credentials_after_id_token_expiry() -> R store.save(&keyring, &stored.server_name, &stored)?; let identity = resolve_ema_idp_identity_in(request(&issuer, &snapshot), &keyring).await?; - assert_eq!( - (&identity.token_endpoint, identity.refresh_token.as_str()), - (&format!("{issuer}/token"), "stored-refresh") - ); + assert_eq!(identity.token_endpoint, format!("{issuer}/token")); + let EmaSubjectToken::RefreshToken(token) = identity.subject_token else { + panic!("expected the refresh token to take precedence"); + }; + assert_eq!(token.secret(), "stored-refresh"); let _released = RefreshCredentialLock::acquire_for_server(&stored.server_name, &issuer).await?; Ok(()) } +#[tokio::test] +async fn id_token_subject_requires_a_current_bound_assertion() -> Result<()> { + let _home = TempCodexHome::new(); + let (_server, issuer) = discovery().await; + let store = ResolvedOAuthCredentialStore::keyring(AuthKeyringBackendKind::Direct); + let keyring = MockKeyringStore::default(); + let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs(); + for (asserted_issuer, expires_at) in [ + (issuer.as_str(), now + 300), + (issuer.as_str(), 0), + ("https://other.example", now + 300), + ] { + let mut stored = credentials(asserted_issuer, "user", expires_at); + stored.url = issuer.clone(); + stored.issuer = Some(issuer.clone()); + stored.token_response.0.set_refresh_token(None); + store.save(&keyring, &stored.server_name, &stored)?; + let snapshot = StoredOAuthCredentialSnapshot::new(stored.clone(), store); + let identity = resolve_ema_idp_identity_in(request(&issuer, &snapshot), &keyring).await; + let valid = asserted_issuer == issuer && expires_at > now; + assert_eq!( + stored_ema_identity_is_usable(&stored, &issuer, "idp-client"), + valid + ); + if valid { + let EmaSubjectToken::IdToken(token) = identity?.subject_token else { + panic!("expected the login's ID token"); + }; + assert_eq!( + Some(token.as_str()), + stored.token_response.0.extra_fields().0["id_token"].as_str() + ); + } else { + assert!(matches!( + identity + .err() + .and_then(|error| error.downcast::().ok()), + Some(EmaAuthFailure::ReauthenticationRequired) + )); + } + } + Ok(()) +} + #[tokio::test] async fn refresh_subject_rejects_removed_replaced_or_missing_credentials() -> Result<()> { let _home = TempCodexHome::new(); diff --git a/codex-rs/rmcp-client/src/enterprise_oauth_login.rs b/codex-rs/rmcp-client/src/enterprise_oauth_login.rs index 3a2bba2a53..2ab48470c8 100644 --- a/codex-rs/rmcp-client/src/enterprise_oauth_login.rs +++ b/codex-rs/rmcp-client/src/enterprise_oauth_login.rs @@ -330,9 +330,6 @@ pub(crate) fn enterprise_callback_settings( } fn validate_enterprise_credentials(stored: &StoredOAuthTokens) -> Result<()> { - if !stored.has_refresh_token() { - bail!("enterprise IdP login did not return a refresh token"); - } let assertion = stored .token_response .0 diff --git a/codex-rs/rmcp-client/src/enterprise_oauth_login_tests.rs b/codex-rs/rmcp-client/src/enterprise_oauth_login_tests.rs index d9f019524f..7c528f616c 100644 --- a/codex-rs/rmcp-client/src/enterprise_oauth_login_tests.rs +++ b/codex-rs/rmcp-client/src/enterprise_oauth_login_tests.rs @@ -256,6 +256,91 @@ fn enterprise_callback_requires_loopback() -> Result<()> { Ok(()) } +#[tokio::test] +async fn enterprise_login_keeps_offline_access_with_incomplete_metadata() -> Result<()> { + if isolated_process( + "enterprise_oauth_login::tests::enterprise_login_keeps_offline_access_with_incomplete_metadata", + ) + .await? + { + return Ok(()); + } + let keyring = TestKeyring::default(); + keyring::set_default_credential_builder(Box::new(keyring)); + // RFC 8414 permits metadata to omit supported scopes. Both issuers + // accept offline_access, but only one issues a refresh token. + for refresh_token in [None, Some(SECRET)] { + let server = MockServer::start().await; + let issuer = format!("{}/idp", server.uri()); + Mock::given(method("GET")) + .and(path("/.well-known/oauth-authorization-server/idp")) + .respond_with(ResponseTemplate::new(200).set_body_json(json!({ + "issuer": issuer, + "authorization_endpoint": format!("{issuer}/authorize"), + "token_endpoint": format!("{issuer}/token"), + "token_endpoint_auth_methods_supported": ["none"], + "scopes_supported": ["openid"], + }))) + .mount(&server) + .await; + let assertion = format!( + "{}.{}.signature", + URL_SAFE_NO_PAD.encode(r#"{"alg":"ES256"}"#), + URL_SAFE_NO_PAD.encode( + json!({"iss":issuer,"sub":"user","aud":"enterprise-client","exp":4102444800_u64}) + .to_string() + ) + ); + let mut token_response = json!({ + "access_token":SECRET,"id_token":assertion,"token_type":"Bearer", + }); + if let Some(refresh_token) = refresh_token { + token_response["refresh_token"] = json!(refresh_token); + } + Mock::given(method("POST")) + .and(path("/idp/token")) + .respond_with(ResponseTemplate::new(200).set_body_json(token_response)) + .expect(1) + .mount(&server) + .await; + + let login = login( + &issuer, /*callback_url*/ None, /*auth_method*/ None, + ) + .await?; + let authorization_url = login.authorization_url(); + let url = Url::parse(&authorization_url)?; + let scopes = url + .query_pairs() + .find(|(key, _)| key == "scope") + .expect("authorization scope") + .1; + assert_eq!( + scopes.split_ascii_whitespace().collect::>(), + vec!["openid", "offline_access"] + ); + callback(&authorization_url, &issuer, /*provider_error*/ false).await?; + login.wait().await?.commit_if(|| async { Some(()) }).await?; + + let stored = crate::stored_oauth_credentials( + CREDENTIAL_NAME, + &issuer, + OAuthCredentialsStoreMode::Keyring, + AuthKeyringBackendKind::Direct, + )? + .expect("stored grant"); + use crate::ema_exchange::EmaSubjectToken; + match (refresh_token, crate::oauth::stored_ema_subject(&stored)?) { + (None, EmaSubjectToken::IdToken(token)) => assert_eq!(token, assertion), + (Some(expected), EmaSubjectToken::RefreshToken(token)) => { + assert_eq!(token.secret(), expected); + } + _ => panic!("selected the wrong enterprise exchange subject"), + } + } + Ok(()) +} + #[traced_test] #[tokio::test] async fn enterprise_public_api_storage_and_privacy() -> Result<()> { diff --git a/codex-rs/rmcp-client/src/oauth.rs b/codex-rs/rmcp-client/src/oauth.rs index defbfb00f3..b00db701a5 100644 --- a/codex-rs/rmcp-client/src/oauth.rs +++ b/codex-rs/rmcp-client/src/oauth.rs @@ -86,7 +86,7 @@ use codex_utils_home_dir::find_codex_home; pub(crate) use self::credential_store::OAuthCredentialStore; pub use self::ema_identity::EmaCredentialLease; pub use self::ema_identity::EmaCredentialSnapshot; -pub(crate) use self::ema_identity::stored_oidc_identity; +pub(crate) use self::ema_identity::stored_ema_subject; pub(crate) use self::enterprise_generation::EnterpriseOAuthGeneration; pub(crate) use self::enterprise_generation::EnterpriseOAuthGenerationFile; pub(crate) use self::enterprise_generation::EnterpriseOAuthGenerationKind; diff --git a/codex-rs/rmcp-client/src/oauth/ema_identity.rs b/codex-rs/rmcp-client/src/oauth/ema_identity.rs index 313ccd22a0..efac0e01ce 100644 --- a/codex-rs/rmcp-client/src/oauth/ema_identity.rs +++ b/codex-rs/rmcp-client/src/oauth/ema_identity.rs @@ -8,13 +8,15 @@ use anyhow::anyhow; use anyhow::bail; use codex_keyring_store::DefaultKeyringStore; use codex_keyring_store::KeyringStore; +use oauth2::TokenResponse; use tracing::instrument::WithSubscriber; use crate::ema_auth_policy::EmaAuthFailure; use crate::ema_auth_policy::EmaErrorDetail; use crate::ema_auth_policy::ema_reauthentication_required; -use crate::ema_claims::OidcClaims; use crate::ema_claims::oidc_identity; +use crate::ema_claims::validate_oidc_identity_assertion; +use crate::ema_exchange::EmaSubjectToken; use crate::oauth::EnterpriseOAuthGeneration; use crate::oauth::EnterpriseOAuthGenerationFile; use crate::oauth::EnterpriseOAuthGenerationKind; @@ -52,7 +54,7 @@ impl std::fmt::Debug for EmaCredentialLease { } } -pub(crate) fn stored_oidc_identity(tokens: &StoredOAuthTokens) -> Result { +pub(crate) fn stored_ema_subject(tokens: &StoredOAuthTokens) -> Result { let assertion = tokens .token_response .0 @@ -65,12 +67,26 @@ pub(crate) fn stored_oidc_identity(tokens: &StoredOAuthTokens) -> Result