VERSION

version 3.4.0.9

SYNOPSIS

  use CipUX::RPC::Server;

DESCRIPTION

Provides the functions for CipUX \s-1RPC\s0 server.

ABSTRACT

The CipUX rpc server is a generic abstract class, which can be used by other classes or scripts.

SUBROUTINES/METHODS

The following functions are implemented or supported by CipUX::RPC::Server.

\s-1BUILD\s0

Constructor, see new.

\s-1DEMOLISH\s0

Destructor.

new

Constructor

Syntax:

my $cipux_rpc = CipUX::RPC::Server->new();

check_authentication

Check weather the login has access or not.

is_ticket_bad

Return 1 if a ticket is \s-1OK\s0 otherwise 0;

signal_handler

Install signal_handler alias time to die.

Syntax:

$server->signal_handler({});

answer_requests

Answer Requests.

Syntax:

$server->answer_requests({ port=>8000, address=>'localhost', reuse=>0, proto=>'tcp', meth_hr=>TODO task_hr=>TODO });

check_access_to_task

Check the access for login to a task.

check_access_to_rpc_intern

Check the access for login to the rpc_intern section.

check_access_to_cat_module

Check the access for login to a \s-1CAT\s0 module.

error

Construct an error message.

evaluate_access

Evaluate the access to login or a given user depending on the sub command (subcmd) of rpc_info or rpc_intern for one or more realms. Known realms are: task, cat_module, rpc_intern.

update_task

Check and update tasks entries.

update_cat_module

Check and update \s-1CAT\s0 modules entries.

log2syslog

Log a given message to syslog.

get_config

Return the value for a given configuration variable.

rpc_list_functions

List the rpc functions.

rpc_start

Start the \s-1RPC\s0 server.

Syntax:

$server->rpc_start({});

ping

The function 'ping' is for testing the connection. It requires not to log in and no arguments. It returns '\s-1OK\s0'.

version

Return the CipUX version.

sum

The function 'sum' is for testing the connection. It requires not to log in and 2 arguments. It returns the sum of the arguments as a hash reference with a single line.

login

Perform a login.

logout

Perform a logout.

session

Check the ticket and if it is valid update and return a new ticket.

ttl

Return the Time To Live. Default 900 seconds.

rpc_task

Execute a CipUX::Task.

rpc_info

Execute a rpc_info sub-command.

task_access

Needs parameter: \s-1TASK\s0

task_access_survey

Needs parameter: \s-1TASK\s0 [\s-1TASK\s0] ...

cat_module_access

Needs parameter: \s-1MODULE\s0

cat_module_access_survey

Needs parameter: \s-1MODULE\s0 [\s-1MODULE\s0] ...

rpc_intern_access

Needs parameter: \s-1COMMAND\s0

rpc_intern_access_survey

Needs parameter: \s-1COMMAND\s0 [\s-1COMMAND\s0] ...

rpc_intern

Execute a rpc_intern sub-command.

ttl

Prints current \s-1TTL\s0 in seconds

cat_module_cache_size

Prints current cat module cache size

rpc_intern_cache_size

Prints current rpc intern cache size

task_cache_size

Prints current task_cache_size of cache

user_task_access

Needs parameter: \s-1USER\s0 \s-1TASK\s0

user_task_access_survey

Needs parameter: $USER \s-1TASK\s0 [\s-1TASK\s0] ...

user_cat_module_access

Needs parameter: \s-1USER\s0 \s-1MODULE\s0

user_cat_module_access_survey

Needs parameter: \s-1USER\s0 \s-1MODULE\s0 [\s-1MODULE\s0] ...

user_rpc_intern_access

Needs parameter: \s-1USER\s0 \s-1COMMAND\s0

user_rpc_intern_access_survey

Needs parameter: \s-1USER\s0 \s-1COMMAND\s0 [\s-1COMMAND\s0] ...

flush_cache

Flush \s-1RPC\s0 server \s-1RBAC\s0 cache

Public XML-RPC functions.

All the following CipUX::Task methods are public. Public means that they could be executed remotely. Public means not that everybody can do this remotely.

There are two kinds of public functions:

(1) Functions without authorization

- login - ping - sum

(2) Every other function is available only after using 'login' function, with a uid as first parameter and a valid ticket as second parameter.

Examples (pseudo code):

- (reference to user list) = cipux_task_list_users( uid, ticket ); - (true|false) = logout( uid, ticket ); - (new ticket|false) = session( uid, ticket );

If the uid do not match, or the uid has not the authorization to use the function, or the group of the uid has not the authorization to use the function, or the ticket is expired, or the ticket is not valid the request will not be fulfilled.

In other words: if the uid match and has the right and the role also has the right and the ticket is valid and is not expired, the request will be executed.

To see real examples have a look at CipUX::RPC::Client client.

DIAGNOSTICS

\s-1TODO\s0

CONFIGURATION AND ENVIRONMENT

Need no environment variables. But do need a configuration file. For example cipux-rpc.ini

DEPENDENCIES

Authen::Simple::PAM Authen::Simple::Password Carp CipUX::Task CipUX::RBAC::Simple Class::Std Data::Dumper English Frontier::Daemon Frontier::RPC2 List::MoreUtils Log::Log4perl Log::Dispatch POSIX Readonly Ticket::Simple

INCOMPATIBILITIES

Not known.

BUGS AND LIMITATIONS

Not known.

RELATED TO CipUX::RPC::Server…

See the CipUX webpage and the manual at <http://www.cipux.org>

See the mailing list http://sympa.cipworx.org/wws/info/cipux-devel <http://sympa.cipworx.org/wws/info/cipux-devel>

AUTHOR

Christian Kuelker <[email protected]>

LICENSE AND COPYRIGHT

Copyright (C) 2007 - 2010 by Christian Kuelker

This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \s-1GNU\s0 General Public License for more details.

You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111-1307 \s-1USA\s0