Skip to content

Commit 83fa9cd

Browse files
committed
fix: restore CI sdk checkout and canonical token auth gate
1 parent a26f187 commit 83fa9cd

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
os: [ubuntu-latest, macos-latest]
1919
steps:
2020
- uses: actions/checkout@v4
21+
- name: Clone agentic-sdk (sibling dependency)
22+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
2123
- uses: dtolnay/rust-toolchain@stable
2224
with:
2325
components: rustfmt

crates/agentic-comm-mcp/src/protocol/handler.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,20 @@ impl ProtocolHandler {
218218
serde_json::to_value(result).map_err(|e| McpError::InternalError(e.to_string()))
219219
}
220220

221-
/// Check if the MCP connection is authorized via AGENTIC_COMM_TOKEN env var.
222-
/// If AGENTIC_COMM_TOKEN is set, all tool calls must include a matching token
221+
/// Resolve expected auth token from environment.
222+
/// Canonical env var is AGENTIC_TOKEN; AGENTIC_COMM_TOKEN is retained
223+
/// for backward compatibility with older deployments.
224+
fn expected_auth_token() -> Option<String> {
225+
std::env::var("AGENTIC_TOKEN")
226+
.ok()
227+
.or_else(|| std::env::var("AGENTIC_COMM_TOKEN").ok())
228+
}
229+
230+
/// Check if the MCP connection is authorized via AGENTIC_TOKEN (or legacy
231+
/// AGENTIC_COMM_TOKEN). If set, all tool calls must include a matching token
223232
/// in the _meta.token field. If not set, auth is disabled (open access).
224233
fn check_auth(params: &Option<Value>) -> McpResult<()> {
225-
if let Ok(expected_token) = std::env::var("AGENTIC_COMM_TOKEN") {
234+
if let Some(expected_token) = Self::expected_auth_token() {
226235
let provided_token = params
227236
.as_ref()
228237
.and_then(|p| p.get("_meta"))

0 commit comments

Comments
 (0)