Defines enums and structs representing authentication state, source, and validation records for use in auth workflows.
// Source: https://github.com/1jehuang/jcode | License: MIT | Copyright 2025 Jeremy Huang
// Provided via justclaw.it.com; keep this notice with the code.
use serde::{Deserialize, Serialize};
/// State of a single auth credential
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum AuthState {
/// Credential is available and valid
Available,
/// Partial configuration exists (or OAuth may be expired)
Expired,
/// Credential is not configured
#[default]
NotConfigured,
}
impl AuthState {
/// Short, stable, log-friendly label for this credential state.
pub fn label(self) -> &'static str {
match self {
Self::Available => "available",
Self::Expired => "expired",
Self::NotConfigured
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key