Koofr
Koofr API requests authenticated with a Koofr access token; mount selection, paths, and business requests remain caller-owned.
Adds a sensitive Authorization: Token token=<token> header; expires_in is ignored because the documented exchange returns no expiry.
Get started
cargo add reqsign --features koofr
use reqsign::{default_context, koofr};
// Pass the account email and an application-specific password explicitly.
let ctx = default_context();
let signer = koofr::default_signer(ctx, "me@example.com", "application-password");
let mut req = http::Request::builder()
.method(http::Method::GET)
.uri("https://app.koofr.net/api/v2/mounts/primary/files/list?path=%2F")
.body(())?
.into_parts()
.0;
// Sign in place, then send with the HTTP client you already use.
signer.sign(&mut req, None).await?;
The signer adds a sensitive Authorization: Token token=<token> header and
leaves the URI unchanged.
Credentials
LoginCredentialProvider exchanges an account email and an application-specific
password at POST https://app.koofr.net/token with a JSON body:
{"email":"me@example.com","password":"application-password"}
A successful response is {"token":"..."}. The /token JSON exchange follows
Koofr's first-party Go SDK; OpenDAL's Koofr backend uses the same exchange.
Koofr's API Swagger documents Bearer and app-password Basic schemes separately,
not this exchange. Generate the
application-specific password at the
Koofr application preferences;
do not use the account login password.
Use LoginCredentialProvider::with_endpoint for a Koofr-compatible API endpoint.
The endpoint must be an absolute HTTP(S) URI with a host, optional port, and
optional path prefix. Userinfo, query strings, fragments, dot segments,
backslashes, whitespace, and control characters are rejected. An explicit
http:// endpoint sends the email and application password in cleartext.
Reqsign sends the exchange to the configured destination; redirect policy
belongs to the configured HttpSend adapter.
StaticCredentialProvider accepts a token that the caller already holds.
Koofr's first-party SDKs do not define a production environment-variable
credential convention, so Reqsign does not discover ambient Koofr credentials.
Mount selection, paths, and business requests stay with the caller.
The exchange does not return an expiry. The token stays cached until the caller
replaces the Signer or installs a provider/context that starts a new cache.
Koofr rejecting the token does not invalidate the cache automatically; the
caller must replace the signer or its credential cache.
Credentials
Default credential chain
This provider has no ambient default source. Supply an explicit credential provider as described on this page.
Credential providers
Available ProvideCredential implementations. Construct any of them directly, reorder them, or compose them into your own chain — see Loading credentials:
LoginCredentialProvider— Email and application-specific password exchangeStaticCredentialProvider— Static access token