diff --git a/.gitignore b/.gitignore index 1de5659..e95e21d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -target \ No newline at end of file +target +libpam_oidc.yaml +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ebe31db..7ff5c98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,8 +36,7 @@ RUN \ USER rust_dev ENV USER rust_dev ENV HOME /home/rust_dev -# hi -# COPY ./pam-rs/pam-http/target/release/libpam_http.so /workspace/pam-rs/pam-http/target/release/libpam_http.so -COPY ./pam-oidc/target/release/libpam_oidc.so /workspace/pam-oidc/target/release/libpam_oidc.so -# COPY ./test-module/target/release/libtest_module.so /workspace/test-module/target/release/libtest_module.so + + +# COPY ./pam-oidc/target/release/libpam_oidc.so /workspace/pam-oidc/target/release/libpam_oidc.so WORKDIR /workspace \ No newline at end of file diff --git a/README.md b/README.md index 6031f94..33ef318 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,61 @@ # Rust Demo -## Start +## Deploy Instructions + +1. Acquire (see the [releases](https://github.com/vathes/pam-oauth2/releases) page) or build (see below) the appropriate `libpam_oidc.so` dynamic clib binary for your platform that provides the PAM interface to authenticate via an OIDC provider. +1. Copy `libpam_oidc.so` into the appropriate directory that your system expects new modules to be loaded e.g. on Debian, it is located in `/lib/x86_64-linux-gnu/security/`. +1. Create a service config file within the directory that your system expects for PAM e.g. on Debian, it is located in `/etc/pam.d/`. We can for instance create a service/file called `oidc` with the following contents (note the argument in the 1st line should be the path where `pam_oidc`'s config will be located): + + ```text + auth sufficient libpam_oidc.so /etc/datajoint/libpam_oidc.yaml + account optional libpam_oidc.so + ``` + + See [service_example](./service_example) for more info. + +1. In the path provided to the service config, create a config file for `pam_oidc`. See [libpam_oidc_example.yaml](./libpam_oidc_example.yaml) for more info. +1. Configure your PAM-compatible application/service to point to the `oidc` service we just created. + +## Developer Instructions + +### Build + +```bash +cd ./pam-oidc && cargo build; cd .. # DEBUG +cd ./pam-oidc && cargo build --release; cd .. # PROD +``` + +### Manually copy over new build for PAM + +```bash +docker exec -itu root pam-oauth2_app_1 cp pam-oidc/target/debug/libpam_oidc.so /lib/x86_64-linux-gnu/security/ +``` + +### Validate PAM with test cases + +```bash +python3 test.py +``` + +## --- Old Notes --- + +### Start To do in local folder `cargo init` -## Debug +### Debug `cargo run` -## Build (debug, prod) +### Build (debug, prod) `cargo build` `cargo build --release` -## test case (needed to install gcc, g++, openssl, libressl-dev, pkgconfig, OPENSSL_DIR=/etc/ssl) +### test case (needed to install gcc, g++, openssl, libressl-dev, pkgconfig, OPENSSL_DIR=/etc/ssl) *as root @@ -28,14 +67,14 @@ apt-get install libssl-dev pkg-config build-essential libpam0g-dev libpam0g -y *as user -cd /workspace/app +cd /workspace/pam-oidc cargo build echo shh | PAM_TYPE=auth PAM_USER=raphael ./pam_oidc/target/release/pam_oidc ./sample.yaml -# cross-compile +## cross-compile rustup target add x86_64-unknown-linux-gnu rustup target add x86_64-unknown-linux-musl @@ -43,7 +82,8 @@ rustup show cargo build --target x86_64-unknown-linux-musl --features vendored cargo build --release --target x86_64-unknown-linux-musl -# testing +## testing (current on 07/01/21) cp pam-oidc/test /etc/pam.d/ -cp pam-oidc/target/debug/libpam_oidc.so /lib/x86_64-linux-gnu/security/ \ No newline at end of file +cp pam-oidc/target/debug/libpam_oidc.so /lib/x86_64-linux-gnu/security/ +python3 /workspace/test.py \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8d354d9..d3a2fb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,14 @@ +# docker buildx bake --set "*.platform=linux/amd64" --load +# docker-compose up --build version: "2.4" services: app: build: . - image: pam_oidc:v0.0.2 - # environment: + image: pam_oidc:v0.0.3 + environment: + - DJ_AUTH_USER + - DJ_AUTH_PASSWORD + - DJ_AUTH_TOKEN # - RUSTFLAGS=-C link-arg=-undefined # - RUSTFLAGS=-C target-feature=-crt-static # - DISPLAY @@ -17,8 +22,17 @@ services: # ports: # - 2345:2345 volumes: - - ./sample.yaml:/workspace/sample.yaml -networks: - default: - external: - name: node-oidc-provider_default \ No newline at end of file + - ./pam-oidc/target/debug/libpam_oidc.so:/lib/x86_64-linux-gnu/security/libpam_oidc.so # add pam_oidc to available authentication schemes + - ./service_example:/etc/pam.d/oidc # add a 'oidc' config that utilizes pam_oidc + # - ./pam-oidc/target/target/libpam_oidc.so /lib/x86_64-linux-gnu/security/libpam_oidc.so + - ./libpam_oidc.yaml:/etc/datajoint/libpam_oidc.yaml # add pam_oidc-specific config +# networks: +# - network1 +# - network2 +# networks: +# network1: +# external: +# name: accountsdatajointio_main +# network2: +# external: +# name: node-oidc-provider_default \ No newline at end of file diff --git a/lib(2.0.0).rs b/lib(2.0.0).rs deleted file mode 100644 index a49a2bb..0000000 --- a/lib(2.0.0).rs +++ /dev/null @@ -1,170 +0,0 @@ -#[macro_use] -extern crate pamsm; -use pamsm::{PamServiceModule, PamLibExt, Pam, PamFlag, PamError}; -struct PamCustom; -// YAML -extern crate yaml_rust; -use std::fs::File; -use std::io::prelude::*; -use yaml_rust::yaml::{Yaml}; -use yaml_rust::YamlLoader; -// OAUTH2 -extern crate base64; -extern crate oauth2; -extern crate rand; -extern crate url; -use oauth2::prelude::*; -use oauth2::{ - AuthUrl, - ClientId, - ClientSecret, - ResourceOwnerPassword, - ResourceOwnerUsername, - Scope, - TokenResponse, - TokenUrl -}; -use oauth2::basic::BasicClient; -use url::Url; -// CURL -extern crate curl; -use curl::easy::Easy; -extern crate serde_json; -use serde_json::Value; -// LOGGING -extern crate log; -use log::{error, info, warn, LevelFilter}; -extern crate log4rs; -use log4rs::append::console::ConsoleAppender; -use log4rs::append::file::FileAppender; -use log4rs::encode::pattern::PatternEncoder; -use log4rs::config::{Appender, Config, Logger, Root}; -extern crate log_panics; -impl PamServiceModule for PamCustom { - fn authenticate(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - - log_panics::init(); - let stdout = ConsoleAppender::builder().build(); - let file = FileAppender::builder() - // .encoder(Box::new(PatternEncoder::new("{d} - {m}{n}"))) - .build("/tmp/pam_oidc.log") - .unwrap(); - let config = Config::builder() - .appender(Appender::builder().build("stdout", Box::new(stdout))) - .appender(Appender::builder().build("file", Box::new(file))) - .build(Root::builder().appender("stdout").appender("file").build(LevelFilter::Info)) - .unwrap(); - log4rs::init_config(config); - - info!("Auth detected. Proceeding...\n"); - let pam_user = match _pamh.get_user(None) { - Ok(Some(u)) => u.to_str().unwrap(), - Ok(None) => return PamError::USER_UNKNOWN, - Err(e) => return e, - }; - // println!("pam_user: {}", pam_user); - let pam_password = match _pamh.get_authtok(None) { - Ok(Some(p)) => p.to_str().unwrap(), - Ok(None) => return PamError::AUTH_ERR, - Err(e) => return e, - }; - // let pam_password = String::from("shh"); - // println!("pam_password: {}", pam_password); - // println!("pam_password Length: {}", pam_password.len()); - let config_file = &_args[0]; - let config = load_file(config_file); - // println!("config_file: {}", config_file); - // println!("client id: {}", config[0]["client.id"].as_str().unwrap()); - // println!("client secret: {}", config[0]["client.secret"].as_str().unwrap()); - // println!("url auth: {}", config[0]["url.auth"].as_str().unwrap()); - // println!("url token: {}", config[0]["url.token"].as_str().unwrap()); - // println!("url userinfo: {}", config[0]["url.userinfo"].as_str().unwrap()); - // println!("token min_size: {}", config[0]["token.min_size"].as_i64().unwrap()); - info!("Inputs read.\n"); - let mut token = pam_password.to_string(); - if pam_password.len() as i64 <= config[0]["token.min_size"].as_i64().unwrap() { - info!("Check as password."); - let client = - BasicClient::new( - ClientId::new(config[0]["client.id"].as_str().unwrap().to_string()), - Some(ClientSecret::new(config[0]["client.secret"].as_str().unwrap().to_string())), - AuthUrl::new(Url::parse(config[0]["url.auth"].as_str().unwrap()).unwrap()), - Some(TokenUrl::new(Url::parse(config[0]["url.token"].as_str().unwrap()).unwrap())) - ).add_scope(Scope::new("openid".to_string())); - let token_result = - client.exchange_password( - &ResourceOwnerUsername::new(pam_user.to_string().clone()), - &ResourceOwnerPassword::new(pam_password.to_string()) - ); - token = match token_result { - Ok(tok) => tok.access_token().secret().to_string(), - Err(_) => { - info!("Wrong password provided..."); - return PamError::AUTH_ERR - }, - } - } else { - info!("Check as token."); - } - // println!("token: {}", token); - info!("Token ready for verification.\n"); - let userinfo_url = format!("{}?access_token={}", config[0]["url.userinfo"].as_str().unwrap(), token); - // println!("userinfo: {}", userinfo_url); - let mut data = Vec::new(); - let mut handle = Easy::new(); - handle.url(&userinfo_url).unwrap(); - { - let mut transfer = handle.transfer(); - transfer.write_function(|new_data| { - data.extend_from_slice(new_data); - Ok(new_data.len()) - }).unwrap(); - transfer.perform().unwrap(); - } - let body = String::from_utf8(data).expect("body is not valid UTF8!"); - // println!("body: {}", body); - let json: Value = serde_json::from_str(&body).unwrap(); - // assert_ne!(json.get("sub"), None, "Token invalid error..."); - // println!("test: {}", json.get("sub").unwrap()); - // println!("sub: {}", json["sub"].as_str().unwrap()); - if json.get(config[0]["username.key"].as_str().unwrap().to_string()) != None && pam_user == json[config[0]["username.key"].as_str().unwrap().to_string()].as_str().unwrap() { - info!("auth success!"); - PamError::SUCCESS - } else if json.get(config[0]["username.key"].as_str().unwrap().to_string()) == None { - info!("Token invalid error..."); - PamError::AUTH_ERR - } else { - info!("auth failed!"); - PamError::AUTH_ERR - } - } - - fn chauthtok(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } - - fn open_session(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } - - fn close_session(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } - - fn setcred(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::CRED_UNAVAIL - } - - fn acct_mgmt(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } -} - -pub fn load_file(file: &str) -> std::vec::Vec { - let mut file = File::open(file).expect("Unable to open file"); - let mut contents = String::new(); - file.read_to_string(&mut contents).expect("Unable to read file"); - YamlLoader::load_from_str(&contents).unwrap() -} - -pam_module!(PamCustom); \ No newline at end of file diff --git a/lib(3.0.0-alpha.9).rs b/lib(3.0.0-alpha.9).rs deleted file mode 100644 index 6f12d11..0000000 --- a/lib(3.0.0-alpha.9).rs +++ /dev/null @@ -1,175 +0,0 @@ -#[macro_use] -extern crate pamsm; -use pamsm::{PamServiceModule, PamLibExt, Pam, PamFlag, PamError}; -struct PamCustom; -// YAML -extern crate yaml_rust; -use std::fs::File; -use std::io::prelude::*; -use yaml_rust::yaml::{Yaml}; -use yaml_rust::YamlLoader; -// OAUTH2 -extern crate base64; -extern crate oauth2; -extern crate rand; -extern crate url; -// use oauth2::prelude::*; -use oauth2::{ - AuthUrl, - ClientId, - ClientSecret, - ResourceOwnerPassword, - ResourceOwnerUsername, - Scope, - TokenResponse, - TokenUrl -}; -use oauth2::basic::BasicClient; -use oauth2::reqwest::http_client; -use url::Url; -// CURL -// extern crate curl; -// use curl::easy::Easy; -extern crate serde_json; -use serde_json::Value; -// LOGGING -extern crate log; -use log::{error, info, warn, LevelFilter}; -extern crate log4rs; -use log4rs::append::console::ConsoleAppender; -use log4rs::append::file::FileAppender; -use log4rs::encode::pattern::PatternEncoder; -use log4rs::config::{Appender, Config, Logger, Root}; -extern crate log_panics; -impl PamServiceModule for PamCustom { - fn authenticate(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - - log_panics::init(); - let stdout = ConsoleAppender::builder().build(); - let file = FileAppender::builder() - // .encoder(Box::new(PatternEncoder::new("{d} - {m}{n}"))) - .build("/tmp/pam_oidc.log") - .unwrap(); - let config = Config::builder() - .appender(Appender::builder().build("stdout", Box::new(stdout))) - .appender(Appender::builder().build("file", Box::new(file))) - .build(Root::builder().appender("stdout").appender("file").build(LevelFilter::Info)) - .unwrap(); - log4rs::init_config(config); - - info!("Auth detected. Proceeding...\n"); - let pam_user = match _pamh.get_user(None) { - Ok(Some(u)) => u.to_str().unwrap(), - Ok(None) => return PamError::USER_UNKNOWN, - Err(e) => return e, - }; - // println!("pam_user: {}", pam_user); - let pam_password = match _pamh.get_authtok(None) { - Ok(Some(p)) => p.to_str().unwrap(), - Ok(None) => return PamError::AUTH_ERR, - Err(e) => return e, - }; - // let pam_password = String::from("shh"); - // println!("pam_password: {}", pam_password); - // println!("pam_password Length: {}", pam_password.len()); - let config_file = &_args[0]; - let config = load_file(config_file); - // println!("config_file: {}", config_file); - // println!("client id: {}", config[0]["client.id"].as_str().unwrap()); - // println!("client secret: {}", config[0]["client.secret"].as_str().unwrap()); - // println!("url auth: {}", config[0]["url.auth"].as_str().unwrap()); - // println!("url token: {}", config[0]["url.token"].as_str().unwrap()); - // println!("url userinfo: {}", config[0]["url.userinfo"].as_str().unwrap()); - // println!("token min_size: {}", config[0]["token.min_size"].as_i64().unwrap()); - info!("Inputs read.\n"); - let mut token = pam_password.to_string(); - if pam_password.len() as i64 <= config[0]["token.min_size"].as_i64().unwrap() { - info!("Check as password."); - let client = - BasicClient::new( - ClientId::new(config[0]["client.id"].as_str().unwrap().to_string()), - Some(ClientSecret::new(config[0]["client.secret"].as_str().unwrap().to_string())), - // AuthUrl::new(Url::parse(config[0]["url.auth"].as_str().unwrap()).unwrap()), - AuthUrl::new(String::from(config[0]["url.auth"].as_str().unwrap())).unwrap(), - // Some(TokenUrl::new(Url::parse(config[0]["url.token"].as_str().unwrap()).unwrap())) - Some(TokenUrl::new(String::from(config[0]["url.token"].as_str().unwrap())).unwrap()) - ); - // .add_scope(Scope::new("openid".to_string())); - let token_result = - client.exchange_password( - &ResourceOwnerUsername::new(pam_user.to_string().clone()), - &ResourceOwnerPassword::new(pam_password.to_string()) - ).request(http_client); - token = match token_result { - Ok(tok) => tok.access_token().secret().to_string(), - Err(_) => { - info!("Wrong password provided..."); - return PamError::AUTH_ERR - }, - } - } else { - info!("Check as token."); - } - // println!("token: {}", token); - info!("Token ready for verification.\n"); - let userinfo_url = format!("{}?access_token={}", config[0]["url.userinfo"].as_str().unwrap(), token); - // println!("userinfo: {}", userinfo_url); - // let mut data = Vec::new(); - // let mut handle = Easy::new(); - // handle.url(&userinfo_url).unwrap(); - // { - // let mut transfer = handle.transfer(); - // transfer.write_function(|new_data| { - // data.extend_from_slice(new_data); - // Ok(new_data.len()) - // }).unwrap(); - // transfer.perform().unwrap(); - // } - // let body = String::from_utf8(data).expect("body is not valid UTF8!"); - let body = reqwest::blocking::get(&userinfo_url).unwrap().text().unwrap(); - // println!("body: {}", body); - let json: Value = serde_json::from_str(&body).unwrap(); - // assert_ne!(json.get("sub"), None, "Token invalid error..."); - // println!("test: {}", json.get("sub").unwrap()); - // println!("sub: {}", json["sub"].as_str().unwrap()); - if json.get(config[0]["username.key"].as_str().unwrap().to_string()) != None && pam_user == json[config[0]["username.key"].as_str().unwrap().to_string()].as_str().unwrap() { - info!("auth success!"); - PamError::SUCCESS - } else if json.get(config[0]["username.key"].as_str().unwrap().to_string()) == None { - info!("Token invalid error..."); - PamError::AUTH_ERR - } else { - info!("auth failed!"); - PamError::AUTH_ERR - } - } - - fn chauthtok(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } - - fn open_session(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } - - fn close_session(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } - - fn setcred(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::CRED_UNAVAIL - } - - fn acct_mgmt(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - PamError::SUCCESS - } -} - -pub fn load_file(file: &str) -> std::vec::Vec { - let mut file = File::open(file).expect("Unable to open file"); - let mut contents = String::new(); - file.read_to_string(&mut contents).expect("Unable to read file"); - YamlLoader::load_from_str(&contents).unwrap() -} - -pam_module!(PamCustom); \ No newline at end of file diff --git a/libpam_oidc_example.yaml b/libpam_oidc_example.yaml new file mode 100644 index 0000000..1c3f956 --- /dev/null +++ b/libpam_oidc_example.yaml @@ -0,0 +1,10 @@ +client.id: client_id +client.secret: client_secret +url.auth: https://accounts.datajoint.io/auth/auth +url.token: https://accounts.datajoint.io/auth/token +url.userinfo: https://accounts.datajoint.io/auth/me +username.key: sub +scopes: "openid jupyter-env:sciops-npx-demo" +token.min_size: 128 # maximum password length +log.path: /tmp/libpam_oidc.log +log.level: Error # Error || Warn || Info || Debug diff --git a/new-simple/Cargo.lock b/new-simple/Cargo.lock deleted file mode 100644 index aae69a8..0000000 --- a/new-simple/Cargo.lock +++ /dev/null @@ -1,23 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "libc" -version = "0.2.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" - -[[package]] -name = "new-simple" -version = "0.1.0" -dependencies = [ - "pam-sys", -] - -[[package]] -name = "pam-sys" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd4858311a097f01a0006ef7d0cd50bca81ec430c949d7bf95cbefd202282434" -dependencies = [ - "libc", -] diff --git a/new-simple/Cargo.toml b/new-simple/Cargo.toml deleted file mode 100644 index 6644940..0000000 --- a/new-simple/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "new-simple" -version = "0.1.0" -authors = ["guzman-raphael "] - -[dependencies] -pam-sys = "0.5.6" - -[lib] -crate-type = ["cdylib"] \ No newline at end of file diff --git a/new-simple/src/lib.rs b/new-simple/src/lib.rs deleted file mode 100644 index 9f05c0d..0000000 --- a/new-simple/src/lib.rs +++ /dev/null @@ -1,34 +0,0 @@ -#[macro_use] -extern crate pam_sys; - -use pam_sys::{PamConversation, PamHandle, PamFlag, PamReturnCode}; - -struct PamCustom; - -impl PamConversation for PamCustom { - fn authenticate(_pamh: PamHandle, _flags: PamFlag, _args: Vec) -> PamReturnCode { - println!("[DataJoint]: Starting..."); - // If you need login/password here, that works like this: - // - - // let user = match _pamh.get_user(None) { - // Ok(Some(u)) => u, - // Ok(None) => return PamError::USER_UNKNOWN, - // Err(e) => return e, - // }; - // println!("user: {:?}", user); - // // - // let pass = match _pamh.get_authtok(None) { - // Ok(Some(p)) => p, - // Ok(None) => return PamError::AUTH_ERR, - // Err(e) => return e, - // }; - - // println!("pass: {:?}", pass); - - PamReturnCode::SUCCESS - // PamError::AUTH_ERR - } -} - -pam_module!(PamCustom); \ No newline at end of file diff --git a/pam-oidc/Cargo.lock b/pam-oidc/Cargo.lock index f6a4363..25c0b20 100644 --- a/pam-oidc/Cargo.lock +++ b/pam-oidc/Cargo.lock @@ -1,22 +1,27 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] -name = "adler32" -version = "1.0.4" +name = "addr2line" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" +dependencies = [ + "gimli", +] [[package]] -name = "arc-swap" -version = "0.4.6" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b585a98a234c46fc563103e9278c9391fde1f4e6850334da895d27edb9580f62" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "arrayref" -version = "0.3.6" +name = "arc-swap" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "dabe5a181f83789739c194cbe5a897dde195078fac08568d09221fd6137a7ba8" [[package]] name = "autocfg" @@ -26,30 +31,23 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.46" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" -dependencies = [ - "backtrace-sys", - "cfg-if", - "libc", - "rustc-demangle", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fbebbe1c9d1f383a9cc7e8ccdb471b91c8d024ee9c2ca5b5346121fe8b4399" +checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" dependencies = [ + "addr2line", "cc", + "cfg-if 1.0.0", "libc", + "miniz_oxide", + "object", + "rustc-demangle", ] [[package]] @@ -63,49 +61,60 @@ dependencies = [ [[package]] name = "base64" -version = "0.11.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5ca2cd0adc3f48f9e9ea5a6bbdf9ccc0bfade884847e484d452414c7ccffb3" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.3.3" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" dependencies = [ - "arrayref", "byte-tools", ] [[package]] name = "bumpalo" -version = "3.2.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byte-tools" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -120,15 +129,21 @@ dependencies = [ [[package]] name = "bytes" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.52" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -136,15 +151,23 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chrono" -version = "0.4.11" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ + "libc", "num-integer", "num-traits", "time", + "winapi 0.3.9", ] [[package]] @@ -186,9 +209,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.7.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ "core-foundation-sys", "libc", @@ -196,24 +219,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -226,8 +249,8 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.0.1", + "cfg-if 0.1.10", "crossbeam-utils", "lazy_static", "maybe-uninit", @@ -237,12 +260,13 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils", + "maybe-uninit", ] [[package]] @@ -251,55 +275,55 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.0.1", + "cfg-if 0.1.10", "lazy_static", ] [[package]] name = "digest" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ "generic-array", ] [[package]] name = "dtoa" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.22" +version = "0.8.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] name = "error-chain" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" dependencies = [ "version_check", ] [[package]] name = "failure" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" dependencies = [ "backtrace", "failure_derive", @@ -307,9 +331,9 @@ dependencies = [ [[package]] name = "failure_derive" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", @@ -325,11 +349,11 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "flate2" -version = "1.0.14" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crc32fast", "libc", "miniz_oxide", @@ -337,9 +361,9 @@ dependencies = [ [[package]] name = "fnv" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" @@ -356,6 +380,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding 2.1.0", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -380,24 +414,24 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.29" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures-channel" -version = "0.3.4" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.4" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" [[package]] name = "futures-cpupool" @@ -411,56 +445,75 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.4" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" [[package]] name = "futures-sink" -version = "0.3.4" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" +checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" [[package]] name = "futures-task" -version = "0.3.4" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" [[package]] name = "futures-util" -version = "0.3.4" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" dependencies = [ + "autocfg 1.0.1", "futures-core", "futures-io", "futures-task", "memchr", + "pin-project-lite 0.2.7", "pin-utils", "slab", ] [[package]] name = "generic-array" -version = "0.9.0" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" + [[package]] name = "h2" version = "0.1.26" @@ -481,28 +534,35 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377038bf3c89d18d6ca1431e7a5027194fbd724ca10592b9487ede5e8e144f42" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" dependencies = [ - "bytes 0.5.4", + "bytes 0.5.6", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.1", + "http 0.2.5", "indexmap", - "log", "slab", - "tokio 0.2.20", + "tokio 0.2.25", "tokio-util", + "tracing", + "tracing-futures", ] +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + [[package]] name = "hermit-abi" -version = "0.1.12" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -520,11 +580,11 @@ dependencies = [ [[package]] name = "http" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" dependencies = [ - "bytes 0.5.4", + "bytes 1.1.0", "fnv", "itoa", ] @@ -547,15 +607,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ - "bytes 0.5.4", - "http 0.2.1", + "bytes 0.5.6", + "http 0.2.5", ] [[package]] name = "httparse" -version = "1.3.4" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" + +[[package]] +name = "httpdate" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "humantime" @@ -568,9 +634,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.35" +version = "0.12.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" dependencies = [ "bytes 0.4.12", "futures", @@ -598,25 +664,25 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.5" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96816e1d921eca64d208a85aab4f7798455a8e34229ee5a88c935bdee1b78b14" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" dependencies = [ - "bytes 0.5.4", + "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", - "h2 0.2.4", - "http 0.2.1", + "h2 0.2.7", + "http 0.2.5", "http-body 0.3.1", "httparse", + "httpdate", "itoa", - "log", - "net2", "pin-project", - "time", - "tokio 0.2.20", + "socket2", + "tokio 0.2.25", "tower-service", + "tracing", "want 0.3.0", ] @@ -628,21 +694,21 @@ checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" dependencies = [ "bytes 0.4.12", "futures", - "hyper 0.12.35", + "hyper 0.12.36", "native-tls", "tokio-io", ] [[package]] name = "hyper-tls" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" +checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" dependencies = [ - "bytes 0.5.4", - "hyper 0.13.5", + "bytes 0.5.6", + "hyper 0.13.10", "native-tls", - "tokio 0.2.20", + "tokio 0.2.25", "tokio-tls", ] @@ -659,9 +725,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094" dependencies = [ "matches", "unicode-bidi", @@ -670,11 +736,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.3.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", + "hashbrown", ] [[package]] @@ -686,17 +753,23 @@ dependencies = [ "libc", ] +[[package]] +name = "ipnet" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" + [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "js-sys" -version = "0.3.39" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa5a448de267e7358beaf4a5d849518fe9a0c13fce7afd44b06e68550e5562a7" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -719,15 +792,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.69" +version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" +checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" [[package]] name = "linked-hash-map" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" @@ -740,11 +813,11 @@ dependencies = [ [[package]] name = "log" -version = "0.4.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "serde", ] @@ -785,14 +858,14 @@ dependencies = [ "serde_yaml", "thread-id", "typemap", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "maybe-uninit" @@ -802,17 +875,17 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", ] [[package]] @@ -833,20 +906,21 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.3.6" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ - "adler32", + "adler", + "autocfg 1.0.1", ] [[package]] name = "mio" -version = "0.6.22" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -861,9 +935,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" dependencies = [ "kernel32-sys", "net2", @@ -873,9 +947,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" dependencies = [ "lazy_static", "libc", @@ -891,32 +965,32 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.34" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "num-integer" -version = "0.1.42" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", ] [[package]] @@ -931,50 +1005,71 @@ dependencies = [ [[package]] name = "oauth2" -version = "3.0.0-alpha.9" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b14f49da5e76e4f63a67f8aa86441b5d17ced278a53d058bf25ed26c57fe676" +checksum = "88d21857941367fdd2514553ff1578254267afd9c1e69d2d8592ba98223560a0" dependencies = [ - "base64 0.10.1", + "base64 0.12.3", "failure", "failure_derive", "http 0.1.21", - "rand 0.6.5", + "rand 0.7.3", "reqwest 0.9.24", "serde", "serde_json", "sha2", "unicode-normalization", - "url 2.1.1", + "url 2.2.2", ] +[[package]] +name = "object" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "openssl" -version = "0.10.29" +version = "0.10.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" +checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" dependencies = [ "bitflags", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", - "lazy_static", "libc", + "once_cell", "openssl-sys", ] [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.55" +version = "0.9.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7717097d810a0f2e2323f9e5d11e71608355e24828410b55b9d4f18aa5f9a5d8" +checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "cc", "libc", "pkg-config", @@ -983,35 +1078,35 @@ dependencies = [ [[package]] name = "ordered-float" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" dependencies = [ "num-traits", ] [[package]] name = "pam-oidc" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "base64 0.12.0", + "base64 0.12.3", "log", "log-panics", "log4rs", "oauth2", "pamsm", + "pkg-version", "rand 0.7.3", - "reqwest 0.10.4", + "reqwest 0.10.10", "serde_json", - "url 1.7.2", "yaml-rust", ] [[package]] name = "pamsm" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0477e904be95ca350676c9e9e73776d2316b7a33d3d9fb72bc56884a2366e307" +checksum = "1643a3181447f2b147152a240b58644260a759f9fe764007edccdc160792ba02" [[package]] name = "parking_lot" @@ -1040,13 +1135,13 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "rustc_version", - "smallvec 0.6.13", - "winapi 0.3.8", + "smallvec 0.6.14", + "winapi 0.3.9", ] [[package]] @@ -1055,12 +1150,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", "libc", - "redox_syscall", - "smallvec 1.4.0", - "winapi 0.3.8", + "redox_syscall 0.1.57", + "smallvec 1.7.0", + "winapi 0.3.9", ] [[package]] @@ -1077,18 +1172,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project" -version = "0.4.10" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e3dcd42688c05a66f841d22c5d8390d9a5d4c9aaf57b9285eae4900a080063" +checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "0.4.10" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4d7346ac577ff1296e06a418e7618e22655bae834d4970cb6e39d6da8119969" +checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ "proc-macro2", "quote", @@ -1097,9 +1192,15 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.4" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pin-utils" @@ -1109,21 +1210,46 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" + +[[package]] +name = "pkg-version" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e848f61ee4b2010345e65757e427a077213af1cee5d3e6a02e4a151dabca377" +dependencies = [ + "pkg-version-impl", + "proc-macro-hack", +] + +[[package]] +name = "pkg-version-impl" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "1564bf5d476bf4a5eac420b88c500454c000dca79cef0a2e4304a1fe34361a3b" +dependencies = [ + "proc-macro-hack", +] [[package]] name = "ppv-lite86" -version = "0.2.6" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.10" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" +checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" dependencies = [ "unicode-xid", ] @@ -1135,10 +1261,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" dependencies = [ "error-chain", - "idna 0.2.0", + "idna 0.2.1", "lazy_static", "regex", - "url 2.1.1", + "url 2.2.2", ] [[package]] @@ -1149,9 +1275,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.4" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -1172,7 +1298,7 @@ dependencies = [ "rand_os", "rand_pcg", "rand_xorshift", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1181,13 +1307,25 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", ] +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", +] + [[package]] name = "rand_chacha" version = "0.1.1" @@ -1208,6 +1346,16 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + [[package]] name = "rand_core" version = "0.3.1" @@ -1229,7 +1377,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.3", ] [[package]] @@ -1250,6 +1407,15 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + [[package]] name = "rand_isaac" version = "0.1.1" @@ -1267,7 +1433,7 @@ checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ "libc", "rand_core 0.4.2", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1281,7 +1447,7 @@ dependencies = [ "libc", "rand_core 0.4.2", "rdrand", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1314,32 +1480,41 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] [[package]] name = "regex" -version = "1.3.7" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.17" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1356,7 +1531,7 @@ dependencies = [ "flate2", "futures", "http 0.1.21", - "hyper 0.12.35", + "hyper 0.12.36", "hyper-tls 0.3.2", "log", "mime", @@ -1373,24 +1548,25 @@ dependencies = [ "tokio-timer", "url 1.7.2", "uuid", - "winreg", + "winreg 0.6.2", ] [[package]] name = "reqwest" -version = "0.10.4" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" +checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" dependencies = [ - "base64 0.11.0", - "bytes 0.5.4", + "base64 0.13.0", + "bytes 0.5.6", "encoding_rs", "futures-core", "futures-util", - "http 0.2.1", + "http 0.2.5", "http-body 0.3.1", - "hyper 0.13.5", - "hyper-tls 0.4.1", + "hyper 0.13.10", + "hyper-tls 0.4.3", + "ipnet", "js-sys", "lazy_static", "log", @@ -1398,24 +1574,23 @@ dependencies = [ "mime_guess", "native-tls", "percent-encoding 2.1.0", - "pin-project-lite", + "pin-project-lite 0.2.7", "serde", - "serde_urlencoded 0.6.1", - "time", - "tokio 0.2.20", + "serde_urlencoded 0.7.0", + "tokio 0.2.25", "tokio-tls", - "url 2.1.1", + "url 2.2.2", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "winreg 0.7.0", ] [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_version" @@ -1428,18 +1603,18 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "schannel" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039c25b130bd8c1321ee2d7de7fde2659fa9c2744e4bb29711cfc852ea53cd19" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1450,9 +1625,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "0.4.3" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f331b9025654145cd425b9ded0caf8f5ae0df80d418b326e2dc1c3dc5eb0620" +checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" dependencies = [ "bitflags", "core-foundation", @@ -1463,9 +1638,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "0.4.3" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" dependencies = [ "core-foundation-sys", "libc", @@ -1488,9 +1663,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.106" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] @@ -1507,9 +1682,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.106" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2", "quote", @@ -1518,9 +1693,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.52" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -1541,60 +1716,71 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" dependencies = [ - "dtoa", + "form_urlencoded", "itoa", + "ryu", "serde", - "url 2.1.1", ] [[package]] name = "serde_yaml" -version = "0.8.11" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" +checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af" dependencies = [ "dtoa", - "linked-hash-map", + "indexmap", "serde", "yaml-rust", ] [[package]] name = "sha2" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" dependencies = [ "block-buffer", - "byte-tools", "digest", "fake-simd", + "opaque-debug", ] [[package]] name = "slab" -version = "0.4.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ "maybe-uninit", ] [[package]] name = "smallvec" -version = "1.4.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" + +[[package]] +name = "socket2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "winapi 0.3.9", +] [[package]] name = "string" @@ -1607,9 +1793,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.18" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ "proc-macro2", "quote", @@ -1618,9 +1804,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", @@ -1630,16 +1816,16 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "rand 0.7.3", - "redox_syscall", + "rand 0.8.4", + "redox_syscall 0.2.10", "remove_dir_all", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1649,8 +1835,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" dependencies = [ "libc", - "redox_syscall", - "winapi 0.3.8", + "redox_syscall 0.1.57", + "winapi 0.3.9", ] [[package]] @@ -1660,7 +1846,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1684,11 +1870,11 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.20" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c1d570eb1a36f0345a5ce9c6c6e665b70b73d11236912c0b477616aeec47b1" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ - "bytes 0.5.4", + "bytes 0.5.6", "fnv", "futures-core", "iovec", @@ -1696,7 +1882,7 @@ dependencies = [ "memchr", "mio", "num_cpus", - "pin-project-lite", + "pin-project-lite 0.1.12", "slab", ] @@ -1816,12 +2002,12 @@ dependencies = [ [[package]] name = "tokio-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bde02a3a5291395f59b06ec6945a3077602fac2b07eeeaf0dee2122f3619828" +checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" dependencies = [ "native-tls", - "tokio 0.2.20", + "tokio 0.2.25", ] [[package]] @@ -1830,19 +2016,50 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "bytes 0.5.4", + "bytes 0.5.6", "futures-core", "futures-sink", "log", - "pin-project-lite", - "tokio 0.2.20", + "pin-project-lite 0.1.12", + "tokio 0.2.25", ] [[package]] name = "tower-service" -version = "0.3.0" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" + +[[package]] +name = "tracing" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +dependencies = [ + "cfg-if 1.0.0", + "log", + "pin-project-lite 0.2.7", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] [[package]] name = "traitobject" @@ -1852,9 +2069,9 @@ checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" [[package]] name = "try-lock" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try_from" @@ -1862,7 +2079,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -1876,9 +2093,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "unicase" @@ -1891,12 +2108,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -1904,14 +2118,14 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09c8070a9942f5e7cfccd93f490fdebd230ee3c3c9f107cb25bad5351ef671cf" dependencies = [ - "smallvec 0.6.13", + "smallvec 0.6.14", ] [[package]] name = "unicode-xid" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "unsafe-any" @@ -1935,11 +2149,12 @@ dependencies = [ [[package]] name = "url" -version = "2.1.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ - "idna 0.2.0", + "form_urlencoded", + "idna 0.2.1", "matches", "percent-encoding 2.1.0", ] @@ -1955,15 +2170,15 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "want" @@ -1992,13 +2207,19 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasm-bindgen" -version = "0.2.62" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c7d40d09cdbf0f4895ae58cf57d92e1e57a9dd8ed2e8390514b54a47cc5551" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "serde", "serde_json", "wasm-bindgen-macro", @@ -2006,9 +2227,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.62" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3972e137ebf830900db522d6c8fd74d1900dcfc733462e9a12e942b00b4ac94" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", @@ -2021,11 +2242,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.12" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a369c5e1dfb7569e14d62af4da642a3cbc2f9a3652fe586e26ac22222aa4b04" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -2033,9 +2254,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.62" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd85aa2c579e8892442954685f0d801f9129de24fa2136b2c6a539c76b65776" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2043,9 +2264,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.62" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb197bd3a47553334907ffd2f16507b4f4f01bbec3ac921a7719e0decdfe72a" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", @@ -2056,15 +2277,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.62" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91c2916119c17a8e316507afaaa2dd94b47646048014bbdf6bef098c1bb58ad" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "web-sys" -version = "0.3.39" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc359e5dd3b46cb9687a051d50a2fdd228e4ba7cf6fcf861a5365c3d671a642" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2078,9 +2299,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -2110,7 +2331,16 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", +] + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.9", ] [[package]] @@ -2125,9 +2355,9 @@ dependencies = [ [[package]] name = "yaml-rust" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] diff --git a/pam-oidc/Cargo.toml b/pam-oidc/Cargo.toml index be27f6d..aa21ab4 100644 --- a/pam-oidc/Cargo.toml +++ b/pam-oidc/Cargo.toml @@ -1,20 +1,20 @@ [package] name = "pam-oidc" -version = "0.1.0" +version = "0.1.1" authors = ["guzman-raphael "] [dependencies] -yaml-rust = "0.4" +yaml-rust = "0.4.5" base64 = "0.12.0" oauth2 = "3.0.0-alpha.9" rand = "0.7.3" -url = "1.7.2" reqwest = { version = "0.10.4", features = ["blocking"] } serde_json = "1.0.52" log = "0.4.8" log4rs = "0.11.0" log-panics = "2.0.0" pamsm = { version = "0.3.3", features = ["libpam"] } +pkg-version = "1.0.0" [lib] crate-type = ["cdylib"] diff --git a/pam-oidc/src/lib.rs b/pam-oidc/src/lib.rs index 6de7ede..ac75b30 100644 --- a/pam-oidc/src/lib.rs +++ b/pam-oidc/src/lib.rs @@ -1,19 +1,36 @@ +// general +use std::str::FromStr; +// crate metadata +extern crate pkg_version; +use pkg_version::{ + pkg_version_major, + pkg_version_minor, + pkg_version_patch, +}; +// pam #[macro_use] extern crate pamsm; -use pamsm::{PamServiceModule, PamLibExt, Pam, PamFlag, PamError}; +use pamsm::{ + PamServiceModule, + PamLibExt, + Pam, + PamFlag, + PamError, +}; struct PamCustom; -// YAML +// yaml extern crate yaml_rust; use std::fs::File; use std::io::prelude::*; -use yaml_rust::yaml::{Yaml}; +use yaml_rust::yaml::Yaml; use yaml_rust::YamlLoader; -// OAUTH2 +// json +extern crate serde_json; +use serde_json::Value; +// oauth2 extern crate base64; extern crate oauth2; -extern crate rand; -extern crate url; -// use oauth2::prelude::*; +// extern crate url; use oauth2::{ AuthUrl, ClientId, @@ -22,126 +39,173 @@ use oauth2::{ ResourceOwnerUsername, Scope, TokenResponse, - TokenUrl + TokenUrl, +}; +use oauth2::basic::{ + BasicClient }; -use oauth2::basic::BasicClient; use oauth2::reqwest::http_client; -use url::Url; -// CURL -// extern crate curl; -// use curl::easy::Easy; -extern crate serde_json; -use serde_json::Value; -// LOGGING +// logging extern crate log; -use log::{error, info, warn, LevelFilter}; extern crate log4rs; +extern crate log_panics; +extern crate rand; +use log::{ + error, + info, + debug, + LevelFilter, +}; use log4rs::append::console::ConsoleAppender; use log4rs::append::file::FileAppender; use log4rs::encode::pattern::PatternEncoder; -use log4rs::config::{Appender, Config, Logger, Root}; -extern crate log_panics; +use log4rs::config::{ + Appender, + Config, + Root, +}; +use rand::Rng; +// interface impl PamServiceModule for PamCustom { fn authenticate(_pamh: Pam, _flags: PamFlag, _args: Vec) -> PamError { - + // Load libpam_oidc.so's YAML config file + let crate_version = format!("{}.{}.{}", pkg_version_major!(), pkg_version_minor!(), + pkg_version_patch!()); + let config_file = &_args[0]; + let config = load_file(config_file); + // Initiate logger + let mut rng = rand::thread_rng(); + let log_id: u32 = rng.gen(); log_panics::init(); - let stdout = ConsoleAppender::builder().build(); + let stdout = ConsoleAppender::builder() + .encoder(Box::new(PatternEncoder::new(format!( + "[{{d(%Y-%m-%d %H:%M:%S%.3f)}}][{}][{{l}}][{}]: {{m}}{{n}}", + crate_version, + log_id, + ) + .as_str() + ))) + .build(); let file = FileAppender::builder() - // .encoder(Box::new(PatternEncoder::new("{d} - {m}{n}"))) - .build("/tmp/pam_oidc.log") + .encoder(Box::new(PatternEncoder::new(format!( + "[{{d(%Y-%m-%d %H:%M:%S%.3f)}}][{}][{{l}}][{}]: {{m}}{{n}}", + crate_version, + log_id, + ) + .as_str() + ))) + .build(config[0]["log.path"].as_str().unwrap().to_string()) .unwrap(); - let config = Config::builder() + let log_config = Config::builder() .appender(Appender::builder().build("stdout", Box::new(stdout))) .appender(Appender::builder().build("file", Box::new(file))) - .build(Root::builder().appender("stdout").appender("file").build(LevelFilter::Info)) + .build( + Root::builder().appender("stdout").appender("file") + .build(LevelFilter::from_str(&config[0]["log.level"].as_str().unwrap() + .to_string()).unwrap()) + ) .unwrap(); - log4rs::init_config(config); - - info!("Auth detected. Proceeding...\n"); + match log4rs::init_config(log_config) { + Ok(_) => debug!("Logging successfully initialized."), + Err(_) => return PamError::AUTH_ERR, + }; + // Initialize user and password supplied + info!("Auth detected. Proceeding..."); let pam_user = match _pamh.get_user(None) { Ok(Some(u)) => u.to_str().unwrap(), Ok(None) => return PamError::USER_UNKNOWN, Err(e) => return e, }; - // println!("pam_user: {}", pam_user); + debug!("pam_user: {}", pam_user); let pam_password = match _pamh.get_authtok(None) { Ok(Some(p)) => p.to_str().unwrap(), Ok(None) => return PamError::AUTH_ERR, Err(e) => return e, }; - // let pam_password = String::from("shh"); - // println!("pam_password: {}", pam_password); - // println!("pam_password Length: {}", pam_password.len()); - let config_file = &_args[0]; - let config = load_file(config_file); - // println!("config_file: {}", config_file); - // println!("client id: {}", config[0]["client.id"].as_str().unwrap()); - // println!("client secret: {}", config[0]["client.secret"].as_str().unwrap()); - // println!("url auth: {}", config[0]["url.auth"].as_str().unwrap()); - // println!("url token: {}", config[0]["url.token"].as_str().unwrap()); - // println!("url userinfo: {}", config[0]["url.userinfo"].as_str().unwrap()); - // println!("token min_size: {}", config[0]["token.min_size"].as_i64().unwrap()); - info!("Inputs read.\n"); - let mut token = pam_password.to_string(); - info!("Input min_size: {}.", config[0]["token.min_size"].as_i64().unwrap()); - info!("Actual pass_size: {}.", pam_password.len() as i64); - if pam_password.len() as i64 <= config[0]["token.min_size"].as_i64().unwrap() { + debug!("config_file: {}", config_file); + debug!("client id: {}", config[0]["client.id"].as_str().unwrap()); + debug!("client secret: {}", config[0]["client.secret"].as_str().unwrap()); + debug!("url auth: {}", config[0]["url.auth"].as_str().unwrap()); + debug!("url token: {}", config[0]["url.token"].as_str().unwrap()); + debug!("url userinfo: {}", config[0]["url.userinfo"].as_str().unwrap()); + debug!("input min_size: {}", config[0]["token.min_size"].as_i64().unwrap()); + debug!("requested scopes: {}", config[0]["scopes"].as_str().unwrap().to_string()); + debug!("pam_password: {}", pam_password); + debug!("actual pass_size: {}", pam_password.len() as i64); + info!("Inputs read."); + let mut access_token = pam_password.to_string(); + if pam_password.len() as i64 > config[0]["token.min_size"].as_i64().unwrap() { + // If passing bearer token as password + info!("Check as token."); + } else { + // If passing password directly info!("Check as password."); let client = BasicClient::new( ClientId::new(config[0]["client.id"].as_str().unwrap().to_string()), - Some(ClientSecret::new(config[0]["client.secret"].as_str().unwrap().to_string())), - // AuthUrl::new(Url::parse(config[0]["url.auth"].as_str().unwrap()).unwrap()), - AuthUrl::new(String::from(config[0]["url.auth"].as_str().unwrap())).unwrap(), - // Some(TokenUrl::new(Url::parse(config[0]["url.token"].as_str().unwrap()).unwrap())) - Some(TokenUrl::new(String::from(config[0]["url.token"].as_str().unwrap())).unwrap()) + Some(ClientSecret::new( + config[0]["client.secret"].as_str().unwrap().to_string() + )), + AuthUrl::new(String::from(config[0]["url.auth"].as_str().unwrap())) + .unwrap(), + Some(TokenUrl::new( + String::from(config[0]["url.token"].as_str().unwrap()) + ) + .unwrap()), ); - // .add_scope(Scope::new("openid".to_string())); - let token_result = - client.exchange_password( - &ResourceOwnerUsername::new(pam_user.to_string().clone()), - &ResourceOwnerPassword::new(pam_password.to_string()) - ).request(http_client); - token = match token_result { + let token_result = client.exchange_password( + &ResourceOwnerUsername::new(pam_user.to_string().clone()), + &ResourceOwnerPassword::new(pam_password.to_string()) + ) + .add_scope(Scope::new(config[0]["scopes"].as_str().unwrap().to_string())) + .request(http_client); + access_token = match token_result { Ok(tok) => tok.access_token().secret().to_string(), - Err(_) => { - info!("Wrong password provided..."); + Err(e) => { + error!("Wrong password provided. Details: {:?}", e); return PamError::AUTH_ERR }, - } - } else { - info!("Check as token."); + }; } - // println!("token: {}", token); - info!("Token ready for verification.\n"); - let userinfo_url = format!("{}?access_token={}", config[0]["url.userinfo"].as_str().unwrap(), token); - // println!("userinfo: {}", userinfo_url); - // let mut data = Vec::new(); - // let mut handle = Easy::new(); - // handle.url(&userinfo_url).unwrap(); - // { - // let mut transfer = handle.transfer(); - // transfer.write_function(|new_data| { - // data.extend_from_slice(new_data); - // Ok(new_data.len()) - // }).unwrap(); - // transfer.perform().unwrap(); - // } - // let body = String::from_utf8(data).expect("body is not valid UTF8!"); + // Determine assigned scopes + debug!("access_token: {}", access_token); + let jwt_payload = access_token.split('.').collect::>()[1]; + debug!("jwt_payload: {}", jwt_payload); + let jwt_payload_decoded = base64::decode(jwt_payload).unwrap(); + let jwt_payload_str = std::str::from_utf8(&jwt_payload_decoded).unwrap(); + debug!("jwt_payload_str: {}", jwt_payload_str); + let jwt_payload: Value = serde_json::from_str(&jwt_payload_str).unwrap(); + let assigned_scopes = jwt_payload.get("scope").unwrap().as_str().unwrap(); + debug!("assigned_scopes: {}", assigned_scopes); + // Verify token + info!("Verirying token."); + let userinfo_url = format!("{}?access_token={}", + config[0]["url.userinfo"].as_str().unwrap(), + access_token); + debug!("userinfo_url: {}", userinfo_url); let body = reqwest::blocking::get(&userinfo_url).unwrap().text().unwrap(); - // println!("body: {}", body); + debug!("body: {}", body); let json: Value = serde_json::from_str(&body).unwrap(); - // assert_ne!(json.get("sub"), None, "Token invalid error..."); - // println!("test: {}", json.get("sub").unwrap()); - // println!("sub: {}", json["sub"].as_str().unwrap()); - if json.get(config[0]["username.key"].as_str().unwrap().to_string()) != None && pam_user == json[config[0]["username.key"].as_str().unwrap().to_string()].as_str().unwrap() { - info!("auth success!"); + debug!("token's user: {:?}", json.get("sub")); + if json.get(config[0]["username.key"].as_str().unwrap().to_string()) != None && + pam_user == json[config[0]["username.key"].as_str().unwrap().to_string()] + .as_str().unwrap() && + config[0]["scopes"].as_str().unwrap().to_string() == assigned_scopes { + // If username defined in token, it matches pam_user, and the scopes satisfy + info!("Auth success!"); PamError::SUCCESS } else if json.get(config[0]["username.key"].as_str().unwrap().to_string()) == None { - info!("Token invalid error..."); + // If username not defined in token + error!("Token invalid error."); PamError::AUTH_ERR } else { - info!("auth failed!"); + debug!("user defined? {}", json.get( + config[0]["username.key"].as_str().unwrap().to_string()) != None); + debug!("user matches? {}", pam_user == json[ + config[0]["username.key"].as_str().unwrap().to_string()].as_str().unwrap()); + debug!("scopes satisfied? {}", config[0]["scopes"].as_str().unwrap() + .to_string() == assigned_scopes); + error!("Auth failed!"); PamError::AUTH_ERR } } @@ -174,4 +238,4 @@ pub fn load_file(file: &str) -> std::vec::Vec { YamlLoader::load_from_str(&contents).unwrap() } -pam_module!(PamCustom); \ No newline at end of file +pam_module!(PamCustom); diff --git a/pam-oidc/test b/pam-oidc/test deleted file mode 100644 index 754c453..0000000 --- a/pam-oidc/test +++ /dev/null @@ -1,2 +0,0 @@ -auth sufficient libpam_oidc.so /workspace/sample.yaml -account optional libpam_oidc.so \ No newline at end of file diff --git a/pam-rs b/pam-rs deleted file mode 160000 index 4bb68d3..0000000 --- a/pam-rs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4bb68d314deadee0985c2f4f12cc952e5e17cd1e diff --git a/sample.yaml b/sample.yaml deleted file mode 100644 index e4d76bd..0000000 --- a/sample.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -client.id: diff -client.secret: one -url.auth: http://oauth2_demo:3000/auth -url.token: http://oauth2_demo:3000/token -url.userinfo: http://oauth2_demo:3000/me -username.key: sub -token.min_size: 128 -# log.path: /tmp/new/raphael.log -# client.id: 5tWuoIz5qKcgCJrIfKenMfwzhlkLaYMJ -# client.secret: 8L0twTVkcIAoa3IoBLfwjGmEP46XsE6b -# url.auth: https://datajoint.io/auth/auth -# url.token: https://datajoint.io/auth/token -# url.userinfo: https://datajoint.io/auth/me -# token.min_size: 128 \ No newline at end of file diff --git a/service_example b/service_example new file mode 100644 index 0000000..ceddec1 --- /dev/null +++ b/service_example @@ -0,0 +1,2 @@ +auth sufficient libpam_oidc.so /etc/datajoint/libpam_oidc.yaml +account optional libpam_oidc.so \ No newline at end of file diff --git a/test.py b/test.py index 5357c3f..d64ba9d 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,12 @@ +import os import pam + + +## simple test for user:password p = pam.pam() -print(p.authenticate('raphael','anything',service='test')) -p = pam.pam() -print(p.authenticate('raphael','jasgdjkaashgdkjashgdkjasghdkjaashgdkjasashgdjkasashgdkjasashgdjkasashgdjkasasghdkjasashgdkjsashgdkjassghdkjasasghdjkasasghdkjassghdkjassghdkjasasghajskdghasjkdgh',service='test')) +print(p.authenticate(os.getenv('DJ_AUTH_USER'), os.getenv('DJ_AUTH_PASSWORD'), service='oidc')) + + +## simple test for user:token +# p = pam.pam() +# print(p.authenticate(os.getenv('DJ_AUTH_USER'), os.getenv('DJ_AUTH_TOKEN'), service='oidc'))