/ utils / secureStorage / index.ts
index.ts
 1  import { createFallbackStorage } from './fallbackStorage.js'
 2  import { macOsKeychainStorage } from './macOsKeychainStorage.js'
 3  import { plainTextStorage } from './plainTextStorage.js'
 4  import type { SecureStorage } from './types.js'
 5  
 6  /**
 7   * Get the appropriate secure storage implementation for the current platform
 8   */
 9  export function getSecureStorage(): SecureStorage {
10    if (process.platform === 'darwin') {
11      return createFallbackStorage(macOsKeychainStorage, plainTextStorage)
12    }
13  
14    // TODO: add libsecret support for Linux
15  
16    return plainTextStorage
17  }