
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@dainprotocol/oauth2-storage-drizzle
Advanced tools
Database-agnostic Drizzle ORM storage adapter for OAuth2 Token Manager
Drizzle ORM storage adapter for @dainprotocol/oauth2-token-manager.
npm install @dainprotocol/oauth2-storage-drizzle drizzle-orm
import { OAuth2Client } from '@dainprotocol/oauth2-token-manager';
import { DrizzleStorageAdapter } from '@dainprotocol/oauth2-storage-drizzle';
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
const client = postgres(connectionString);
const db = drizzle(client);
const storage = new DrizzleStorageAdapter(db, {
dialect: 'postgres',
});
const oauth = new OAuth2Client({ storage });
import { drizzle } from 'drizzle-orm/mysql2';
import mysql from 'mysql2/promise';
const connection = await mysql.createConnection({
host: 'localhost',
user: 'root',
database: 'oauth_tokens',
});
const db = drizzle(connection);
const storage = new DrizzleStorageAdapter(db, {
dialect: 'mysql',
});
import { drizzle } from 'drizzle-orm/better-sqlite3';
import Database from 'better-sqlite3';
const sqlite = new Database('oauth_tokens.db');
const db = drizzle(sqlite);
const storage = new DrizzleStorageAdapter(db, {
dialect: 'sqlite',
});
The adapter automatically creates the following tables:
id
- Unique identifierprovider
- OAuth provider nameuserId
- User identifieremail
- User emailaccessToken
- Encrypted access tokenrefreshToken
- Encrypted refresh token (optional)expiresAt
- Token expiration timestamptokenType
- Token type (e.g., "Bearer")scope
- OAuth scopesmetadata
- Additional metadata (JSON)createdAt
- Creation timestampupdatedAt
- Last update timestampUnique constraint: provider
+ email
state
- Authorization state (primary key)codeVerifier
- PKCE code verifierconfig
- OAuth configuration (JSON)metadata
- Additional metadata (JSON)createdAt
- Creation timestampMIT
FAQs
Database-agnostic Drizzle ORM storage adapter for OAuth2 Token Manager
The npm package @dainprotocol/oauth2-storage-drizzle receives a total of 142 weekly downloads. As such, @dainprotocol/oauth2-storage-drizzle popularity was classified as not popular.
We found that @dainprotocol/oauth2-storage-drizzle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.