Autodoc

HTTP endpoints

POST /gen_key

Generates new key-pair

Example request:
POST /gen_key HTTP 1.1
Content-Type: application/json

{
  "name_real": "foo_bar",
  "name_email": "foo_bar@example.com"
}
request fields:
  • name_real, name_email, name_comment: for key identification
  • key_length: now supports 1024 or 2048 bytes
  • expire: [optional] key expire in days, default 0 means never
Return:

Http response with plain text content

Status Codes:
GET /ping

Checks if server still alive

Status Codes:

Python modules

copr_keygen.logic.create_new_key(app, name_real, name_email, key_length, expire=None, name_comment=None)[source]

Creates new key for user. WARNING! This method doesn’t check for the key duplicity. :param app: Flask application object

Parameters:
  • name_real – name for key identification
  • name_email – email for key identification
  • key_length – length of key in bytes, accepts 1024 or 2048
  • expire – [optional] days for key to expire, default 0 == never expire
  • name_comment – [optional] comment for key
Returns:

(stdout, stderr) from gpg invocation

copr_keygen.logic.ensure_passphrase_exist(app, name_email)[source]

Need this to tell signd server that name_email available in keyring Key not protected by passphrase, so we write something to passphrase file.

copr_keygen.logic.get_passphrase_location(app, name_email)[source]
copr_keygen.logic.user_exists(app, mail)[source]

Checks if the user identified by mail presents in keyring

Returns:bool True when user present
Raises:GpgErrorException
exception copr_keygen.exceptions.BadRequestException(*args, **kwargs)[source]
status_code = 400
exception copr_keygen.exceptions.GpgErrorException(*args, **kwargs)[source]
status_code = 500
exception copr_keygen.exceptions.KeygenServiceBaseException(*args, **kwargs)[source]
msg
status_code = 500