pycoffer.plugins package¶
Submodules¶
pycoffer.plugins.crypt module¶
Encrypt/Decrypt external files using keys of coffer
- class pycoffer.plugins.crypt.Crypt¶
Bases:
OtherPlugin
,CliInterface
- classmethod cli()¶
Lazy loader for click
- decrypt(source, target)¶
Decrypt source in target
- desc = "Encrypt/decrypt external files with key's coffer"¶
- encrypt(source, target)¶
Encrypt source in target
pycoffer.plugins.crypt_cli module¶
Crypt plugin Click interface
pycoffer.plugins.fido module¶
Use FIDO keys as key store
- class pycoffer.plugins.fido.CliInteraction¶
Bases:
object
- class pycoffer.plugins.fido.Fido¶
Bases:
AuthPlugin
,CliInterface
,AuthInterface
,ConfigInterface
- classmethod authorize(config)¶
Put info in config to authorize access
- classmethod check(device, cred_id, rp_id: str)¶
Check we can derive from this device using cred_id and rp_id
- classmethod cli()¶
Lazy loader for click
- classmethod derive(cred_id, rp_id: str, salt1: bytes, salt2: bytes = None)¶
Derive salts from a list of credentials
- classmethod derive_from_device(device, cred_id: bytes, rp_id: str, salt1: bytes, salt2: bytes = None)¶
Derive salts from a credential
- desc = 'Use FIDO '¶
- classmethod generate_config(user_ident: str = None, user_name: str = 'pycoffer', user_display_name: str = 'PyCoffer keys', rp_id: str = None, rp_name: str = 'PyCoffer', conf_orig=None)¶
Generate configs. if conf_orig is not None, certs data will be merged inside.
- classmethod get_client(device, origin='local', **kwargs)¶
Locate a CTAP device suitable for use.
If running on Windows as non-admin, the predicate check will be skipped and a webauthn.dll based client will be returned.
Extra kwargs will be passed to the constructor of Fido2Client.
The client will be returned, with the CTAP2 Info, if available.
- classmethod get_devices(extension='hmac-secret')¶
- classmethod get_ident(size=32) str ¶
Get string random ident.
- classmethod get_infos(device, **kwargs)¶
Locate a CTAP device suitable for use.
If running on Windows as non-admin, the predicate check will be skipped and a webauthn.dll based client will be returned.
Extra kwargs will be passed to the constructor of Fido2Client.
The client will be returned, with the CTAP2 Info, if available.
- classmethod get_rp(rp_id: str = 'pycoffer', rp_name: str = 'PyCoffer')¶
Get local RP.
- classmethod list_rps(device, pin)¶
List all FIDO credentials on your key that have the HMAC_SECRET extension enabled experimental
- classmethod register(device, user_ident: str = None, user_name: str = 'pycoffer', user_display_name: str = 'PyCoffer keys', rp_id: str = None, rp_name: str = 'PyCoffer')¶
Register a key and return params as a tuple of dict
- classmethod verify_rp_id(rp_id: str, origin: str) bool ¶
Checks if a Webauthn RP ID is usable for a given origin.
- Parameters:
rp_id – The RP ID to validate.
origin – The origin of the request.
- Returns:
True if the RP ID is usable by the origin, False if not.
pycoffer.plugins.fido_cli module¶
FIDO plugin Click interface
pycoffer.plugins.password module¶
Store passswords in coffer
- class pycoffer.plugins.password.Password¶
Bases:
FilePlugin
,CliInterface
- Info¶
alias of
PasswordInfo
- add(datainfo=None, replace=True)¶
Add or replace info in store
- arcname = '.plugins/passwd'¶
The name of the picke for data. Should be in .plugins/ directory.
- classmethod cli()¶
Lazy loader for click
- delete(datainfo=None)¶
“Delete data at key
- desc = 'Manage password in coffer'¶
- get(key)¶
Get data for key
- getmembers()¶
List public data about passwords in coffer
- import_chrome(filename, replace=True)¶
Import chrome passwords from filename
- store_dump()¶
Dump data in store in coffer
- store_load(data)¶
Load data from store in coffer
- class pycoffer.plugins.password.PasswordInfo(name=None, username=None, password=None, url=None, note=None, owner=None, **kwargs)¶
Bases:
PasswordInfoPublic
- to_public()¶
Remove sensible data
- class pycoffer.plugins.password.PasswordInfoPublic(name=None, username=None, password=None, url=None, note=None, owner=None, **kwargs)¶
Bases:
PluginInfo
pycoffer.plugins.password_cli module¶
Password plugin Click interface
pycoffer.plugins.rsync module¶
Synchronise files
- class pycoffer.plugins.rsync.Rsync¶
Bases:
CofferPlugin
,CliInterface
- classmethod cli()¶
Lazy loader for click
- desc = 'Rsync'¶
- rsync(source, target, dry=False)¶
Synchronize source in coffer target
pycoffer.plugins.rsync_cli module¶
Crypt plugin Click interface
Module contents¶
- class pycoffer.plugins.AuthInterface¶
Bases:
object
The Auth plugin interfacce Used to collect plugins with auth
- class pycoffer.plugins.AuthPlugin¶
Bases:
Plugin
The Auth plugin class
- classmethod authorize(config)¶
Put info in config to authorize access
- category = 'auth'¶
- class pycoffer.plugins.CliInterface¶
Bases:
object
The CLI plugin interfacce Used to collect plugins with cli
- classmethod cli()¶
Load the click interface
- class pycoffer.plugins.CofferPlugin¶
Bases:
Plugin
The Coffer plugin class These plugins have total access to the coffer. They should manage locks, …
- category = 'coffer'¶
- coffer_file¶
The coffer file
- property modified¶
- run(coffer)¶
- class pycoffer.plugins.ConfigInterface¶
Bases:
object
The CLI plugin interfacce Used to collect plugins with cli
- classmethod generate_config()¶
Return a tuple of private_config and cert_config
- class pycoffer.plugins.FilePlugin¶
Bases:
Plugin
The File plugin class These plugins have access to a pickle arcname to store their datas.
- arcname = None¶
The name of the picke for data. Should be in .plugins/ directory.
- category = 'file'¶
- property modified¶
- store_dump(data)¶
- store_load(data)¶
- class pycoffer.plugins.OtherPlugin¶
Bases:
Plugin
The Other plugin class These plugins have access to the crypting method
- category = 'other'¶
- crypt_open¶
The open crypted method