This package has been archived, and as such it is read-only.
@andreivarapayeu/oauth-1-0a@1.0.1
latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
82%
Published
5 months ago (1.0.1)
OAuth 1.0a Request Authorization for Deno
OAuth 1.0a Request Authorization module for Deno with JSR and std packages support. This is an updated fork with modern Deno ecosystem integration.
Usage
Use OAuthClient object to sign an HTTP request with consumer
and token credentials. You get an Authorization header that can be added to an
actual request.
import * as oauth from "jsr:@andreivarapayeu/oauth-1-0a"; const client = new oauth.OAuthClient({ consumer: { key: "appkey-0123456789abcdef", secret: "appsecret-00112233445566778899aabbccddeeff", }, signature: oauth.HMAC_SHA1, }); const auth = oauth.toAuthHeader(client.sign( "PATCH", "https://api.example.com/profile", { token: { key: "userkey-abcdef0123456789", secret: "usersecret-aabbccddeeff00112233445566778899", }, body: new URLSearchParams({ status: "busy" }), }, )); console.log("Authorization:", auth);
Test
$ git clone https://github.com/andreivarapayeu/deno-oauth-1.0a $ cd deno-oauth-1.0a $ deno test --allow-all
License
MIT License.
This codebase is a major rework of ddo/oauth-1.0a v2.2.6 in Deno. Design and many of the tests are inherited from the original work, a copy of which is kept in the "original" branch.
Add Package
deno add jsr:@andreivarapayeu/oauth-1-0a
Import symbol
import * as oauth____a from "@andreivarapayeu/oauth-1-0a";
Import directly with a jsr specifier
import * as oauth____a from "jsr:@andreivarapayeu/oauth-1-0a";
Add Package
pnpm i jsr:@andreivarapayeu/oauth-1-0a
pnpm dlx jsr add @andreivarapayeu/oauth-1-0a
Import symbol
import * as oauth____a from "@andreivarapayeu/oauth-1-0a";
Add Package
yarn add jsr:@andreivarapayeu/oauth-1-0a
yarn dlx jsr add @andreivarapayeu/oauth-1-0a
Import symbol
import * as oauth____a from "@andreivarapayeu/oauth-1-0a";
Add Package
vlt install jsr:@andreivarapayeu/oauth-1-0a
Import symbol
import * as oauth____a from "@andreivarapayeu/oauth-1-0a";
Add Package
npx jsr add @andreivarapayeu/oauth-1-0a
Import symbol
import * as oauth____a from "@andreivarapayeu/oauth-1-0a";
Add Package
bunx jsr add @andreivarapayeu/oauth-1-0a
Import symbol
import * as oauth____a from "@andreivarapayeu/oauth-1-0a";