npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gdc-cas

v0.1.0

Published

Node.js client library for Google Distributed Cloud air-gapped Certificate Authority Service (CAS)

Readme

Google Distributed Cloud air-gapped CAS Node.js Client

This package provides a Node.js client to interact with the Google Distributed Cloud air-gapped (GDC) Certificate Authority Service (CAS).

Installation

npm install gdc-cas

Runtime Requirements

Prerequisites

  1. Create a Project in your GDC cluster.
  2. Follow the Manage service accounts steps to create a service account for your project:
    • Assign the certificate-authority-service-admin role to your service account.
    • Generate a key pair for your service account and store the private key as a JSON file. This JSON file will be used by the CAS client to authenticate with GDC.
  3. Follow the CAS user guide to create Certificate Authorities(CAs) for your project. The CAs will be referenced by the CAS client when requesting certificates.
  4. Fetch GDC trust bundles for trust-store-global-root-ext. The CAS client will need the trust bundle to connect to the GDC clusters.

Usage

Initialization

Provide the following configuration options to initialize the client:

import { CASClient } from 'gdc-cas';

const clientConfig = {
    saFilePath: '/path/to/sa.json', // File path for the service account private key JSON file.
    caFilePath: '/path/to/ca.crt', // File path for the GDC trust store.
    zone: 'us-west6-a', // GDC zone name.
};

// Create and initialize the CASClient
const casClient = new CASClient(clientConfig);
await casClient.init();

gRPC Mode (Bypass KRM)

By default, the client uses the Kubernetes API to manage certificate requests (KRM mode). If you want to use the gRPC mode, initialize the client with useGrpc: true. This bypasses the Kubernetes API server and makes direct gRPC calls to the CAS proxy.

const clientConfig = {
    saFilePath: '/path/to/sa.json',
    caFilePath: '/path/to/ca.crt',
    zone: 'us-west6-a',
    useGrpc: true, // Enable direct gRPC calls
    // casProxyUrl: 'https://cas.org.zone.domain.com' // Optional: Derived from token_uri if not specified
};

const casClient = new CASClient(clientConfig);
await casClient.init();

[!NOTE] In gRPC mode, only createCertificateRequest and createRevokeCertificateRequest are supported. Other KRM operations (getCertificateRequest, listCertificateRequests, deleteCertificateRequest, getCertificateAuthority) are not supported over gRPC.

Certificate Revocation over gRPC

To request certificate revocation over gRPC:

const revokeParams = {
  certificate: tlsCrtPemString, // The PEM-encoded certificate string to revoke
  reason: 'KEY_COMPROMISE',      // The reason for revocation (RevocationReason enum or string)
};

try {
  const revokeResult = await casClient.createRevokeCertificateRequest(project, revokeParams);
  console.log('Successfully revoked certificate. Reason:', revokeResult.reason);
} catch (error) {
  console.error('Revocation failed:', error.message);
}

Certificate Revocation over KRM

To request certificate revocation using KRM:

const revokeParams = {
  certificateRequestRef: {
    name: 'original-certificate-request-name', // Name of the original CertificateRequest
    namespace: project,
  },
  reason: 'KEY_COMPROMISE',                     // The reason for revocation (RevocationReason enum or string)
};

try {
  const revokeResult = await casClient.createRevokeCertificateRequest(project, revokeParams, {
    timeoutMs: 15000,
    pollingIntervalMs: 200,
  });
  console.log('Successfully created RevokeCertificateRequest CR. Name:', revokeResult.revokeCertificateRequestName);
} catch (error) {
  console.error('Revocation failed:', error.message);
}

Certificate Requests and Revocation Management

The client supports the following methods to manage certificate requests and revocation:

  • createCertificateRequest
  • createRevokeCertificateRequest
  • getRevokeCertificateRequest
  • deleteRevokeCertificateRequest
  • listRevokeCertificateRequests
  • getCertificateRequest
  • listCertificateRequests
  • deleteCertificateRequest
  • getCertificateAuthority

Local Development & Verification

1. Updating the Protocol Buffer

If you modify proto/cas.proto to add new endpoints, fields, or services, recompile the static JSON descriptor so the gRPC client can serialize payloads at runtime:

cd ./cas/gdc-cas
npm run build:proto

Note: Commit the updated proto/cas-json.js file alongside your .proto changes (verified automatically in CI).

2. Running Unit, Type & Package Smoke Tests

cd ./cas/gdc-cas
npm ci
npm run check:types
npm test

3. Releases & Publishing

Official releases of gdc-cas to npmjs.com are published exclusively through the repository's automated GitHub Actions release pipeline and Google OSS Exit Gate after passing GDC Air-gapped Staging integration verification. Do not run npm publish manually from a local workstation.