Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
94ff20f
scaffold new state service, add migration, initial commit
BTreston Jan 29, 2026
0bff38c
add tests
BTreston Feb 4, 2026
9f8018e
fix type issues
BTreston Feb 5, 2026
a0e7494
fix integration test
BTreston Feb 5, 2026
623382f
add tech debt context for DC Modernization
BTreston Feb 11, 2026
06edf4c
flatten account structure using claude
BTreston Feb 13, 2026
b3cb369
add skill for migrating CJS to ESM + example
BTreston Feb 17, 2026
a019555
migrate configuration files to ESM
BTreston Feb 19, 2026
d5566c5
Migrate all remaining cjs files to esm
BTreston Feb 19, 2026
abdddac
merge state service re-write
BTreston Feb 20, 2026
9997e98
update callers to vNext state service
BTreston Feb 23, 2026
77873c3
migrate electron, window/tray, and UI state to vNext
BTreston Feb 23, 2026
4b079a3
continue removing jslib code
BTreston Feb 23, 2026
4c7afc0
Merge branch 'state-service-rewrite' into dev-clarity-hands-on
BTreston Feb 24, 2026
3abd3f0
Refactor secure storage implementation to use native bindings and mig…
JaredScar Feb 24, 2026
9aab82d
Integrate native module 'dc-native' for secure storage, updating Type…
JaredScar Feb 24, 2026
8543265
Refactor TypeScript definitions for password management functions by …
JaredScar Feb 24, 2026
3bf4916
Refactor secure storage implementation to utilize the 'dc-native' mod…
JaredScar Feb 24, 2026
216f57a
Merge branch 'main' into ac/pm-12436-replace-node-keytar-sonnet-attempt
JaredScar Feb 24, 2026
b1a3859
remove hard coded state keys, fix env urls, fix account state migration
BTreston Feb 25, 2026
4eb74cd
cleanup migration key for account, clean up
BTreston Feb 25, 2026
a74973c
remove unused jslib code
BTreston Feb 25, 2026
3af1e31
restructure repo, update eslint rules
BTreston Feb 26, 2026
2f71357
update workflow
BTreston Feb 26, 2026
651867a
wip fix test workflow
BTreston Feb 26, 2026
b4f84fa
clean up
BTreston Feb 26, 2026
ca530fb
Merge branch 'main' of https://github.com/bitwarden/directory-connect…
JaredScar Mar 3, 2026
8a9cbfb
Merge branch 'restructure-repo' of https://github.com/bitwarden/direc…
JaredScar Mar 3, 2026
337ff31
Refactor PASSWORD_NOT_FOUND handling to use a centralized source from…
JaredScar Mar 3, 2026
1869d83
Implement removal of stale secure storage keys during state migration…
JaredScar Mar 3, 2026
a9ff1c1
Update native/src/migration.rs
JaredScar Mar 3, 2026
f82832a
Enhance state migration to include conversion of Windows Credential M…
JaredScar Mar 3, 2026
957c467
Merge branch 'ac/pm-12436-replace-node-keytar-sonnet-attempt' of http…
JaredScar Mar 3, 2026
f89175a
Remove unnecessary closing brace in migrate_keytar_password function …
JaredScar Mar 3, 2026
1cb175b
full state service re-write
BTreston Mar 4, 2026
7901652
Remove obsolete settings.json file to streamline project configuration.
JaredScar Mar 4, 2026
7917953
Remove redundant reset command from build:dist script in package.json…
JaredScar Mar 4, 2026
1927107
Refactor application name handling by introducing a constants module.…
JaredScar Mar 4, 2026
7f331f3
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 4, 2026
658ba28
clean up merge
BTreston Mar 4, 2026
101fe88
separate ESM migration from jslib removal
BTreston Mar 5, 2026
6e962db
clean up CLAUDE.md
BTreston Mar 5, 2026
63c08b9
clean up
BTreston Mar 5, 2026
4919547
clean up stub files
BTreston Mar 5, 2026
2b713af
clean up
BTreston Mar 5, 2026
ac15b41
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 5, 2026
3a26bda
update imports
BTreston Mar 5, 2026
eb601e9
clean up
BTreston Mar 5, 2026
a16f06c
run prettier
BTreston Mar 5, 2026
d7169a9
remove old electron service files
BTreston Mar 6, 2026
a5c0fd6
clean up more electron files, update imports
BTreston Mar 6, 2026
25966e0
clean up unused jslib angular code
BTreston Mar 6, 2026
7485100
migrate jslib abstractions into libs/abstractions. Update imports
BTreston Mar 6, 2026
482f5bd
continue migration from jslib to libs
BTreston Mar 6, 2026
d3e5205
complete migration from jslib to primary dir structur
BTreston Mar 6, 2026
53bba96
clean up
BTreston Mar 6, 2026
8005155
run prettier
BTreston Mar 6, 2026
747d1a8
clean up
BTreston Mar 6, 2026
e4858c5
fix workflow
BTreston Mar 6, 2026
0388498
Merge branch 'restructure-repo' of https://github.com/bitwarden/direc…
JaredScar Mar 9, 2026
0fa466e
Update libs/services/nativeSecureStorage.service.ts
JaredScar Mar 10, 2026
4b62c14
Add dc-native to externals in webpack configuration
JaredScar Mar 10, 2026
3bbc759
Add settings.json for Claude configuration with attribution and extra…
JaredScar Mar 10, 2026
2c6c34f
clean up comments and providers
BTreston Mar 10, 2026
77ad86b
wip
BTreston Mar 11, 2026
1dcd51e
fix secure storage migrations
BTreston Mar 11, 2026
0cdea94
clean up
BTreston Mar 11, 2026
e2a8d17
remove param
BTreston Mar 11, 2026
98bf94a
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 11, 2026
08b3baa
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 12, 2026
ed551e3
re-add useSecureStorageForSercretes
BTreston Mar 12, 2026
a5c8f16
move fakeStorageService into utils/
BTreston Mar 12, 2026
6a5038a
run prettier
BTreston Mar 12, 2026
9e56637
skip migration if no data
BTreston Mar 12, 2026
1306e9d
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 12, 2026
a54d241
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 12, 2026
60c341b
fix environment service
BTreston Mar 12, 2026
355936d
remvoe format when setting urls from storage
BTreston Mar 12, 2026
882677e
add null check
BTreston Mar 12, 2026
af6ec1d
Update libs/services/nativeSecureStorage.service.ts
JaredScar Mar 12, 2026
94ad60f
Merge branch 'restructure-repo' of https://github.com/bitwarden/direc…
JaredScar Mar 12, 2026
f1f553a
Refactor stateMigration.service.ts to remove duplicate import of pass…
JaredScar Mar 12, 2026
8551d15
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 12, 2026
e9e1a13
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 12, 2026
d553f75
fix env urls and set only one entra key
BTreston Mar 13, 2026
5bd4a60
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 13, 2026
516de64
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 13, 2026
c99f1d2
Merge branch 'restructure-repo' into ac/pm-12436-replace-node-keytar-…
BTreston Mar 13, 2026
4c02902
Various fixes and cleanup
BTreston Mar 13, 2026
de8b099
Fix migration related issues
BTreston Mar 16, 2026
1397770
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 16, 2026
8d34c1f
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 16, 2026
c076337
Merge branch 'restructure-repo' into ac/pm-12436-replace-node-keytar-…
BTreston Mar 16, 2026
bbdb6ef
Refactor NAPI exports to use a consistent namespace for password func…
JaredScar Mar 16, 2026
147fa6a
Update dependencies and refactor NAPI exports. This commit upgrades s…
JaredScar Mar 16, 2026
93f333b
PR feedback
BTreston Mar 23, 2026
cf971f9
clean up
BTreston Mar 23, 2026
48fb0e2
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Mar 23, 2026
08cdb48
Merge branch 'jslib-removal' into restructure-repo
BTreston Mar 23, 2026
5b5d761
cleanup
BTreston Mar 23, 2026
a0f9c9e
Merge branch 'restructure-repo' into ac/pm-12436-replace-node-keytar-…
BTreston Mar 23, 2026
70e2a76
clean up redundant migration logic
BTreston Mar 26, 2026
0d91212
update tests to set secrets in secure storage rather than embedded in…
BTreston Mar 26, 2026
774246e
Merge branch 'ac/pm-31159-state-service' into jslib-removal
BTreston Apr 2, 2026
48eed0b
Merge branch 'jslib-removal' into restructure-repo
BTreston Apr 2, 2026
9c6422c
Merge branch 'restructure-repo' into ac/pm-12436-replace-node-keytar-…
BTreston Apr 2, 2026
d1b456f
remove /openldap, clean up CLI dir
BTreston Apr 6, 2026
aa84b56
Merge branch 'restructure-repo' into ac/pm-12436-replace-node-keytar-…
BTreston Apr 6, 2026
e3e7717
Enhance state migration service to support key migration from keytar …
JaredScar Apr 6, 2026
b05e0d5
Merge branch 'main' into ac/pm-12436-replace-node-keytar-sonnet-attempt
BTreston Apr 7, 2026
9af88a7
fix CI
BTreston Apr 7, 2026
a25b567
Update build process for Windows CLI and enhance state management
JaredScar Apr 8, 2026
fb536a7
Update package dependencies, CLI packaging scripts, and improve state…
JaredScar Apr 8, 2026
47a594e
Refactor secure storage implementation
JaredScar Apr 8, 2026
9eadf78
Enhance error handling in NativeSecureStorageService
JaredScar Apr 8, 2026
ef18028
Update ESLint configuration and improve code formatting
JaredScar Apr 8, 2026
422a94f
Refactor file watching mechanism in main.ts
JaredScar Apr 9, 2026
b3123f7
Refactor CLI packaging scripts and update GitHub Actions workflow
JaredScar Apr 9, 2026
356a333
Refactor keytar password migration logic
JaredScar Apr 9, 2026
ccb2100
Update package dependencies and refine state migration logic
JaredScar Apr 9, 2026
5479ad8
Refactor import statement in NativeSecureStorageService
JaredScar Apr 9, 2026
46b4de8
Refactor state migration service and update main.ts file
JaredScar Apr 9, 2026
073b8cc
Remove unnecessary whitespace in NativeSecureStorageService for impro…
JaredScar Apr 9, 2026
0e3e649
Refactor GitHub Actions workflows to streamline Node.js setup
JaredScar Apr 10, 2026
8ccbbd8
Update credential retrieval in get_password_keytar function
JaredScar Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .github/actions/setup-node-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Setup Node Environment"
description: "Sets up Node.js with npm cache and installs node-gyp"
description: "Sets up Node.js with npm cache"
inputs:
node-version:
description: "Node.js version to use"
Expand All @@ -18,17 +18,3 @@ runs:
cache: "npm"
cache-dependency-path: "**/package-lock.json"
node-version: ${{ inputs.node-version }}

