MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / call

Method call

crates/chat-cli/src/auth/pkce.rs:404–423  ·  view source on GitHub ↗
(&self, req: Request<Incoming>)

Source from the content-addressed store, hash-verified

402 type Response = ServiceResponse;
403
404 fn call(&self, req: Request<Incoming>) -> Self::Future {
405 let code_tx: CodeSender = std::sync::Arc::clone(&self.code_tx);
406 let host = self.host.clone();
407 Box::pin(async move {
408 debug!(?req, "Handling connection");
409 match req.uri().path() {
410 "/oauth/callback" | "/oauth/callback/" => Self::handle_oauth_callback(code_tx, host, req).await,
411 "/index.html" => Ok(Response::builder()
412 .status(200)
413 .header("Content-Type", "text/html")
414 .header("Connection", "close")
415 .body(include_str!("./index.html").into())
416 .expect("valid builder will not panic")),
417 _ => Ok(Response::builder()
418 .status(404)
419 .body("".into())
420 .expect("valid builder will not panic")),
421 }
422 })
423 }
424}
425
426/// Query params for the initial GET request that starts the PKCE flow. Use

Callers

nothing calls this directly

Calls 5

bodyMethod · 0.80
cloneMethod · 0.45
pathMethod · 0.45
uriMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected