yumapro  20.10-14
YumaPro SDK
External ACM Model

The External ACM handler provides the required access control APIs outside of the server control. More...

Collaboration diagram for External ACM Model:

Typedefs

typedef boolean(* agt_acm_extern_rpc_fn_t) (xml_msg_hdr_t *msg, const xmlChar *user, const obj_template_t *rpcobj)
 Check if the specified user is allowed to invoke an RPC. More...
 
typedef boolean(* agt_acm_extern_notif_fn_t) (const xmlChar *user, const obj_template_t *notifobj)
 Check if the specified user is allowed to receive a notification event. More...
 
typedef boolean(* agt_acm_extern_write_fn_t) (xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *newval, const val_value_t *curval, op_editop_t editop)
 Check if the specified user is allowed to access a value node. More...
 
typedef boolean(* agt_acm_extern_read_fn_t) (xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *val)
 Check if the specified user is allowed to read a value node. More...
 

Functions

status_t agt_acm_extern_init2 (void)
 Phase 2 : Initialize the external data model configuration data structures. More...
 
void agt_acm_extern_init0 (void)
 Init 0 Pre-init 1 phase. More...
 
status_t agt_acm_extern_init1 (void)
 Phase 1: Load the external data module. More...
 
void agt_acm_extern_cleanup (void)
 Cleanup the external access control module. More...
 
status_t agt_acm_extern_init_msg_cache (ses_cb_t *scb, xml_msg_hdr_t *msg)
 Malloc and initialize an agt_acm_cache_t struct and attach it to the incoming message. More...
 
void agt_acm_extern_register_callbacks (agt_acm_extern_rpc_fn_t rpcfn, agt_acm_extern_notif_fn_t notfn, agt_acm_extern_write_fn_t writefn, agt_acm_extern_read_fn_t readfn)
 Register the external callbacks for ACM implementation. More...
 
boolean agt_acm_extern_rpc_allowed (xml_msg_hdr_t *msg, const xmlChar *user, const obj_template_t *rpcobj)
 Check if the specified user is allowed to invoke an RPC. More...
 
boolean agt_acm_extern_notif_allowed (const xmlChar *user, const obj_template_t *notifobj)
 Check if the specified user is allowed to receive a notification event. More...
 
boolean agt_acm_extern_val_write_allowed (xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *newval, const val_value_t *curval, op_editop_t editop)
 Check if the specified user is allowed to access a value node. More...
 
boolean agt_acm_extern_val_read_allowed (xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *val)
 Check if the specified user is allowed to read a value node. More...
 

Detailed Description

The External ACM handler provides the required access control APIs outside of the server control.

The vendor callbacks are required to check access rights each time access is requested by a client.

Typedef Documentation

◆ agt_acm_extern_notif_fn_t

typedef boolean(* agt_acm_extern_notif_fn_t) (const xmlChar *user, const obj_template_t *notifobj)

Check if the specified user is allowed to receive a notification event.

Parameters
useruser name string
notifobjobj_template_t for the notification event to check
Returns
TRUE if user allowed receive this notification event
FALSE otherwise

◆ agt_acm_extern_read_fn_t

typedef boolean(* agt_acm_extern_read_fn_t) (xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *val)

Check if the specified user is allowed to read a value node.

Parameters
msgXML header from incoming message in progress
useruser name string
valval_value_t in progress to check
Returns
TRUE if user allowed read access to the value node

◆ agt_acm_extern_rpc_fn_t

typedef boolean(* agt_acm_extern_rpc_fn_t) (xml_msg_hdr_t *msg, const xmlChar *user, const obj_template_t *rpcobj)

Check if the specified user is allowed to invoke an RPC.

Parameters
msgXML header in incoming message in progress
useruser name string
rpcobjobj_template_t for the RPC method to check
Returns
TRUE if user allowed invoke this RPC; FALSE otherwise

◆ agt_acm_extern_write_fn_t

typedef boolean(* agt_acm_extern_write_fn_t) (xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *newval, const val_value_t *curval, op_editop_t editop)

Check if the specified user is allowed to access a value node.