- name: Update NPM and install node-gyp (Unix)
if: inputs.platform != 'Windows'
shell: bash
run: |
npm install -g node-gyp
node-gyp install "$(node -v)"

- name: Update NPM and install node-gyp (Windows)
if: inputs.platform == 'Windows'
shell: pwsh
run: |
npm install -g node-gyp
node-gyp install $(node -v)
3 changes: 3 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
paths:
- 'src/**'
- 'src-cli/**'
- 'libs/**'
- 'native/**'
- 'jslib/**'
- 'resources/**'
- 'scripts/**'
Expand All @@ -14,6 +16,7 @@ on:
- 'tsconfig.json'
- 'angular.json'
- '.github/workflows/build-pr.yml'
- '.github/actions/**'
- '!*.md'
- '!*.txt'

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
paths:
- 'src/**'
- 'src-cli/**'
- 'libs/**'
- 'native/**'
- 'jslib/**'
- 'resources/**'
- 'scripts/**'
Expand All @@ -21,6 +23,7 @@ on:
- 'angular.json'
- '.github/workflows/build.yml'
- '.github/workflows/build-target.yml'
- '.github/actions/**'
- '!*.md'
- '!*.txt'

Expand Down
78 changes: 37 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,25 @@ jobs:
node-version: ${{ env._NODE_VERSION }}
platform: Linux

- name: Keytar
run: |
keytarVersion=$(cat package.json | jq -r '.dependencies.keytar')
keytarTar="keytar-v$keytarVersion-napi-v3-linux-x64.tar"

keytarTarGz="$keytarTar.gz"
keytarUrl="https://github.com/atom/node-keytar/releases/download/v$keytarVersion/$keytarTarGz"
- name: Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

mkdir -p ./keytar/linux
wget "$keytarUrl" -O "./keytar/linux/$keytarTarGz"
tar -xvf "./keytar/linux/$keytarTarGz" -C ./keytar/linux
- name: Set up system dependencies
run: |
sudo apt-get update
sudo apt-get -y install libdbus-1-dev libsecret-1-dev pkg-config

- name: Install
run: npm ci

- name: Build native module
run: npm run build:native:release

- name: Package CLI
run: npm run dist:cli:lin

- name: Zip
run: zip -j "dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip" "dist-cli/linux/bwdc" "keytar/linux/build/Release/keytar.node"
run: zip -j "dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip" "dist-cli/linux/bwdc" "node_modules/dc-native/dc_native.linux-x64-gnu.node"

- name: Version Test
run: |
Expand Down Expand Up @@ -145,26 +144,20 @@ jobs:
node-version: ${{ env._NODE_VERSION }}
platform: macOS

