
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
cloudflare-workers-and-google-oauth
Advanced tools
Enables easier interfacing with GCS OAuth API for use in Cloudflare Workers
This is a simple JS module used to facilitate OAuth2 flow from within a Cloudflare Worker. This module isn't specific to Cloudflare, but it is compatible within isolates and doesn't rely on NodeJS.
Install: npm i cloudflare-workers-and-google-oauth
This is a fully working code snippet showing how to access Google Cloud Storage (GCS) and returning an image to the browser.
import GoogleAuth, { GoogleKey } from 'cloudflare-workers-and-google-oauth'
// Add secret using Wranlger or the Cloudflare dash
export interface Env {
GCP_SERVICE_ACCOUNT: string;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const scopes: string[] = ['https://www.googleapis.com/auth/devstorage.full_control']
const googleAuth: GoogleKey = JSON.parse(env.GCP_SERVICE_ACCOUNT)
// Initialize the service
const oauth = new GoogleAuth(googleAuth, scopes)
const token = await oauth.getGoogleAuthToken()
console.log(token)
// Example with Google Cloud Storage
const res = await fetch('https://storage.googleapis.com/storage/v1/b/MY_BUCKET/o/MY_OBJECT.png?alt=media', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'image/png',
'Accept': 'image/png',
},
})
return new Response(res.body, { headers: { 'Content-Type': 'image/png' } });
},
};
FAQs
Enables easier interfacing with GCS OAuth API for use in Cloudflare Workers
The npm package cloudflare-workers-and-google-oauth receives a total of 1,032 weekly downloads. As such, cloudflare-workers-and-google-oauth popularity was classified as popular.
We found that cloudflare-workers-and-google-oauth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.