[yast-devel] Re: [Bug 537200] [task] [fate 307141] Admin password and e-mail rest service
On Tuesday 08 of September 2009 13:44:03 Bugzilla_NoReply Bugzilla_NoReply wrote:
http://bugzilla.novell.com/show_bug.cgi?id=537200
User kkaempf@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=537200#c3
--- Comment #3 from Klaus Kämpf <kkaempf@novell.com> 2009-09-08 05:44:01 MDT --- (In reply to comment #2)
Lets discuss such things on yast-devel !
Move the final documentation into git, link it from the wiki, and put the wiki url here.
Admin password module proposal (fate #307141) ---------------------------------------------
Tasks: - change administrator (root's) password - configure notification e-mail addresses (mail aliases for root)
- possibly more in the future
Model
singleton class Administrator
attributes string password list aliases
Why would aliases be a list ? I understand the request as "single email address" to send mails to. And, is 'alias' the right name for this ?
I'm thinking about the implementation as an entry in /etc/aliases (we have MailAliases.ycp for that). And here it is possible to assign multiple aliases for one e-mail.
methods (access the system, probably using YaPI::USERS)
set_password set_aliases get_aliases
You don't need set/get prefixes in Ruby.
Ah, well, get_aliases is actually part of find method. set_password and set_aliases are meant as a methods that actually access the system (call YaPI or whatever), not that they just fill the variables. Or there can be one save method, handling both, but I thought more granularity can help testing.
Policies
org.opensuse.yast.modules.yapi.users.administrator.read org.opensuse.yast.modules.yapi.users.administrator.write
API
URL: /administrator
REST service pseudo-code:
# GET method def show
read and return current mail aliases
# PUT method def update (params)
if password changed
save the new password
if aliases changed
save new list of aliases
-- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Jiří Suchomel <jsuchome@suse.cz> [Sep 08. 2009 14:37]:
Model
singleton class Administrator
attributes string password list aliases
Why would aliases be a list ? I understand the request as "single email address" to send mails to. And, is 'alias' the right name for this ?
I'm thinking about the implementation as an entry in /etc/aliases (we have MailAliases.ycp for that). And here it is possible to assign multiple aliases for one e-mail.
Ah, I see. Naming the 'Administrator' attribute 'aliases' exposes too much of the internal implementation. Administrator should rather have a 'forward_mail_to' field which, internally, is implemented using aliases. Later, we would expose aliases via a separate REST model.
methods (access the system, probably using YaPI::USERS)
set_password set_aliases get_aliases
You don't need set/get prefixes in Ruby.
Ah, well, get_aliases is actually part of find method.
set_password and set_aliases are meant as a methods that actually access the system (call YaPI or whatever), not that they just fill the variables.
Understood. In Ruby, 'setters' have an '=' attached. So reading the aliases would be foo = Administrator.aliases and writing them Administrator.aliases = foo
Or there can be one save method, handling both, but I thought more granularity can help testing.
Absolutely ! Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (2)
-
Jiří Suchomel
-
Klaus Kaempf