Package: digdeo-syspass-client
digdeo-syspass-clientPython API Client for SysPass server (https://www.syspass.org/en)Implemented APIBoth 100% Cover and 100% UnitTested3.0:https://syspass-doc.readthedocs.io/en/3.0/3.1:https://syspass-doc.readthedocs.io/en/3.1/Cool but what i need to use it ?The API Client require settings like the server and token ;)
It have many ways to inject that setting, via config file and/or by ENV vars.Permanent configuration::That is suppose to be the default setting , where a fileconfig.ymlis store in user space.That standard is describe on FreeDedktop web site.https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.htmlThen by follow recommendation and standard we use$HOME/.config/digdeo-syspass-client/as default directory for searchconfig.ymlfile.You can change the$XDG_CONFIG_HOME/digdeo-syspass-client/config.ymlsearch by set a ENV varsyspass_config_dirthen$HOME/.config/digdeo-syspass-client/config.ymlwill become$syspass_config_dir/config.ymlFor more information's  take a look on FreeDesktop XDG recommendation.Config fileYou can use any type of key here, in our usage that is a Read Only key.syspassclient:
  api_url: 'https://you.server.exemple.com/api.php'
  api_version: '3.1'
  authToken: '######################################################'
  tokenPass: '######################################################'
  verify_ssl: True
  debug: False
  debug_level: 0
  verbose: False
  verbose_level: 0Variablessyspass_config_dirsyspass_auth_tokensyspass_token_passsyspass_verify_sslsyspass_api_urlsyspass_api_versionsyspass_debugsyspass_debug_LEVELsyspass_verbosesyspass_verbose_levelsyspass_config_dirShortcut the$HOME/.config/digdeo-syspass-clientdefault path by the value of the variablesyspass_auth_tokenShortcut theauthTokenset inside theconfig.ymlsyspass_verify_sslIf it variable is set then, SSL certificates will be verify.Note that is PythonRequestsmodule it deal with SSL certificate , if you take a look of it module documentation, you'll be inform about how deal with self signed certificates.
In summary, Requests module  useREQUESTS_CA_BUNDLEenv variable, for get the SSL Bundle certificate file path of you system.Example:exportREQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"Theca-certificates.crtfile is generate by system package callca-certificatesand must be re-generate each time you add a new self-signed certificate.Exemple:sudocpmy.cert/usr/local/share/ca-certificates/
sudoupdate-ca-certificatesFor many programming language, self signed certificates addition, require to inform the system about that new self-signed certificates existence.The SSL Bundle Certificates , is common thing for SSL and is not impose by Python it self. If you want more information's, back to you system documentation for know more about SSL bundle cert .syspass_token_passShortcut thetokenPassset inside theconfig.ymlsyspass_api_urlShortcut theapi_urlset inside theconfig.ymlsyspass_api_versionShortcut theapi_versionset inside theconfig.ymlsyspass_debugShortcut thedebugset inside theconfig.ymlsyspass_debug_LEVELShortcut thedebug_levelset inside theconfig.ymlsyspass_verboseShortcut theverboseset inside theconfig.yamlsyspass_verbose_levelShortcut theverbose_levelset inside theconfig.ymlTipsIf you would like to change token on fly, you'll have to play with$syspass_config_dirand a subdirectory structure.Syspassclient can start without config.yml file and is suppose to use Variables , that permit to make tests inside a CI.DigDeo FLOSS Team - 2020