исправить: закрыть ревью сквозной корреляции
This commit is contained in:
@@ -42,6 +42,15 @@ pub enum PlatformApiKeyKind {
|
||||
Approval,
|
||||
}
|
||||
|
||||
impl PlatformApiKeyKind {
|
||||
pub const fn secret_marker(self) -> &'static str {
|
||||
match self {
|
||||
Self::McpClient => "crk_",
|
||||
Self::Approval => "crk_appr_",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PlatformApiKeyScope {
|
||||
@@ -123,6 +132,12 @@ mod tests {
|
||||
};
|
||||
use crate::ids::{AgentId, PlatformApiKeyId, UserId, WorkspaceId};
|
||||
|
||||
#[test]
|
||||
fn api_key_kinds_own_their_secret_markers() {
|
||||
assert_eq!(PlatformApiKeyKind::McpClient.secret_marker(), "crk_");
|
||||
assert_eq!(PlatformApiKeyKind::Approval.secret_marker(), "crk_appr_");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn user_serializes_created_at_as_rfc3339() {
|
||||
let user = User {
|
||||
|
||||
Reference in New Issue
Block a user