- name: Keytar
run: |
keytarVersion=$(cat package.json | jq -r '.dependencies.keytar')
keytarTar="keytar-v$keytarVersion-napi-v3-darwin-x64.tar"

keytarTarGz="$keytarTar.gz"
keytarUrl="https://github.com/atom/node-keytar/releases/download/v$keytarVersion/$keytarTarGz"

mkdir -p ./keytar/macos
wget "$keytarUrl" -O "./keytar/macos/$keytarTarGz"
tar -xvf "./keytar/macos/$keytarTarGz" -C ./keytar/macos
- name: Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

- name: Install
run: npm ci

- name: Build native module
run: npm run build:native:release

- name: Package CLI
run: npm run dist:cli:mac

- name: Zip
run: zip -j "dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip" "dist-cli/macos/bwdc" "keytar/macos/build/Release/keytar.node"
run: zip -j "dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip" "dist-cli/macos/bwdc" "node_modules/dc-native/dc_native.darwin-x64.node"

- name: Version Test
run: |
Expand Down Expand Up @@ -215,31 +208,23 @@ jobs:
node-version: ${{ env._NODE_VERSION }}
platform: Windows

- name: Keytar
shell: pwsh
run: |
$keytarVersion = (Get-Content -Raw -Path ./package.json | ConvertFrom-Json).dependencies.keytar
$keytarTar = "keytar-v${keytarVersion}-napi-v3-{0}-x64.tar"
$keytarTarGz = "${keytarTar}.gz"
$keytarUrl = "https://github.com/atom/node-keytar/releases/download/v${keytarVersion}/${keytarTarGz}"

New-Item -ItemType directory -Path ./keytar/windows | Out-Null

Invoke-RestMethod -Uri $($keytarUrl -f "win32") -OutFile "./keytar/windows/$($keytarTarGz -f "win32")"

7z e "./keytar/windows/$($keytarTarGz -f "win32")" -o"./keytar/windows"

7z e "./keytar/windows/$($keytarTar -f "win32")" -o"./keytar/windows"
- name: Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: x86_64-pc-windows-msvc

- name: Install
run: npm ci

- name: Build native module
run: npm run build:native:release

- name: Package CLI
run: npm run dist:cli:win

- name: Zip
shell: pwsh
run: 7z a .\dist-cli\bwdc-windows-$env:_PACKAGE_VERSION.zip .\dist-cli\windows\bwdc.exe .\keytar\windows\keytar.node
shell: cmd
run: 7z a .\dist-cli\bwdc-windows-%_PACKAGE_VERSION%.zip .\dist-cli\windows\bwdc.exe .\node_modules\dc-native\dc_native.win32-x64-msvc.node

- name: Version Test
shell: pwsh
Expand Down Expand Up @@ -286,6 +271,11 @@ jobs:
node-version: ${{ env._NODE_VERSION }}
platform: Windows

- name: Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: x86_64-pc-windows-msvc

- name: Print environment
run: |
node --version
Expand Down Expand Up @@ -381,10 +371,13 @@ jobs:
node-version: ${{ env._NODE_VERSION }}
platform: Linux

- name: Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

- name: Set up environment
run: |
sudo apt-get update
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev libdbus-1-dev
sudo apt-get -y install rpm

- name: NPM Install
Expand Down Expand Up @@ -437,6 +430,9 @@ jobs:
node-version: ${{ env._NODE_VERSION }}
platform: macOS

- name: Set up Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

- name: Print environment
run: |
node --version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
cache-dependency-path: '**/package-lock.json'
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}

- name: Build native module
run: npm run build:native
Comment on lines +43 to +44

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ IMPORTANT (Build): Native module build will fail -- missing Rust toolchain setup and system dependencies

Details and fix

The build.yml workflow installs both the Rust toolchain (dtolnay/rust-toolchain@stable) and Linux system dependencies (libdbus-1-dev, libsecret-1-dev, pkg-config) before building the native module. This workflow does neither.

napi build invokes cargo build, which requires the Rust compiler and linker access to libsecret-1-dev and libdbus-1-dev headers. While the GitHub-hosted runner may have a Rust toolchain cached, it does not include the -dev header packages needed for compilation.

Add the missing setup steps before the native build:

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

      - name: Set up system dependencies
        run: |
          sudo apt-get update
          sudo apt-get -y install libdbus-1-dev libsecret-1-dev pkg-config

      - name: Build native module
        run: npm run build:native


