keepasshttp-client
is a Node.js module for interaction with KeePassHTTP.
Notes
- Supported request types:
test-associate
,associate
,get-logins
,get-logins-count
,set-login
. Respective methods return ES2015 Promises.
Usage Examples
Using TypeScript and async/await:
;;; ; ; if !password // it's generally not secure to store the key/id values in the unencrypted form// since basically a smart/targeted computer virus/trojan can read the unencrypted key/id values// and fetch/modify your passwords interacting with the KeepassHttp using that key/id pair// so we are going to use a simple encrypted storage; ; ;
Using JavaScript and Promises:
const KeePassHttpClient = ;const Store = ;const EncryptionAdapter = ; const password = processenvPASSWORD; if !password throw "Empty password is not allowed"; // it's generally not secure to store the key/id values in the unencrypted form// since basically a smart/targeted computer virus/trojan can read the unencrypted key/id values// and fetch/modify your passwords interacting with the KeepassHttp using that key/id pair// so we are going to use a simple encrypted storageconst store = file: ".keepasshttp-client.json" adapter: password keyDerivation: type: "sodium.crypto_pwhash" preset: "mode:moderate|algorithm:default" encryption: type: "sodium.crypto_secretbox_easy" preset: "algorithm:default" ; const examplesSequence = // associating with KeePassHttp and storing received key/id pair { const client = /*{url: "http://localhost:19455"}*/; return client // at this stage - after the successful associating with KeePassHttp // the key/id values are wired into the "client" instance // so now we are ready to initiate the getting password records request // but let's first cache the received key/id values for future use // passwords requesting ; } // requesting passwords using previously cached key/id pair { return store ; }; examplesSequence;
Links
- KeePass - original "Keepass Password Safe" password manager.
- KeePassHTTP - KeePass plugin that exposes passwords entries via HTTP for clients to consume.
- KeePassXC - cross-platform community-driven port of the Windows application "Keepass Password Safe". It has built-in KeePassHTTP protocol support.