New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tauri-plugin-keyring-api

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tauri-plugin-keyring-api

![NPM Version](https://img.shields.io/npm/v/tauri-plugin-keyring-api) ![Crates.io Version](https://img.shields.io/crates/v/tauri-plugin-keyring)

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
1.2K
18.95%
Maintainers
0
Weekly downloads
 
Created
Source

Tauri Plugin keyring

NPM Version Crates.io Version

A simple wrapper over rust keyring crate. This may be useful for many applications that require storing user's sensitive data on disk, so although it's simple, I made a plugin for it.

Using keyring allows you to store user's password in the system keychain safely without prompting user for password everytime.

Tauri's stronghold plugin is also used for storing secrets and keys. But it requires user to enter a password or storing the encryption key somewhere. keyring is a good place to store this encryption key.

Sample Usage:

  • Storing random database encryption key
  • Storing user's password for auto-login
  • Storing user's auth token

Sample Project that uses this plugin: kunkunsh/kunkun

Installation

  • Crate: https://crates.io/crates/tauri-plugin-keyring
    • cargo add tauri-plugin-keyring
  • NPM Package: https://www.npmjs.com/package/tauri-plugin-keyring-api
    • npm install tauri-plugin-keyring-api

Usage

TypeScript/JavaScript

import {
  getPassword,
  setPassword,
  deletePassword,
} from "tauri-plugin-keyring-api";

const service = "my-service";
const user = "my-user";

if (!pass) {
  await setPassword(service, user, "my-password");
}
const pass: string = await getPassword(service, user);

await deletePassword(service, user);

Rust

use tauri::Manager;
use tauri_plugin_keyring::KeyringExt;
// app is a tauri::AppHandle
let pass: Option<String> = app.keyring().get_password("tauri-plugin-keyring", "test")?;

FAQs

Package last updated on 23 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts