1.0.3 • Published 5 months ago
authorization-signature v1.0.3
authorization-signature
Create HTTP Authorization header values for HTTP Message Signatures.
Usage
byexample
These snippets should pass byexample
byexample -l javascript README.md
> const { Ed25519Signer } = await import("@did.coop/did-key-ed25519")
> const { createRequestWithHttpSignature } = await import("authorization-signature");
> const signer = await Ed25519Signer.generate()
> const url = new URL('http://example.com')
> const request = await createRequestWithHttpSignature( // byexample: +timeout=100
. url,
. {
. includeHeaders: [
. '(key-id)',
. '(request-target)',
. 'host',
. ],
. signer,
. }
. )
> request.headers.get('authorization')?.startsWith('Signature ')
true