Skip to content

Commit

Permalink
examples: Add short summary for each example
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxuser committed Dec 21, 2023
1 parent 295ad76 commit 66b3147
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
2 changes: 2 additions & 0 deletions examples/src/bin/auth_azure.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Authenticating via custom Azure Client Id to Xbox Live
//!
use std::str::from_utf8;

use async_trait::async_trait;
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/auth_cli.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Authenticating by following instructions on the CLI
use xal::{AccessTokenPrefix, CliCallbackHandler, Error};
use xal_examples::auth_main_default;

#[tokio::main]
async fn main() -> Result<(), Error> {
auth_main_default(AccessTokenPrefix::None, CliCallbackHandler)
.await?;
auth_main_default(AccessTokenPrefix::None, CliCallbackHandler).await?;

Ok(())
}
8 changes: 8 additions & 0 deletions examples/src/bin/auth_halo.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//! Halo Waypoint authentication
//! - Acquiring Spartan token
//! - Acquiring flighting Id
//!
//! Reference:
//! Den Delimarsky, Halo Infinite Web API Authentication
//! Blog post: https://den.dev/blog/halo-api-authentication/
//!
use chrono::{DateTime, Utc};
use env_logger::Env;
use serde::Deserialize;
Expand Down
2 changes: 2 additions & 0 deletions examples/src/bin/auth_minecraft.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Authenticating to Minecraft Bedrock as Nintendo-Switch-client
//!
use serde_json::json;
use xal::{
extensions::JsonExDeserializeMiddleware, oauth2::TokenResponse, AccessTokenPrefix,
Expand Down
3 changes: 1 addition & 2 deletions examples/src/bin/auth_webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ async fn main() -> Result<(), Error> {
.to_owned(),
};

auth_main_default(AccessTokenPrefix::None, callback_handler)
.await?;
auth_main_default(AccessTokenPrefix::None, callback_handler).await?;

Ok(())
}
6 changes: 5 additions & 1 deletion examples/src/bin/xbl_signed_request.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Sending a signed http request to XBL userpresence API
//!
use env_logger::Env;
use xal::{
cvlib::CorrelationVector,
Expand Down Expand Up @@ -39,8 +41,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.send()
.await?
.log()
.await?
.text()
.await?;

println!("{:?}", userpresence);
println!("{userpresence}");
Ok(())
}

0 comments on commit 66b3147

Please sign in to comment.