cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
src.clm.views.user.key Namespace Reference

Functions

def add
 Adds given Key named name with content key to caller's keys list.
def delete
 Method deletes specified key named name.
def delete_by_id
 Method removes key with id id.
def generate
 Generates Key pair named name for caller.
def get
 Returns the requested Key's.
def get_list
 Returns caller's Keys.

Detailed Description

Note
All functions here are decorated by src.clm.utils.decorators.user_log. It's recommended to read src.clm.utils.decorators.user_log docs before using functions below.

Function Documentation

def src.clm.views.user.key.add (   cm_id,
  caller_id,
  key,
  name 
)

Adds given Key named name with content key to caller's keys list.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
key(POST string) key's content
name(POST string) key's name
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)

Definition at line 124 of file key.py.

def src.clm.views.user.key.delete (   cm_id,
  caller_id,
  name 
)

Method deletes specified key named name.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
name(POST string) name of the Key to delete
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (None)

Definition at line 157 of file key.py.

def src.clm.views.user.key.delete_by_id (   cm_id,
  caller_id,
  key_ids 
)

Method removes key with id id.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
key_ids(POST list(int)) list of Key ids to delete
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict)
    fields:
    • status (string)
    • data (dict)

Definition at line 176 of file key.py.

def src.clm.views.user.key.generate (   cm_id,
  caller_id,
  name 
)

Generates Key pair named name for caller.

Public part of that Key is stored in database with specified name, whereas content of the private Key part is returned. Neither public, nor private part of the key is saved to file. Private part of the key is never stored - it's only returned once.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
name(POST string) Key's name
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (string) content of private Key's file

Definition at line 80 of file key.py.

def src.clm.views.user.key.get (   cm_id,
  caller_id,
  name 
)

Returns the requested Key's.

Key must belong to the caller.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
name(POST string) Requested Key's name
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) Key.dict property of the requested key

Definition at line 46 of file key.py.

def src.clm.views.user.key.get_list (   cm_id,
  caller_id 
)

Returns caller's Keys.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) Key.dict property of each Key

Definition at line 63 of file key.py.