Motr Capabilities are an implementation of Capability-based security as described here: http://en.wikipedia.org/wiki/Capability-based_security
The idea is that an authority managing some object (e.g., a lock, a file, a layout, etc., basically, a resource), issues a capability together with this object. Other parties can verify that a capability was issued by the authority but cannot forge capabilities. A typical use case is that a client receives a capability attached to some piece of file system state and then forwards the capability together with the state to another node. For example, a capability attached to a fid and sent back to the server which produced the fid and the capability, can be used to deal with fid-guessing attack. Capabilities can be forwarded to the nodes different from ones where they originated.
Capability HLD : For documentation links, please refer to this file : doc/motr-design-doc-list.rst
◆ anonymous enum
Enumerator |
---|
M0_CAPA_HMAC_MAX_LEN | |
Definition at line 72 of file capa.h.
◆ m0_capa_entity_type
Capability Protected Entity Type
Enumerator |
---|
M0_CAPA_ENTITY_OBJECT | |
M0_CAPA_ENTITY_LOCKS | |
M0_CAPA_ENTITY_LAYOUT | |
Definition at line 58 of file capa.h.
◆ m0_capa_operation
Capability Operations
Enumerator |
---|
M0_CAPA_OP_DATA_READ | |
M0_CAPA_OP_DATA_WRITE | |
Definition at line 67 of file capa.h.
◆ m0_capa_auth()
Authenticate an operation
- Parameters
-
ctxt | [in]the execution context. |
capa | [in]capability to be authenticated. |
op | [in] target operation. |
- Returns
- 0 means permission is granted. -EPERM means access denied, and others mean error.
Definition at line 75 of file capa.c.
◆ m0_capa_ctxt_fini()
M0_INTERNAL void m0_capa_ctxt_fini |
( |
struct m0_capa_ctxt * |
ctxt | ) |
|
Fini a Motr Capability Context
- Parameters
-
ctxt | the execution context |
Definition at line 89 of file capa.c.
◆ m0_capa_ctxt_init()
M0_INTERNAL int m0_capa_ctxt_init |
( |
struct m0_capa_ctxt * |
ctxt | ) |
|
Init a Motr Capability Context
- Parameters
-
ctxt | the execution context |
- Returns
- 0 means success. Otherwise failure.
Definition at line 83 of file capa.c.
◆ m0_capa_fini()
◆ m0_capa_get()
Get Capability for an object for specified operation
- Parameters
-
ctxt | [in]the execution context. |
owner | [in] owner of this capa. |
capa | [in][out]result will be stored here. |
- Returns
- 0 means success. Otherwise failure.
- Precondition
- m0_capa_new() should be called successfully. Reference count will be bumped.
Definition at line 54 of file capa.c.
◆ m0_capa_init()
◆ m0_capa_new()
New Capability for an object for specified operation
- Parameters
-
capa | [in][out]result will be stored here. |
type | [in] type of the capability. |
opcode | [in] operation code. |
data | [in] opaque object that this capability protects. |
- Returns
- 0 means success. Otherwise failure.
Reference count will be initialzed to zero.
Definition at line 41 of file capa.c.
◆ m0_capa_put()