Skip to content

Commit 15cadaa

Browse files
author
Symbiont OSS Sync
committed
Bump jsonwebtoken from 9.3.1 to 10.3.0
1 parent 569847e commit 15cadaa

File tree

4 files changed

+83
-25
lines changed

4 files changed

+83
-25
lines changed

Cargo.lock

Lines changed: 2 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/channel-adapter/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ authors = ["Jascha Wanger / ThirdKey.ai"]
66
description = "Chat channel adapters for the Symbi platform — Slack, Teams, Mattermost"
77
license = "MIT"
88
repository = "https://github.com/thirdkeyai/symbiont"
9+
readme = "README.md"
910
keywords = ["chat", "slack", "adapter", "symbiont", "agents"]
1011

1112
[dependencies]
@@ -29,7 +30,7 @@ tower = { version = "0.4", optional = true }
2930
tower-http = { version = "0.5", features = ["cors", "trace"], optional = true }
3031
serde_urlencoded = { version = "0.7", optional = true }
3132
base64 = { version = "0.22", optional = true }
32-
jsonwebtoken = { version = "9", optional = true }
33+
jsonwebtoken = { version = "10", optional = true }
3334

3435
[dev-dependencies]
3536
tokio-test = "0.4"

crates/channel-adapter/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# symbi-channel-adapter
2+
3+
[![crates.io](https://img.shields.io/crates/v/symbi-channel-adapter.svg)](https://crates.io/crates/symbi-channel-adapter)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
6+
Chat channel adapters for the [Symbi](https://crates.io/crates/symbi) platform — bidirectional Slack, Teams, and Mattermost integration for AI agents.
7+
8+
## Overview
9+
10+
`symbi-channel-adapter` provides a `ChannelAdapter` trait and platform-specific implementations that let users invoke Symbi agents directly from chat platforms and receive policy-enforced, audit-logged responses.
11+
12+
## Features
13+
14+
| Feature | Default | Platform |
15+
|---------|---------|----------|
16+
| `slack` | Yes | Slack Events API, slash commands, Socket Mode |
17+
| `teams` | No | Microsoft Teams Bot Framework, OAuth2 |
18+
| `mattermost` | No | Mattermost outgoing webhooks, REST API |
19+
| `enterprise-hooks` | No | Policy, DLP, and crypto audit hooks |
20+
21+
## Usage
22+
23+
```rust
24+
use symbi_channel_adapter::{ChannelAdapterManager, ChannelConfig, SlackConfig};
25+
26+
let config = ChannelConfig {
27+
platform: SlackConfig {
28+
bot_token: std::env::var("SLACK_BOT_TOKEN").unwrap(),
29+
app_token: std::env::var("SLACK_APP_TOKEN").unwrap(),
30+
signing_secret: std::env::var("SLACK_SIGNING_SECRET").unwrap(),
31+
..Default::default()
32+
}.into(),
33+
..Default::default()
34+
};
35+
36+
let manager = ChannelAdapterManager::new(config);
37+
```
38+
39+
### Enabling additional platforms
40+
41+
```toml
42+
[dependencies]
43+
symbi-channel-adapter = { version = "0.1", features = ["slack", "teams", "mattermost"] }
44+
```
45+
46+
## Architecture
47+
48+
The crate is built around a few core abstractions:
49+
50+
- **`ChannelAdapter`** — trait for sending/receiving messages on a chat platform
51+
- **`InboundHandler`** — trait for processing incoming messages and slash commands
52+
- **`ChannelAdapterManager`** — orchestrates multiple adapters with health checks and lifecycle management
53+
- **`AgentInvoker`** — trait bridging chat messages to Symbi agent execution
54+
55+
Each platform adapter handles authentication, signature verification, and message formatting specific to its platform.
56+
57+
## Part of Symbiont
58+
59+
This crate is part of the [Symbiont](https://github.com/thirdkeyai/symbiont) workspace. For the full agent framework, see the [`symbi`](https://crates.io/crates/symbi) crate.
60+
61+
## License
62+
63+
MIT

crates/channel-adapter/src/adapters/teams/auth.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,23 @@ pub async fn validate_bot_framework_token(
7070
) -> Result<BotFrameworkClaims, ChannelAdapterError> {
7171
if skip_jwks_verification {
7272
// Dev mode: decode without signature verification, just validate claims
73-
let mut validation = Validation::default();
74-
validation.insecure_disable_signature_validation();
75-
validation.set_audience(&[client_id]);
76-
validation.set_issuer(&[BOT_FRAMEWORK_ISSUER]);
77-
7873
let token_data =
79-
decode::<BotFrameworkClaims>(token, &DecodingKey::from_secret(b""), &validation)
80-
.map_err(|e| ChannelAdapterError::Auth(format!("JWT validation failed: {}", e)))?;
74+
jsonwebtoken::dangerous::insecure_decode::<BotFrameworkClaims>(token)
75+
.map_err(|e| ChannelAdapterError::Auth(format!("JWT decode failed: {}", e)))?;
76+
77+
let claims = &token_data.claims;
78+
if claims.iss != BOT_FRAMEWORK_ISSUER {
79+
return Err(ChannelAdapterError::Auth(format!(
80+
"Invalid issuer: {}",
81+
claims.iss
82+
)));
83+
}
84+
if claims.aud != client_id {
85+
return Err(ChannelAdapterError::Auth(format!(
86+
"Invalid audience: {}",
87+
claims.aud
88+
)));
89+
}
8190

8291
return Ok(token_data.claims);
8392
}

0 commit comments

Comments
 (0)