MCPcopy Create free account
hub / github.com/ZingerLittleBee/ServerBee / build_basic_client

Function build_basic_client

crates/server/src/service/oauth.rs:280–293  ·  view source on GitHub ↗
(
    config: &OAuthProviderConfig,
    auth_url: &str,
    token_url: &str,
    redirect_url: &str,
)

Source from the content-addressed store, hash-verified

278 .as_i64()
279 .filter(|id| *id > 0)
280 .ok_or_else(|| AppError::Internal("GitHub userinfo missing valid id".to_string()))?
281 .to_string();
282
283 Ok(OAuthUserInfo {
284 provider_user_id,
285 email: resp["email"].as_str().map(str::to_string),
286 display_name: resp["login"]
287 .as_str()
288 .or(resp["name"].as_str())
289 .map(str::to_string),
290 })
291}
292
293fn parse_google_user_info(resp: &serde_json::Value) -> Result<OAuthUserInfo, AppError> {
294 let provider_user_id = resp["sub"]
295 .as_str()
296 .filter(|id| !id.trim().is_empty())

Callers 1

build_clientMethod · 0.85

Calls 1

build_basic_client_rawFunction · 0.85

Tested by

no test coverage detected