
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
@ydbjs/auth
Advanced tools
Authentication providers for YDB: static credentials, tokens, anonymous, and cloud metadata. Integrates with the core driver for secure access.
The @ydbjs/auth
package provides authentication utilities for interacting with YDB services. It supports static credentials, token-based authentication, anonymous access, and VM metadata providers.
Install the package using npm:
npm install @ydbjs/auth@6.0.0@alpha
YDB requires authentication for most operations. The credentials provider you choose attaches authentication data to each gRPC request:
x-ydb-auth-ticket: <token>
) in all subsequent requests. The SDK automatically refreshes the token when it expires.x-ydb-auth-ticket: <token>
) with every request. No login call is made.x-ydb-auth-ticket: <token>
). The token is refreshed automatically as needed.Note: The SDK handles all token management and header injection automatically when you pass a credentials provider to the YDB driver. You do not need to manually manage tokens or headers.
import { Driver } from '@ydbjs/core';
import { query } from '@ydbjs/query';
import { StaticCredentialsProvider } from '@ydbjs/auth/static';
const driver = new Driver('grpc://localhost:2136/local', {
credentialsProvider: new StaticCredentialsProvider({
username: 'username',
password: 'password',
}),
});
await driver.ready();
const sql = query(driver);
const result = await sql`SELECT 1`;
import { StaticCredentialsProvider } from '@ydbjs/auth/static';
const provider = new StaticCredentialsProvider({
username: 'username',
password: 'password',
}, 'grpc://localhost:2136/local');
const token = await provider.getToken();
// The token can be used in custom gRPC calls if needed
import { AccessTokenCredentialsProvider } from '@ydbjs/auth/access-token';
const provider = new AccessTokenCredentialsProvider({
token: 'your-access-token',
});
// Use with driver
import { Driver } from '@ydbjs/core';
const driver = new Driver('grpc://localhost:2136/local', {
credentialsProvider: provider,
});
await driver.ready();
import { Driver } from '@ydbjs/core';
import { AnonymousCredentialsProvider } from '@ydbjs/auth/anonymous';
const driver = new Driver('grpc://localhost:2136/local', {
credentialsProvider: new AnonymousCredentialsProvider(),
});
await driver.ready();
import { MetadataCredentialsProvider } from '@ydbjs/auth/metadata';
const provider = new MetadataCredentialsProvider({
// Optional: override endpoint or flavor for your cloud
// endpoint: 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token',
// flavor: 'Google',
});
import { Driver } from '@ydbjs/core';
const driver = new Driver('grpc://localhost:2136/local', {
credentialsProvider: provider,
});
await driver.ready();
x-ydb-auth-ticket: <token>
in every gRPC request.x-ydb-auth-ticket: <token>
in every gRPC request.You do not need to manually set headers; the SDK handles this for you.
This project is licensed under the Apache 2.0 License.
FAQs
Authentication providers for YDB: static credentials, tokens, anonymous, and cloud metadata. Integrates with the core driver for secure access.
The npm package @ydbjs/auth receives a total of 71 weekly downloads. As such, @ydbjs/auth popularity was classified as not popular.
We found that @ydbjs/auth demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.