this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

did.json stuff

+37 -4
+27
web/src/handlers/did.rs
··· 1 + use axum::Json; 2 + use axum::response::IntoResponse; 3 + use serde_json::json; 4 + use std::env; 5 + 6 + pub async fn did_json_handler() -> impl IntoResponse { 7 + let oauth_host = env::var("OAUTH_HOST").unwrap_or_else(|_| "localhost".to_string()); 8 + let did = format!("did:web:{oauth_host}"); 9 + let service_endpoint = format!("https://{oauth_host}"); 10 + 11 + Json(json!({ 12 + "@context": [ 13 + "https://www.w3.org/ns/did/v1", 14 + "https://w3id.org/security/multikey/v1" 15 + ], 16 + "id": did, 17 + "alsoKnownAs": [], 18 + "service": [ 19 + { 20 + "id": "#advent", 21 + "type": "AdventChallengeService", 22 + "serviceEndpoint": service_endpoint 23 + } 24 + ], 25 + "verificationMethod": [] 26 + })) 27 + }
+1
web/src/handlers/mod.rs
··· 1 1 pub mod auth; 2 2 pub mod day; 3 + pub mod did; 3 4 pub mod leaderboard; 4 5 pub mod oauth_metadata;
+9 -4
web/src/main.rs
··· 307 307 .nest_service("/public", axum_embed::ServeEmbed::<Assets>::new()); 308 308 309 309 if env::var("OAUTH_HOST").is_ok() { 310 - app = app.route( 311 - "/oauth-client-metadata.json", 312 - get(handlers::oauth_metadata::oauth_client_metadata_handler), 313 - ); 310 + app = app 311 + .route( 312 + "/oauth-client-metadata.json", 313 + get(handlers::oauth_metadata::oauth_client_metadata_handler), 314 + ) 315 + .route( 316 + "/.well-known/did.json", 317 + get(handlers::did::did_json_handler), 318 + ); 314 319 } 315 320 316 321 let app = app