New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cloudflare-workers-and-google-oauth

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudflare-workers-and-google-oauth - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

8

dist/index.d.ts
export default class GoogleOAuth {
objectToBase64url: (object: object) => string;
arrayBufferToBase64Url: (buffer: ArrayBuffer) => string;
str2ab: (str: string) => ArrayBuffer;
sign: (content: string, signingKey: string) => Promise<string>;
getGoogleAuthToken: (user: string, key: string, scope: string) => Promise<string | undefined>;
private arrayBufferToBase64Url;
private str2ab;
private sign;
getGoogleAuthToken(user: string, key: string, scope: string): Promise<string | undefined>;
}

@@ -18,15 +18,19 @@ "use strict";

this.objectToBase64url = (object) => this.arrayBufferToBase64Url(new TextEncoder().encode(JSON.stringify(object)));
this.arrayBufferToBase64Url = (buffer) => btoa(String.fromCharCode(...new Uint8Array(buffer)))
}
arrayBufferToBase64Url(buffer) {
return btoa(String.fromCharCode(...new Uint8Array(buffer)))
.replace(/=/g, '')
.replace(/\+/g, '-')
.replace(/\//g, '_');
this.str2ab = (str) => {
const buf = new ArrayBuffer(str.length);
const bufView = new Uint8Array(buf);
for (let i = 0, strLen = str.length; i < strLen; i += 1) {
bufView[i] = str.charCodeAt(i);
}
return buf;
};
this.sign = (content, signingKey) => __awaiter(this, void 0, void 0, function* () {
}
str2ab(str) {
const buf = new ArrayBuffer(str.length);
const bufView = new Uint8Array(buf);
for (let i = 0, strLen = str.length; i < strLen; i += 1) {
bufView[i] = str.charCodeAt(i);
}
return buf;
}
sign(content, signingKey) {
return __awaiter(this, void 0, void 0, function* () {
const buf = this.str2ab(content);

@@ -45,3 +49,5 @@ const plainKey = signingKey

});
this.getGoogleAuthToken = (user, key, scope) => __awaiter(this, void 0, void 0, function* () {
}
getGoogleAuthToken(user, key, scope) {
return __awaiter(this, void 0, void 0, function* () {
const jwtHeader = this.objectToBase64url({ alg: 'RS256', typ: 'JWT' });

@@ -48,0 +54,0 @@ try {

{
"name": "cloudflare-workers-and-google-oauth",
"version": "1.0.2",
"version": "1.0.3",
"description": "Enables easier interfacing with GCS OAuth API for use in Cloudflare Workers",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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