NAME
Aut::Backend::Conf - A Config::Frontend backend to Aut.
SYNOPSIS
use Aut;
use Aut::UI::Console;
use Aut::Backend::Conf;
use Config::Frontend;
use Config::Backend::INIREG;
use strict;
my $cfg=new Config::Frontend(new Config::Backend::INIREG("Application"));
my $backend=new Aut::Backend::Conf($cfg);
my $ui=new Aut::UI::Console();
my $aut=new Aut( Backend => $backend,
UI => $ui,
);
(...)
ABSTRACT
'Aut::Backend::Conf' is part of the 'Aut' authorization framework. It provides the a Config::Frontend Aut backend for storing and fetching account related information.
This module can be used as an example module for implementing Aut backends. As it is, it isn't secure enough to be a real Aut backend, because if someone wants to do harm, he/she can just delete e.g. the private key from the configuration file.
A secure backend would be using more secure backends, like implementing it directly on top of an other account system (passwd, SAM, database user access tables, etc.).
DESCRIPTION
Instantiating
new(Config::Frontend) --> Aut::Backend::Conf
This method instantiates a new Aut::Backend::Conf object with given Conf::Frontend object.
Querying
get_keys() --> (list public_key:string private_key:string)
This function returns the currently stored RSA KeyPair in the backend, or undef
if they do not exist.
has_accounts() --> boolean
Returns true, if there are any accounts stored in the backend, returns false, otherwise.
get_all_accounts() --> (list account:string)
Returns all accounts stored in the backend as a list of strings.
pass_ok(account:string, given_pass:string) --> boolean
Returns true, if the password given for the account is valid. Returns false, otherwise.
exists(account:string) --> boolean
Returns true, if account exists in the backend; false otherwise.
Retreiving account information
get_rsa_pass(account:string) --> rsa_cipher_text
Returns the with RSA public key encrypted password for an account, or undef if account does not exist.
get_rights(account:string) --> string
Returns the rights stored for an account, or undef if account does not exist.
get_seed(account:string) --> string
Returns the seed stored for an account, or undef if account does not exist.
get_sr_hash(account:string) --> string
Returns the stored MD5 hash over the concatenation of rights and seed, or undef if account does not exist.
Storing account information
set_keys(public:string,private:string) --> void
Stores the RSA keypair as given by public and private.
set_rsa_pass( account:string, pass:rsa_cipher_text(string) ) --> void
Stores the with the RSA public key encrypted password for account.
set_rights(account:string, rights:string) --> void
Stores the rights for an account.
set_seed(account:string, seed:string) --> void
Stores the seed that is used for keys for an account.
set_sr_hash(account:string, hash:md5_base64(string) ) --> void
Stores the MD5 hash that has been calculated over the concatenation of rights and seed.
Deletion
del_account(account:string) --> void
Deletes account from the backend.
SEE ALSO
AUTHOR
Hans Oesterholt-Dijkema <oesterhol@cpan.org>
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under Artistic license