Socket
Socket
Sign inDemoInstall

cloudflare-apple-sign-in

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

1

build/AppleSignIn.d.ts

@@ -123,3 +123,2 @@ export interface AppleSignInOptions {

private privateKey;
private jwksClient;
constructor(options: AppleSignInOptions);

@@ -126,0 +125,0 @@ /**

32

build/AppleSignIn.js

@@ -1,3 +0,1 @@

//@ts-ignore
import jwksClient from "jwks-rsa-browser";
import jwt from "@tsndr/cloudflare-worker-jwt";

@@ -23,9 +21,2 @@ export class AppleSignIn {

this.privateKey = privateKey;
/**
* Create jwks instance that caches 5 kid's up to 10 minutes to reduce amount calls to apple auth keys endpoint.
* @link https://github.com/auth0/node-jwks-rsa#caching
*/
this.jwksClient = jwksClient({
jwksUri: "https://appleid.apple.com/auth/keys",
});
}

@@ -147,11 +138,16 @@ /**

getAppleSigningKey(kid) {
return new Promise((resolve, reject) => {
this.jwksClient.getSigningKey(kid, (err, key) => {
if (err || key === undefined) {
reject(err);
}
else {
resolve(key);
}
});
const jwksUri = "https://appleid.apple.com/auth/keys";
return fetch(jwksUri)
.then(response => {
if (!response.ok) {
throw new Error(`Failed to fetch JWKS: ${response.statusText}`);
}
return response.json();
})
.then((jwks) => {
const key = jwks.keys.find((k) => k.kid === kid);
if (!key) {
throw new Error(`Key with kid ${kid} not found in JWKS`);
}
return key;
});

@@ -158,0 +154,0 @@ }

{
"name": "cloudflare-apple-sign-in",
"version": "1.0.3",
"version": "1.0.4",
"description": "A forked Apple sign-in REST API implementation adapted for Cloudflare Workers.",

@@ -53,4 +53,3 @@ "main": "build/AppleSignIn.js",

"dependencies": {
"@tsndr/cloudflare-worker-jwt": "^2.5.2",
"jwks-rsa-browser": "^1.4.2"
"@tsndr/cloudflare-worker-jwt": "^2.5.2"
},

@@ -57,0 +56,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc