noc.aaa.models.apikey

Module Contents

class noc.aaa.models.apikey.APIAccess

Bases: mongoengine.document.EmbeddedDocument

api
role
__str__(self)
class noc.aaa.models.apikey.APIAccessACL

Bases: mongoengine.document.EmbeddedDocument

prefix
is_active
description
__str__(self)
class noc.aaa.models.apikey.APIKey

Bases: mongoengine.document.Document

meta
name
is_active
description
expires
key
access
acl
__str__(self)
classmethod get_name_and_access(cls, key, ip=None)

Return access settings for key and key name :param key: API key :param ip: IP address to check against ACL :return: (Name, [(api, role), …]. Name is None for denied permissions

classmethod get_access(cls, key, ip=None)

Return access settings for key :param key: API key :param ip: IP address to check against ACL :return: List of (api, role). Empty list for denied permissions

classmethod get_access_str(cls, key, ip=None)

Return access settings as string :param key: API key :param ip: IP address to check against ACL :return: String of ‘<api>:<role>,<api>:<role>,…’

classmethod get_name_and_access_str(cls, key, ip=None)

Return key name and access settings as string :param key: API key :param ip: IP address to check against ACL :return: