1 unstable release

0.1.0 Mar 26, 2020

#11 in #authorization-header


Used in wolfie

CC0 license

8KB
130 lines

oauth1-header

Rust CI

Generate OAuth 1.0 Authorization headers.

License

CC0


lib.rs:

Generate OAuth 1.0 Authorization headers.

Example

use oauth1_header::http::Method;
use oauth1_header::Credentials;
use std::collections::HashMap;

let mut params = HashMap::new();
params.insert("foo", "bar");
let credentials = Credentials::new(
    "some-consumer-key",
    "some-consumer-secret",
    "some-token",
    "some-token-secret",
);
let header_value = credentials.auth(&Method::GET, "https://example.com", &params);

Where header_value will contain the OAuth Protocol Parameters ready to be sent in the HTTP Authorization header.

Dependencies

~2MB
~36K SLoC