Crates.io | jsonwebtoken-google-wasm |
lib.rs | jsonwebtoken-google-wasm |
version | 0.0.8 |
source | src |
created_at | 2023-09-20 13:47:59.659235 |
updated_at | 2023-09-21 09:56:31.504487 |
description | parse and validate google jwt token compliant with webassembly runtimes with jsonwebtoken |
homepage | |
repository | https://github.com/0xpaladinsecurity/jsonwebtoken-google-wasm |
max_upload_size | |
id | 978137 |
size | 30,599 |
Developed for CloudFlare Workers. Experimental & non-reviewed. Use at own risk.
#[derive(Debug, Serialize, Deserialize)]
pub struct Token {
pub email: String,
pub aud: String,
pub iss: String,
pub exp: u64,
}
async fn main() {
let parser = Parser::new("your-google-client-id");
let claims = parser.parse::<Token>("your-token", Instant::now()).await.unwrap();
// Instant::now() is not supported on Cloudflare workers and needs to be replaced.
}
Based upon avkviring/jsonwebtoken-google which can't target WASM due to a rand
crate dependency.