Motr  M0
Enterprise User Daba-base

Data Structures

struct  m0_udb_domain
 
struct  m0_udb_cred
 
struct  m0_udb_ctxt
 

Enumerations

enum  m0_udb_cred_type { M0_UDB_CRED_INTERNAL, M0_UDB_CRED_EXTERNAL }
 

Functions

M0_INTERNAL int m0_udb_ctxt_init (struct m0_udb_ctxt *ctxt)
 
M0_INTERNAL void m0_udb_ctxt_fini (struct m0_udb_ctxt *ctxt)
 
M0_INTERNAL int m0_udb_add (struct m0_udb_ctxt *ctxt, const struct m0_udb_domain *edomain, const struct m0_udb_cred *external, const struct m0_udb_cred *internal)
 
M0_INTERNAL int m0_udb_del (struct m0_udb_ctxt *ctxt, const struct m0_udb_domain *edomain, const struct m0_udb_cred *external, const struct m0_udb_cred *internal)
 
M0_INTERNAL int m0_udb_e2i (struct m0_udb_ctxt *ctxt, const struct m0_udb_cred *external, struct m0_udb_cred *internal)
 
M0_INTERNAL int m0_udb_i2e (struct m0_udb_ctxt *ctxt, const struct m0_udb_cred *internal, struct m0_udb_cred *external)
 

Detailed Description

Please see the HLD : For documentation links, please refer to this file : doc/motr-design-doc-list.rst

Enumeration Type Documentation

◆ m0_udb_cred_type

Motr User Credential.

There are two categories of user credentials: internal and external. The internal user credentials are used on servers and are stored in persistent storage. All permission checking on server side are based on this. The external user credentials are used on clients. They are visiable to user applications. These user credentials are mapped into internals ones before the system permission checking. At the same time, when internal user credentials in the system are returned to clients, they are mapped into externals ones.

Enumerator
M0_UDB_CRED_INTERNAL 
M0_UDB_CRED_EXTERNAL 

Definition at line 63 of file udb.h.

Function Documentation

◆ m0_udb_add()

M0_INTERNAL int m0_udb_add ( struct m0_udb_ctxt ctxt,
const struct m0_udb_domain edomain,
const struct m0_udb_cred external,
const struct m0_udb_cred internal 
)

add a cred mapping into udb

Parameters
ctxt[in]the udb context.
edomain[in]external credential domain.
external[in]external credential.
internal[in]internal credential.
Returns
0 means success. otherwise failure.

If the external domain is valid and external credential is CRED_ANY, that means to mapping any credentials from this domain to the specified internal credential.

Definition at line 43 of file udb.c.

Here is the caller graph for this function:

◆ m0_udb_ctxt_fini()

M0_INTERNAL void m0_udb_ctxt_fini ( struct m0_udb_ctxt ctxt)

Fini a Motr User Data-base Context

Parameters
ctxtthe udb context

Definition at line 36 of file udb.c.

Here is the caller graph for this function:

◆ m0_udb_ctxt_init()

M0_INTERNAL int m0_udb_ctxt_init ( struct m0_udb_ctxt ctxt)

Init a Motr User Data-base Context.

Parameters
ctxtthe user db context
Returns
0 means success. Otherwise failure.

Definition at line 30 of file udb.c.

Here is the caller graph for this function:

◆ m0_udb_del()

M0_INTERNAL int m0_udb_del ( struct m0_udb_ctxt ctxt,
const struct m0_udb_domain edomain,
const struct m0_udb_cred external,
const struct m0_udb_cred internal 
)

delete a cred mapping into udb

Parameters
ctxt[in]the udb context.
edomain[in]external credential domain.
external[in]external credential.
internal[in]internal credential.
Returns
0 means success. otherwise failure.

Definition at line 52 of file udb.c.

Here is the caller graph for this function:

◆ m0_udb_e2i()

M0_INTERNAL int m0_udb_e2i ( struct m0_udb_ctxt ctxt,
const struct m0_udb_cred external,
struct m0_udb_cred internal 
)

map an external cred to internal cred

Parameters
ctxt[in]the udb context.
external[in]external credential.
internal[out]internal credential.
Returns
0 means success. otherwise failure.

Definition at line 62 of file udb.c.

Here is the caller graph for this function:

◆ m0_udb_i2e()

M0_INTERNAL int m0_udb_i2e ( struct m0_udb_ctxt ctxt,
const struct m0_udb_cred internal,
struct m0_udb_cred external 
)

map an internal cred to external cred

Parameters
ctxt[in]the udb context.
internal[in]internal credential.
external[out]external credential.
Returns
0 means success. otherwise failure.

Definition at line 71 of file udb.c.

Here is the caller graph for this function: