is_auth_gate_ref (auth_interaction/gate_ref.rs)

ClawProBench · ironclaw/crates/ironclaw_product_workflow/src/auth_interaction/gate_ref.rs · rust · Apache-2.0
auth, tag:embed-classified

Checks if a gate reference string represents an auth gate.

// Source: https://github.com/suyoumo/ClawProBench | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
const AUTH_GATE_REF: &str = "gate:auth";
const AUTH_GATE_PREFIX: &str = "gate:auth-";
const HOOK_AUTH_GATE_PREFIX: &str = "gate:hook-auth-";

pub fn is_auth_gate_ref(gate_ref_str: &str) -> bool {
    gate_ref_str == AUTH_GATE_REF
        || gate_ref_str.starts_with(AUTH_GATE_PREFIX)
        || gate_ref_str.starts_with(HOOK_AUTH_GATE_PREFIX)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn is_auth_gate_ref_matches_only_auth_gate_shapes() {
        assert!(is_auth_gate_ref("gate:auth"));
        assert!(is_auth_gate_ref("gate:auth-oauth"));
        assert!(is_auth_gate

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key