- name: Install Node dependencies
run: npm ci

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ build
build-cli
.angular/cache

# Rust build artifacts
native/target
native/*.node

# Testing
coverage*
junit.xml*
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ src/locales

# Github Workflows
.github/workflows

# Native module (auto-generated)
native
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,22 @@ services:
ports:
- "1389:1389"
- "1636:1636"
healthcheck:
test:
[
"CMD",
"ldapsearch",
"-x",
"-H",
"ldap://localhost:1389",
"-b",
"dc=bitwarden,dc=com",
"-D",
"cn=admin,dc=bitwarden,dc=com",
"-w",
"admin",
]
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
1 change: 1 addition & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"app": "build"
},
"afterSign": "scripts/notarize.js",
"asarUnpack": ["node_modules/dc-native/*.node"],
"mac": {
"artifactName": "Bitwarden-Connector-${version}-mac.${ext}",
"category": "public.app-category.productivity",
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ export default [
"build/**",
"build-cli/**",
"coverage/**",
"coverage-ldap/**",
"**/*.cjs",
"eslint.config.mjs",
"scripts/**/*.js",
"**/node_modules/**",
"native/**",
],
},

Expand All @@ -35,6 +37,7 @@ export default [
parser: tsParser,
parserOptions: {
project: ["./tsconfig.eslint.json"],
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.browser,
Expand Down
1 change: 1 addition & 0 deletions libs/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const APPLICATION_NAME = "Bitwarden Directory Connector";
3 changes: 2 additions & 1 deletion libs/enums/stateVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export enum StateVersion {
Three = 3, // Fix migration of users' premium status
Four = 4, // Fix 'Never Lock' option by removing stale data
Five = 5, // New state service implementation
Latest = Five,
Six = 6, // Migrate Windows Credential Manager entries from keytar (UTF-8) to desktop_core (UTF-16)
Latest = Six,
}
11 changes: 5 additions & 6 deletions libs/models/state.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export const StorageKeys = {
// TODO: Remove when jslib cleanup PR is merged
appId: "appId",
anonymousAppId: "anonymousAppId",

userDelta: "userDeltaToken",
groupDelta: "groupDeltaToken",
lastUserSync: "lastUserSync",
lastGroupSync: "lastGroupSync",
};

export const SecureStorageKeys = {
Expand All @@ -52,12 +57,6 @@ export const SecureStorageKeys = {
okta: "secretOkta",
oneLogin: "secretOneLogin",

// Sync metadata
userDelta: "userDeltaToken",
groupDelta: "groupDeltaToken",
lastUserSync: "lastUserSync",
lastGroupSync: "lastGroupSync",

// Authentication tokens
accessToken: "accessToken",
refreshToken: "refreshToken",
Expand Down
10 changes: 6 additions & 4 deletions libs/services/baseLowdbStorage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { NodeUtils } from "@/libs/utils/nodeUtils";
import { sequentialize } from "@/libs/utils/sequentialize";
import { Utils } from "@/libs/utils/utils";

import { SecureStorageKey, StorageKey } from "../models/state.model";

export class LowdbStorageService implements StorageService {
protected dataFilePath: string;
private db: lowdb.LowdbSync<any>;
Expand Down Expand Up @@ -92,7 +94,7 @@ export class LowdbStorageService implements StorageService {
this.ready = true;
}

async get<T>(key: string): Promise<T> {
async get<T>(key: StorageKey | SecureStorageKey): Promise<T> {
await this.waitForReady();
return this.lockDbFile(() => {
this.readForNoCache();
Expand All @@ -105,11 +107,11 @@ export class LowdbStorageService implements StorageService {
});
}

has(key: string): Promise<boolean> {
has(key: StorageKey | SecureStorageKey): Promise<boolean> {
return this.get(key).then((v) => v != null);
}

async save(key: string, obj: any): Promise<any> {
async save(key: StorageKey | SecureStorageKey, obj: any): Promise<any> {
await this.waitForReady();
return this.lockDbFile(() => {
this.readForNoCache();
Expand All @@ -119,7 +121,7 @@ export class LowdbStorageService implements StorageService {
});
}

async remove(key: string): Promise<any> {
async remove(key: StorageKey | SecureStorageKey): Promise<any> {
await this.waitForReady();
return this.lockDbFile(() => {
this.readForNoCache();
Expand Down
33 changes: 0 additions & 33 deletions libs/services/keytarSecureStorage.service.ts

This file was deleted.

Loading
Loading