pub struct OrcaCredential { /* private fields */ }Expand description
The credential the rest of Codewhale consumes for OrcaRouter.
Both authentication adapters produce this same value: the hand-typed
API-key adapter wraps the pasted sk-orca-… string, and the PKCE adapter
wraps the key the exchange returned. Downstream code — the secret-store
write, the route binding, model discovery, and every AI entry point — must
read only this type and never branch on how the key was obtained.
No Debug: the key must not reach a log, an error, or a snapshot.
Implementations§
Source§impl OrcaCredential
impl OrcaCredential
Sourcepub fn from_api_key(raw: &str) -> Result<Self>
pub fn from_api_key(raw: &str) -> Result<Self>
The API-key adapter: a key the user already holds.
Prefix checking is deliberately only a shape check — an sk-orca-
prefix is not proof the credential is valid, and no billing request is
sent from a settings form to find out.
Sourcepub fn expose(&self) -> &str
pub fn expose(&self) -> &str
The key material. Callers must not log, echo, or embed this value.
pub fn granted_scope(&self) -> &str
pub const fn source(&self) -> OrcaCredentialSource
Sourcepub fn scope_satisfies_purpose(&self) -> bool
pub fn scope_satisfies_purpose(&self) -> bool
Whether the granted scope satisfies this client’s purpose. A downgraded grant must be surfaced, not assumed away.
Trait Implementations§
Auto Trait Implementations§
impl Forget for OrcaCredential
impl Freeze for OrcaCredential
impl Move for OrcaCredential
impl RefUnwindSafe for OrcaCredential
impl Send for OrcaCredential
impl Sync for OrcaCredential
impl Unpin for OrcaCredential
impl UnsafeUnpin for OrcaCredential
impl UnwindSafe for OrcaCredential
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.