def sign

bend-kit-sigv4@0.11.0.1 · sigv4.bend:334

import bend-kit-sigv4@0.11.0.1/sigv4.bend as Sigv4
import Base

334# The Authorization header over exactly the headers hs: the general form, for any header set.
335# hs must include host and x-amz-date, and x-amz-security-token for temporary credentials;
336# creds.token is not added here (authorize.hash adds it). Send every header in hs.
337def sign(creds: Credentials, +region: String, +service: String, +date: String, +method: String, +path: String, +q: String, +hs: List<&2, Sigma<&2, &2, String, _ => String>>, +phash: String) -> IO(Result<&1, &1, U32 & String, String>):
338  Credentials{+access, +secret, token} = creds
339  do IO<Result<&1, &1, U32 & String, String>>:
340    s : Result<&1, &1, U32 & String, String> <- signature(secret, date, region, service, canonical(service, method, path, q, hs, phash))
341    return header.of(s, access, scope(date, region, service), signed(hs))

Uses (15)

Used by (1)