Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arctic

Package Overview
Dependencies
Maintainers
0
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arctic - npm Package Compare versions

Comparing version 2.0.0-next.9 to 2.0.0

5

dist/oidc.js

@@ -1,6 +0,5 @@

import { parseJWT } from "@oslojs/jwt";
import { decodeJWT } from "@oslojs/jwt";
export function decodeIdToken(idToken) {
try {
const [_header, payload, _signature] = parseJWT(idToken);
return payload;
return decodeJWT(idToken);
}

@@ -7,0 +6,0 @@ catch (e) {

14

dist/providers/amazon-cognito.js
import { createS256CodeChallenge } from "../oauth2.js";
import { createOAuth2Request, encodeBasicCredentials, sendTokenRequest, sendTokenRevocationRequest } from "../request.js";
import { createOAuth2Request, sendTokenRequest, sendTokenRevocationRequest } from "../request.js";
export class AmazonCognito {

@@ -36,5 +36,5 @@ authorizationEndpoint;

body.set("redirect_uri", this.redirectURI);
body.set("client_id", this.clientId);
body.set("client_secret", this.clientSecret);
const request = createOAuth2Request(this.tokenEndpoint, body);
const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);
request.headers.set("Authorization", `Basic ${encodedCredentials}`);
const tokens = await sendTokenRequest(request);

@@ -47,5 +47,5 @@ return tokens;

body.set("refresh_token", refreshToken);
body.set("client_id", this.clientId);
body.set("client_secret", this.clientSecret);
const request = createOAuth2Request(this.tokenEndpoint, body);
const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);
request.headers.set("Authorization", `Basic ${encodedCredentials}`);
const tokens = await sendTokenRequest(request);

@@ -57,7 +57,7 @@ return tokens;

body.set("token", token);
body.set("client_id", this.clientId);
body.set("client_secret", this.clientSecret);
const request = createOAuth2Request(this.tokenRevocationEndpoint, body);
const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);
request.headers.set("Authorization", `Basic ${encodedCredentials}`);
await sendTokenRevocationRequest(request);
}
}

@@ -45,8 +45,8 @@ import { createOAuth2Request, sendTokenRequest } from "../request.js";

const now = Math.floor(Date.now() / 1000);
const header = {
const headerJSON = JSON.stringify({
typ: "JWT",
alg: "ES256",
kid: this.keyId
};
const payload = {
});
const payloadJSON = JSON.stringify({
iss: this.teamId,

@@ -57,10 +57,10 @@ exp: now + 5 * 60,

iat: now
};
});
const signature = new Uint8Array(await crypto.subtle.sign({
name: "ECDSA",
hash: "SHA-256"
}, privateKey, createJWTSignatureMessage(header, payload)));
const jwt = encodeJWT(header, payload, signature);
}, privateKey, createJWTSignatureMessage(headerJSON, payloadJSON)));
const jwt = encodeJWT(headerJSON, payloadJSON, signature);
return jwt;
}
}
{
"name": "arctic",
"type": "module",
"version": "2.0.0-next.9",
"description": "OAuth 2.0 clients for popular providers",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"files": [
"/dist/"
],
"author": "pilcrowOnPaper",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pilcrowOnPaper/arctic"
},
"devDependencies": {
"@types/node": "^20.8.6",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"auri": "2.0.0",
"eslint": "^8.51.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vitest": "1.6.0"
},
"dependencies": {
"@oslojs/crypto": "0.6.0",
"@oslojs/encoding": "0.4.1",
"@oslojs/jwt": "0.1.0"
},
"scripts": {
"build": "rm -rf dist/* && tsc",
"format": "prettier -w .",
"lint": "eslint src",
"test": "vitest run --sequence.concurrent"
}
}
"name": "arctic",
"type": "module",
"version": "2.0.0",
"description": "OAuth 2.0 clients for popular providers",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"scripts": {
"build": "rm -rf dist/* && tsc",
"format": "prettier -w .",
"lint": "eslint src",
"test": "vitest run --sequence.concurrent"
},
"files": [
"/dist/"
],
"author": "pilcrowOnPaper",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pilcrowOnPaper/arctic"
},
"devDependencies": {
"@types/node": "^20.8.6",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"auri": "2.0.0",
"eslint": "^8.51.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vitest": "1.6.0"
},
"dependencies": {
"@oslojs/crypto": "1.0.1",
"@oslojs/encoding": "1.1.0",
"@oslojs/jwt": "0.2.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc