Validated Rust newtype for OAuth provider identifiers, ensuring strict type safety and valid URL-safe strings. Reuse when managing multi-provider authentication.
// Source: https://github.com/nearai/ironclaw | License: Apache-2.0 | Copyright 2026 NEAR AI
// Provided via justclaw.it.com; keep this notice with the code.
//! Validated newtype for OAuth provider identifiers.
//!
//! Per [`.claude/rules/types.md`], identifiers carried between
//! internal modules must be specialized types — never `String` /
//! `&str`. The OAuth flow stores the provider identity in three
//! places that all have to agree (the pending-flow record, the
//! `{provider}` URL segment on the callback, the `OAuthProvider`
//! impl's self-identifier); a string-typed value would let one
//! layer drift from another. This newtype makes that compile error.
//!
//! Validation rules: lowercase ASCII alphanumeric plus underscore,
//! 1..=32 characters. Restrictive on purpose — provid
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key