docs » Keychain

Get and Add items from Keychain. Provides no hotkeys and maintains no state

Example usage:

spoon.Keychain.addItem{service="mynas.local", account="myname", password="secret"}
   item = spoon.Keychain.getItem{service="mynas.local", account="myname"}
   print(item.password)

Tyler Thrailkill tyler.b.thrailkill@gmail.com

https://github.com/snowe2010

API Overview

API Documentation

Deprecateds

login_keychain
Signature Keychain:login_keychain(name)
Type Deprecated
Description

Retrieve an item from the Login Keychain, returns nil if not found.

Notes
  • Use getItem() instead.
Source Source/Keychain.spoon/init.lua line 64

Variables

logger
Signature Keychain.logger
Type Variable
Description

Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.

Source Source/Keychain.spoon/init.lua line 25

Methods

addItem
Signature Keychain:addItem(options)
Type Method
Description

Add generic password to keychain.

Parameters
  • options is a table with values for what keys to try locate with.
    • password - the password
    • account - account name (required)
    • creator - creator, must be 4 characters
    • type - type, must be 4 characters
    • kind - kind of item
    • comment - comment
    • label - label (defaults to service name)
    • service - service name (required)
Returns
Source Source/Keychain.spoon/init.lua line 139
getItem
Signature Keychain:getItem(options)
Type Method
Description

Retrieve an item from the Login Keychain. Return nil if not found and otherwise a table with found data.

Parameters
  • options is a table with values for what keys to try locate with.
    • account - account name
    • creator - creator, must be 4 characters
    • type - type, must be 4 characters
    • kind - kind of item
    • comment - comment
    • label - label (defaults to service name)
    • service - service name
Returns
Notes
  • If multiple possibles matches just the first one is found.
Source Source/Keychain.spoon/init.lua line 82