Registry / auth-security / brightspace-auth-keys

brightspace-auth-keys

JSON →
library9.0.1jsnpmunverified

Library for generating, storing, and retrieving keypairs (RSA/ECDSA) for Brightspace's auth framework. Current stable version is 9.0.1, requires Node >=20.x. Key differentiator: provides abstract store pattern for pluggable backends (Redis, SQL, etc.) and integrates with D2L Auth Token Provisioner. Release cadence is irregular, mostly breaking changes for Node version bumps.

npm install brightspace-auth-keys
INSTALL
IMPORT
SIG · BRIGHTSPACE-AUTH-K
B
brightspace-auth-keys
auth-securityjavascriptv9.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KeyGenerator
import { KeyGenerator } from 'brightspace-auth-keys'
const KeyGenerator = require('brightspace-auth-keys').KeyGenerator
ESM-only since v9; CommonJS require still works in Node 20+
AbstractPublicKeyStore
import { AbstractPublicKeyStore } from 'brightspace-auth-keys'
const { AbstractPublicKeyStore } = require('brightspace-auth-keys')
ESM-only since v9
default import
import brightspaceAuthKeys from 'brightspace-auth-keys'
const brightspaceAuthKeys = require('brightspace-auth-keys')
Package has no default export; import * from or named imports required

Shows subclassing AbstractPublicKeyStore, instantiating KeyGenerator with EC settings, and retrieving the current private key.

import { KeyGenerator, AbstractPublicKeyStore } from 'brightspace-auth-keys'; class MyStore extends AbstractPublicKeyStore { async _storePublicKey(key, expiry) { // store key string with expiry } async _lookupPublicKeys() { // return array of key strings return []; } } const store = new MyStore(); const keyGenerator = new KeyGenerator({ signingKeyType: 'EC', ec: { crv: 'P-256' }, lifetimes: { keyUse: 3600, token: 300 }, publicKeyStore: store }); const privateKey = await keyGenerator.getCurrentPrivateKey(); console.log('Private key obtained:', privateKey);
Debug
Known issues
breakingNode.js version requirement changed from >=12 to >=20 in v9
fix
Upgrade Node.js to 20.x or later, or pin to v8.x
affects: >=9.0.0
breakingPackage is ESM-only since v9; no CommonJS default export
fix
Use ES module imports (import ... from 'brightspace-auth-keys') or dynamic import
affects: >=9.0.0
gotchaKeyGenerator requires both signingKeyType and publicKeyStore options; missing one throws immediately
fix
Always provide both signingKeyType and publicKeyStore in constructor options
affects: >=6.0.0
gotchaAbstractPublicKeyStore._lookupPublicKeys must return an array of strings, not objects; non-string items cause runtime errors
fix
Ensure _lookupPublicKeys returns an array of opaque strings (e.g., JSON.stringify of JWK)
affects: >=7.0.0
Errors
Common errors & fixes
TypeError: Class constructor AbstractPublicKeyStore cannot be invoked without 'new'
Calling AbstractPublicKeyStore as a function without new in ES module context
fix
Use class extends AbstractPublicKeyStore { ... } and instantiate with new MyStore()
Error: signingKeyType must be either 'RSA' or 'EC'
Missing or invalid signingKeyType option in KeyGenerator constructor
fix
Set signingKeyType: 'EC' or signingKeyType: 'RSA' in options
TypeError: store._storePublicKey is not a function
Store instance does not implement _storePublicKey method required by AbstractPublicKeyStore
fix
Implement _storePublicKey(key, expiry) method returning a Promise
Upgrade
Version history
9.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
1
Resources
brightspace-auth-keys — npm install brightspace-auth-keys · libregistry