Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c25537f
fix: authorize watch creation and enumeration on the holder
St4NNi Jul 12, 2026
f16ffc9
fix: answer unreadable watch paths without an existence signal
St4NNi Jul 12, 2026
9c98fbf
fix: exclude unauthorized watches from the per-user cap
St4NNi Jul 12, 2026
df4131d
test: prove the nil watch owner guard blocks public read
St4NNi Jul 12, 2026
3e127da
fix: reauthorize stored watch notifications
St4NNi Jul 13, 2026
dcbab25
fix: validate durable watch subscription state
St4NNi Jul 13, 2026
3a7f4b7
fix: retain retryable watch authorization state
St4NNi Jul 13, 2026
933dc31
fix: redirty watch interest on authorization changes
St4NNi Jul 14, 2026
555c6bd
fix: skip republishing unchanged watch interest digests
St4NNi Jul 14, 2026
7c87082
fix: preserve cleanup ids for revoked watches
St4NNi Jul 14, 2026
185b9c3
fix: propagate watch authorization failures
St4NNi Jul 14, 2026
17235ec
fix: filter unread counts after watch revocation
St4NNi Jul 14, 2026
8316dc8
fix: bind watches to canonical token scope
St4NNi Jul 14, 2026
5e2a37d
fix: reauthorize exact watch events
St4NNi Jul 14, 2026
9b42402
fix: reject generic watch record delivery
St4NNi Jul 14, 2026
a539bda
fix: reject malformed inbox identities
St4NNi Jul 14, 2026
678a9ae
fix: authorize watch records before mark read
St4NNi Jul 14, 2026
c5977fe
fix: linearize watch delivery with revocation
St4NNi Jul 14, 2026
398284a
feat: expose watch authorization metrics
St4NNi Jul 14, 2026
2aebe3f
fix: audit watch authorization decisions
St4NNi Jul 14, 2026
9ee5e06
fix: require canonical watch token hashes
St4NNi Jul 14, 2026
27cb567
fix: decode legacy notification records
St4NNi Jul 14, 2026
e416440
fix: reauthorize stored watch scopes
St4NNi Jul 14, 2026
73c5ef5
fix: preserve watch creation denial reasons
St4NNi Jul 14, 2026
71b33f5
fix: satisfy clippy watch binding initialization
St4NNi Jul 14, 2026
af88d23
fix: route watch metrics through operations
St4NNi Jul 14, 2026
202099c
fix: recover missed document sync reconciliation
St4NNi Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions api/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,23 +343,29 @@ pub fn bearer_token(headers: &HeaderMap) -> Option<&str> {
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ValidatedArunaBearerTokenCarrier {
token: String,
expires_at_secs: u64,
}

impl ValidatedArunaBearerTokenCarrier {
fn new(token: impl Into<String>) -> Self {
fn new(token: impl Into<String>, expires_at_secs: u64) -> Self {
Self {
token: token.into(),
expires_at_secs,
}
}

#[cfg(test)]
pub(crate) fn new_for_test(token: impl Into<String>) -> Self {
Self::new(token)
Self::new(token, u64::MAX)
}

pub fn as_str(&self) -> &str {
&self.token
}

pub fn expires_at_secs(&self) -> u64 {
self.expires_at_secs
}
}

#[derive(Debug, Error)]
Expand Down Expand Up @@ -396,13 +402,17 @@ async fn extract_auth_context_and_bearer_token(
Ok(claims) => claims,
Err(_) => return (None, None),
};
let expires_at_secs = claims.exp;
let auth_context: AuthContext = match claims.try_into() {
Ok(auth_context) => auth_context,
Err(_) => return (None, None),
};
(
Some(auth_context),
Some(ValidatedArunaBearerTokenCarrier::new(token)),
Some(ValidatedArunaBearerTokenCarrier::new(
token,
expires_at_secs,
)),
)
}

Expand Down
6 changes: 6 additions & 0 deletions api/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ impl OpsState {
) -> Arc<Self> {
register_storage_source(&metrics, ctx.clone()).await;
register_queue_metrics(&metrics, ctx.clone()).await;
if let Some(net_handle) = &ctx.net_handle {
net_handle
.notification_watch_metrics()
.register(&metrics)
.await;
}
Arc::new(Self {
ctx,
metrics,
Expand Down
Loading
Loading