nodedb 0.3.0

Local-first, real-time, edge-to-cloud hybrid database for multi-modal workloads
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: BUSL-1.1

//! ApiKey post-apply side effects — upsert / mark-revoked the
//! in-memory `api_keys` cache.

use std::sync::Arc;

use crate::control::security::catalog::StoredApiKey;
use crate::control::state::SharedState;

pub fn put(stored: StoredApiKey, shared: Arc<SharedState>) {
    shared.api_keys.install_replicated_key(&stored);
}

pub fn revoke(key_id: String, shared: Arc<SharedState>) {
    shared.api_keys.install_replicated_revoke(&key_id);
}