Crate vigor_agent
source · [−]Expand description
Vigor
This library contains a Vigor authentication agent to manage credentials and perform HTTP/HTTPS requests.
A note regarding Ed25519: this client library supports Ed25519 authentication, however will only accept PEM-encoded keys. Formats such as OpenSSH are not guaranteed to work. The private key is expected to adhere to RFC 7468, PKCS8 and unencrypted.
Minimal format verification is done on private key material. For all intended purposes, assume the library would foolishly accept random noise as a private key. You are responsible for implementing safety checks for inappropriate private keys.
Also keep in mind that this library is purely synchronous, for the purposes of simplicity and a less bloated dependency tree. For use cases where blocking execution is inappropriate and/or inadaquete, it should be noted that synchronous code can be executed asynchronously, however not vice versa. If all else fails, the rhetorical question “have you tried threading” should come to mind.
Usage
Use Vigor::new()
to start an agent instance, after importing.
See documentation for a full list of available methods.
use vigor_agent;
fn main() {
// you're advised to apply error handling here, instead of just recklessly using .unwrap()
let mut agent = vigor_agent::Vigor::new().unwrap();
agent.init().unwrap();
println!(agent.get("http://example.com/claims/", vigor_agent::AuthMode::Auto).unwrap());
}
Structs
ConfigSchema
structures.Vigor
structures.