The val->obj template will be checked against the val->editop requested access and the user's configured max-access

Parameters
msgXML header from incoming message in progress
newvalval_value_t in progress to check
(may be NULL, if curval set)
curvalval_value_t in progress to check
(may be NULL, if newval set)
valval_value_t in progress to check
editoprequested CRUD operation
Returns
TRUE if user allowed this level of access to the value node

Function Documentation

◆ agt_acm_extern_cleanup()

void agt_acm_extern_cleanup ( void  )

Cleanup the external access control module.

Will be called during server terminatation.

Here is the caller graph for this function:

◆ agt_acm_extern_init0()

void agt_acm_extern_init0 ( void  )

Init 0 Pre-init 1 phase.

Pre-Phase 1:

  • Init the callback pointers
  • Need to do this first before the external system library init1 function is called

◆ agt_acm_extern_init1()

status_t agt_acm_extern_init1 ( void  )

Phase 1: Load the external data module.

Returns
status of the initialization procedure
Here is the caller graph for this function:

◆ agt_acm_extern_init2()

status_t agt_acm_extern_init2 ( void  )

Phase 2 : Initialize the external data model configuration data structures.

Returns
status of the initialization procedure
Here is the caller graph for this function:

◆ agt_acm_extern_init_msg_cache()

status_t agt_acm_extern_init_msg_cache ( ses_cb_t scb,
xml_msg_hdr_t msg 
)

Malloc and initialize an agt_acm_cache_t struct and attach it to the incoming message.

Parameters
scbsession control block to use
msgmessage to use
Return values
scb->acm_cachepointer may be set, if it was NULL
msg->acm_cachepointer set
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_acm_extern_notif_allowed()

boolean agt_acm_extern_notif_allowed ( const xmlChar *  user,
const obj_template_t notifobj 
)

Check if the specified user is allowed to receive a notification event.

Parameters
useruser name string
notifobjobj_template_t for the notification event to check
Returns
TRUE if user allowed receive this notification event
FALSE otherwise

◆ agt_acm_extern_register_callbacks()

void agt_acm_extern_register_callbacks ( agt_acm_extern_rpc_fn_t  rpcfn,
agt_acm_extern_notif_fn_t  notfn,
agt_acm_extern_write_fn_t  writefn,
agt_acm_extern_read_fn_t  readfn 
)

Register the external callbacks for ACM implementation.

A NULL callback means that type of access will always be granted!!!

Parameters
rpcfncheck-rpc function callback
notfncheck-notification function callback
writefncheck-val-write function callback
readfncheck-val-write function callback
Here is the caller graph for this function:

◆ agt_acm_extern_rpc_allowed()

boolean agt_acm_extern_rpc_allowed ( xml_msg_hdr_t msg,
const xmlChar *  user,
const obj_template_t rpcobj 
)

Check if the specified user is allowed to invoke an RPC.

Parameters
msgXML header in incoming message in progress
useruser name string
rpcobjobj_template_t for the RPC method to check
Returns
TRUE if user allowed invoke this RPC; FALSE otherwise

◆ agt_acm_extern_val_read_allowed()

boolean agt_acm_extern_val_read_allowed ( xml_msg_hdr_t msg,
const xmlChar *  user,
const val_value_t val 
)

Check if the specified user is allowed to read a value node.

Parameters
msgXML header from incoming message in progress
useruser name string
valval_value_t in progress to check
Returns
TRUE if user allowed read access to the value node
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_acm_extern_val_write_allowed()

boolean agt_acm_extern_val_write_allowed ( xml_msg_hdr_t msg,
const xmlChar *  user,
const val_value_t newval,
const val_value_t curval,
op_editop_t  editop 
)

Check if the specified user is allowed to access a value node.

The val->obj template will be checked against the val->editop requested access and the user's configured max-access

Parameters
msgXML header from incoming message in progress
useruser name string
newvalval_value_t in progress to check
(may be NULL, if curval set)
curvalval_value_t in progress to check
(may be NULL, if newval set)
editoprequested CRUD operation
Returns
TRUE if user allowed this level of access to the value node