captcha-sdk 0.0.1

Unified server-side CAPTCHA verification for Rust
Documentation
use std::fmt;

use crate::credential::Credential;

/// Configuration scaffold for local ALTCHA payload verification.
#[derive(PartialEq, Eq)]
pub struct AltchaConfig {
    hmac_key: Credential,
}

impl AltchaConfig {
    /// Creates a configuration with the HMAC key used for local verification.
    pub fn new(hmac_key: impl Into<String>) -> Self {
        Self {
            hmac_key: Credential::new(hmac_key),
        }
    }
}

impl fmt::Debug for AltchaConfig {
    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
        formatter
            .debug_struct("AltchaConfig")
            .field("hmac_key", &self.hmac_key)
            .finish()
    }
}