diff options
author | Vika <vika@fireburn.ru> | 2022-02-21 07:34:55 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-02-21 07:34:55 +0300 |
commit | 2e54681af0bc76ed22ce43f8126a029e600ece93 (patch) | |
tree | d00626394908e9e4ec1c6169757ccf0194ba10bd /Cargo.toml | |
parent | 9e4c4551a786830bf34d74c4ef111a8ed292fa9f (diff) | |
download | kittybox-2e54681af0bc76ed22ce43f8126a029e600ece93.tar.zst |
Add a module for IndieAuth bearer token auth
require_token() uses a token endpoint URI and an HTTP client to query the token endpoint and return a User object if the user was authorized, or rejecting with IndieAuthError if not. It is recommended to use recover() and catch the IndieAuthError at the application level to show a "not authorized" error message to the user. This function is more intended for API consumption, but is general enough to permit using in other scenarios. TODO: make a variant that returns Option<User> instead of rejecting
Diffstat (limited to 'Cargo.toml')
-rw-r--r-- | Cargo.toml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml index 8b43c63..88eb6d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,9 +30,11 @@ mockito = "^0.30.0" # HTTP mocking for Rust. tempdir = "^0.3.7" # A library for managing a temporary directory and deleting all contents when it's dropped paste = "^1.0.5" # Macros for all your token pasting needs test-logger = "^0.1.0" # Simple helper to initialize env_logger before unit and integration tests +httpmock = "^0.6" # HTTP mocking library that allows you to simulate responses from HTTP based services [dependencies] async-trait = "^0.1.50" # Type erasure for async trait methods +bytes = "^1.1.0" data-encoding = "^2.3.2" # Efficient and customizable data-encoding functions like base64, base32, and hex easy-scraper = "^0.2.0" # HTML scraping library focused on ease of use ellipse = "^0.2.0" # Truncate and ellipsize strings in a human-friendly way @@ -80,4 +82,8 @@ default-features = false features = ["multipart", "compression"] [dependencies.hyper] version = "^0.14.17" -features = ["client", "stream", "runtime"] \ No newline at end of file +features = ["client", "stream", "runtime"] +[dependencies.hyper-rustls] +version = "^0.23.0" +default-features = false +features = ["webpki-tokio", "http1", "http2", "tls12", "logging"] \ No newline at end of file |