py_abac.provider package

Submodules

py_abac.provider.base module

Attribute provider base class

class py_abac.provider.base.AttributeProvider[source]

Bases: object

Attribute provider interface

abstract get_attribute_value(ace: str, attribute_path: str, ctx: EvaluationContext)[source]

Get attribute value for given access control element and attribute path. If attribute not found then returns None.

Parameters
  • ace – Access control element

  • attribute_path – attribute path in ObjectPath format

  • ctx – evaluation context

Returns

attribute value

py_abac.provider.request module

Request attribute provider implementation

class py_abac.provider.request.RequestAttributeProvider(request: py_abac.request.AccessRequest)[source]

Bases: py_abac.provider.base.AttributeProvider

Request attribute provider

get_attribute_value(ace, attribute_path, ctx)[source]

Get value for given access control element and attribute path.

Parameters
  • ace – access control element

  • attribute_path – path to attribute in ObjectPath notation

  • ctx – evaluation context instance

Returns

attribute value

Module contents

Attribute providers