From d0dfa1053679d63b11784d6d111fabe8aac9b08d Mon Sep 17 00:00:00 2001 From: Alan Bridgeman Date: Wed, 18 Feb 2026 12:54:59 -0600 Subject: [PATCH] Lots of little updates to bring it in line with the other implemeentations etc... --- README.md | 12 ++++++++++-- src/FileKeystore.ts | 5 ++++- src/index.ts | 4 +++- tsconfig.build.json | 5 ++++- tsconfig.json | 4 ++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e00abb7..52a691c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# File based Implementation of bridgeman Accessible Auth Keystore -This is the file based implementation of the Bridgeman Accessible Auth Keystore. \ No newline at end of file +# File based Implementation of Bridgeman Accessible Auth Keystore +This is the file based implementation of the Bridgeman Accessible Auth Keystore. + +This is intended to be a simple implementation that just stores keys in a JSON file. +This is arguably pretty **INSECURE** (depending significantly on file protections etc... which are out of scope for this package). +But, it can be helpful for testing/development where simplicity might be preferable over strict security. + +For more details on the Keystore concept itself or "upstream effects" see the [Keystore Library README](https://git.bridgemanaccessible.ca/Bridgeman-Accessible/ba-auth_keystore/src/branch/main/README.md) + +This module/package/library includes a testing suite to verify functionality. It can be run using the yarn test command in any terminal/shell that supports Yarn. This test suite is also run as part of the public CI/CD automation on push. \ No newline at end of file diff --git a/src/FileKeystore.ts b/src/FileKeystore.ts index fb3de77..a13f8e4 100644 --- a/src/FileKeystore.ts +++ b/src/FileKeystore.ts @@ -11,6 +11,9 @@ const { JWK } = NodeJose; * File implementation for the keystore */ export class FileKeystore extends BaseKeystore { + /** The type name of the keystore (used as the key for registration) */ + public static readonly TYPE_NAME = 'file'; + private keystoreFilePath: string | undefined; /** @@ -86,4 +89,4 @@ export class FileKeystore extends BaseKeystore { } } -Keystore.addKeystoreType('file', FileKeystore.create); \ No newline at end of file +Keystore.addKeystoreType(FileKeystore.TYPE_NAME, FileKeystore.create); \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index fa2748e..0ff63e5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ import { FileKeystore } from './FileKeystore.js'; -export { FileKeystore }; \ No newline at end of file +const TYPE_NAME = FileKeystore.TYPE_NAME; + +export { FileKeystore, TYPE_NAME }; \ No newline at end of file diff --git a/tsconfig.build.json b/tsconfig.build.json index f7dc3a1..36fca0d 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -2,8 +2,11 @@ "extends": "./tsconfig.json", // Visit https://aka.ms/tsconfig to read more about this file "compilerOptions": { + // File Layout "rootDir": "./src", - "types": [], + "outDir": "./dist", + + "types": [] }, "exclude": [ "node_modules", diff --git a/tsconfig.json b/tsconfig.json index 41b10ae..7de920f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { // File Layout // "rootDir": "./src", - "outDir": "./dist", + // "outDir": "./dist", // Environment Settings // See also https://aka.ms/tsconfig/module @@ -39,7 +39,7 @@ "isolatedModules": true, "noUncheckedSideEffectImports": true, "moduleDetection": "force", - "skipLibCheck": true, + "skipLibCheck": true }, "exclude": ["node_modules", "dist"], "include": [