feat: add oauth field to ProviderModels
This commit is contained in:
@@ -357,6 +357,8 @@ impl ModelData {
|
|||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct ProviderModels {
|
pub struct ProviderModels {
|
||||||
pub provider: String,
|
pub provider: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub oauth: Option<super::oauth::OAuthConfig>,
|
||||||
pub models: Vec<ModelData>,
|
pub models: Vec<ModelData>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -18,14 +18,14 @@ use std::net::TcpListener;
|
|||||||
use url::Url;
|
use url::Url;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Deserialize)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum TokenRequestFormat {
|
pub enum TokenRequestFormat {
|
||||||
Json,
|
Json,
|
||||||
FormUrlEncoded,
|
FormUrlEncoded,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Deserialize, Default)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Default)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum OAuthFlow {
|
pub enum OAuthFlow {
|
||||||
#[default]
|
#[default]
|
||||||
@@ -38,7 +38,7 @@ pub enum OAuthFlow {
|
|||||||
///
|
///
|
||||||
/// Every field except `client_id`, `token_url`, and `flow` is optional so that
|
/// Every field except `client_id`, `token_url`, and `flow` is optional so that
|
||||||
/// user config can override individual fields without restating the entire block.
|
/// user config can override individual fields without restating the entire block.
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct OAuthConfig {
|
pub struct OAuthConfig {
|
||||||
pub client_id: String,
|
pub client_id: String,
|
||||||
pub token_url: String,
|
pub token_url: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user