Skip to content

sevanteri/janet-secret

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

janet-secret

Bindings for libsecret.

Save and retrieve passwords and other secrets from your system's "Secret Service" like gnome-keyring and ksecretservice.

Only synchronous functions are implemented for now.

Install

Packages needed are libsecret-1-dev and libglib2.0-dev (on Ubuntu).

Then install this package:

sudo jpm install https://github.com/sevanteri/janet-secret

Examples

For more more details check the libsecret manual.

First you need a schema. Define it as a struct.

(def schema
  {:name "test.schema"
   :flags :none # or :dont-match-name
   :attributes {"string" :string
                "number" :integer
                "even" :boolean}})

Then you can use that schema to save, lookup and remove a secret.

(secret/save-password
  schema
  @{"string" "nine"
    "number" 9
    "even" false}
  :session # or :default
  "test label"
  "secr3tpassword123")

(secret/lookup-password
  schema
  @{"string" "nine"
    "number" 9
    "even" false})

(secret/remove-password
  schema
  @{"string" "nine"
    "number" 9
    "even" false})

About

Janet-lang native wrapper for libsecret

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published