Skip to main content

steer_grpc/client_api/
auth.rs

1//! Client-facing authentication types and helpers.
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub enum AuthMethod {
5    OAuth,
6    ApiKey,
7}
8
9#[derive(Debug, Clone, PartialEq, Eq)]
10pub enum AuthSource {
11    ApiKey { origin: ApiKeyOrigin },
12    Plugin { method: AuthMethod },
13    None,
14}
15
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub enum ApiKeyOrigin {
18    Env,
19    Stored,
20}
21
22#[derive(Debug, Clone, PartialEq, Eq)]
23pub enum AuthProgress {
24    NeedInput { prompt: String },
25    InProgress { message: String },
26    Complete,
27    Error { message: String },
28    OAuthStarted { auth_url: String },
29}
30
31#[derive(Debug, Clone)]
32pub struct ProviderInfo {
33    pub id: String,
34    pub name: String,
35}
36
37#[derive(Debug, Clone)]
38pub struct ProviderAuthStatus {
39    pub provider_id: String,
40    pub auth_source: Option<AuthSource>,
41}
42
43#[derive(Debug, Clone)]
44pub struct StartAuthResponse {
45    pub flow_id: String,
46    pub progress: Option<AuthProgress>,
47}