Solo's Journal Solo's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:47:12+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 Solo's Journal UC4, Perl and TT2 At my day job, we use an enterprise job scheduler called UC4. I don't have experience with its competition to make comparisons, but UC4 itself has a frustrating scripting language built in. It lacks true loop constructs, has only basic expression handling (one operation at a time), and so on. I suppose we'll make a complete list of annoyances one day. For now, I'm more interested in workarounds than vendor developments.<p>One thing that UC4 got right is an XML-based import/export mechanism. Any object (except folders, which are purely organizational) can be exported, modified and imported. Savvy users can even create XML files from scratch and import them, but it's much more practical to edit export files IMO.</p><p> One of my major annoyances with UC4 is how difficult it is to handle the same job or job plan for multiple systems. Solution: Perl and TT2. I can embed TT2 directives in my UC4 objects, export them to XML, process the XML with perl, TT2 and a datafile, import to UC4 and generate the same object for multiple systems. Viola!</p><p> I needed to use START_TAG and END_TAG that UC4 could accomodate, '#$' and '#@' respectively (UC4 has rules about what an object can be named), but apart from that, the processing script was very simple--basically identical to the Template::Plugin::Datafile module. I had a working system in about 15 minutes, once I'd thought of it.</p><p> Is anyone else using UC4 for their job scheduling and feeling the same? I'd post some code and example objects to Perlmonks, but I wonder the audience is too small.</p> Solo 2005-11-11T00:41:47+00:00 journal Three months later I climbed out of the basement It started with learning Nagios. The middle act was a nasty flu bug. The last bit was leaky plumbing in the basement. I once heard that time seems to go by faster as you age because each new day is a smaller percentage of your overall experience. Three months went pretty quick this time.<p> Somewhere along the line I picked up the Mod_Perl Cookbook. Good read, but now behind the Apache 2 curve.</p><p> That book put my finger on one frustration I have with embedded Perl Nagios (ePN). There's no mod_perl-ish perl-status equivalent in ePN. It seems impossible to know basic things like how many and which scripts are loaded and running in ePN, which modules and versions are loaded, etc. I think I'll try to roll my own with Devel::SymDump.</p> Solo 2004-11-15T21:06:24+00:00 journal New manager My new cross-continent manager has been in town, and that's meant more meetings and less time. So, falling behind on everything else Perl.<nobr> <wbr></nobr>:/<p> As part of the (resurgence of) globalization at work we are moving from Big Brother to Nagios. The version of Nagios in use is "2.0a1" with embedded Perl. Gah! Only available in CVS and still in dev! Anyways, my little experience with mod_perl has been getting me by. It's always nice to look like you know what you're doing in front of the new manager.<nobr> <wbr></nobr>;p</p> Solo 2004-08-29T02:44:46+00:00 journal Rate a module a day on I posed a question sort of related to this thought at <a href="">Perlmonks</a>, but this space is my little soapbox, so I'm gonna step on it. <p>I pledge to rate at least one module I use each day on <a href="">CPAN Ratings</a>! (Until I have rated all the modules I use.) </p><p>I challenge everyone else to do the same. </p><p>I don't pledge that I will have anything insightful to say about the module, and I wouldn't have a review text at all except that it's a required field. But I will rate the module 1 - 5 on a combination of how I 'feel' about it, how easy it was for me to use and how helpful I found it. </p><p>Why? Because a statistically relevant sampling of the modules in use, and a comparison of which are more used, is just as important as insightful reviews of modules. Seeing 5 stars with 2 ratings is less meaningful than 4 stars with 50 ratings. </p><p>Whether you dismiss this as 'popularity', it doesn't make the measurement unimportant. Things that are popular are popular for a reason. Things that are widely used have larger support bases (an important consideration in the opensource arena.) Companies and employers <em>like</em> statistics that back decisions. </p><p>But for that kind of data to even exist, more people need to rate the modules they use, whether or not they have a useful review of the modules. </p><p>If we don't want to use this way, it should be called 'CPAN Reviews'. </p><p> <b>Update:</b> <a href="">diotalevi</a> has requested comments on his <a href="">submit-cpan-ratings</a> script that aims to facilitate more ratings and reviews.</p> Solo 2004-08-19T20:09:29+00:00 journal Authorization and Permissions <p>Recently, I've been dealing with authorization issues in applications. I'm beginning to wonder whether or not a 'general-purpose' Authz module could be created. This is not a finished idea. </p><p>Basically everyone understands Authentication and Authorization are different concerns. But, of those concerns, Authentication receives almost all of the coverage. Compare the number of *authen* to *authz* modules on the CPAN. Authorization modules tend to be part of application distributions as well, and not modules for general-use. </p><p>Does the lack of modules represent a lack of interest or need, or an inability to generalize all the bits surrounding authorization? </p><p>Since many people don't exactly agree on definitions*, I'll make my ideas clear. <i>Authorization</i> is the run-time process for determining whether an actor may take action on an object under present conditions and allowing or denying the action. <i>Permissions</i> are the data used in the determination. I call the combination of actor, object acted upon, and conditions <i>context</i>. </p><p>Based on these definitions, the first half of authorization can be thought of as a boolean function of action, context and permissions. </p><blockquote><div><p> <tt>boolean authorized( action, context, permissions )</tt></p></div> </blockquote><p>This function is the determination part of authorization. Allowing or denying is the other half. </p><blockquote><div><p> <tt>if ( authorized( action, context, permissions ) ) {<br>&nbsp; &nbsp; allow action<br>}<br>else {<br>&nbsp; &nbsp; deny action<br>}</tt></p></div> </blockquote><p>That's a pretty general framework for authorization. </p><p>Action is somewhat dependent on the system or application, but there are some common actions that almost always require authorization. </p><blockquote><div><p> <tt>Create&nbsp; &nbsp;Making new things<br>Read&nbsp; &nbsp; &nbsp;Looking at things<br>Update&nbsp; &nbsp;Changing existing things<br>Delete&nbsp; &nbsp;Removing or destroying things<br>Execute&nbsp; Using things</tt></p></div> </blockquote><p>Context includes actor, object and conditions. They are pretty self-explanatory, I'll just mention that actor can be anything authenticated (a person or another program or computer) and object doesn't imply OO, but rather, a thing. Condition represents additional factors that might be important to authorization. Date and time are typical 'condition' examples. </p><p>Permissions are a persisted set of actions and contexts that are either allowed or disallowed. </p><p>Consider some common examples of how authorization is implemented. </p><ul> <li>Apache's<nobr> <wbr></nobr>.htaccess files are the permissions for an actor- and object-based authorization where the directory is the object</li> <li>File permissions include actor, object and action</li> <li>... (add Krang, SPOPS, and Gestinanna )<nobr> <wbr></nobr>...</li> </ul><p>Usually action is represented by an enumeration or bitmask values. Could 'action' be an actual coderef? Can authz code be wrapped around any sub in a Hook::WrapSub manner? </p><p>For command-line apps, a simple 'you do not have permission' message is ok. For GUI apps, the user expects to only see an option if it can be performed. So, an authz/perms system should be able to list the permitted actions for a context. </p><p>Since permissions themselves are 'a thing' or 'things', there might be permissions for permissions. Should this functionality be built in by default? </p><p>Permissions should work with groups--groups of actions, groups of actors and groups of objects. Krang's permissions, for instance, only work with groups. But this may be tricky for a generic authz module, which would have to be told what's in groups, where groups are based on data for the rest of the application. </p><p>... more rambles to come... </p><blockquote><div><p>* I asked some folks what the differences were between 'permissions' and 'authorizations.' The responses I got are repeated here, anonymized for everyone's protection.</p><blockquote><div><p> <i> They're basically the same thing.</i></p><p><i> Authorization is allowing access to a resource if the person has permission to do so. Not quite synonymous, since they can't be interchanged without breaking the grammar.</i></p><p><i> Authorization is "general permission to use the system", while permissions are handed out for every single task there is to perform</i></p><p><i> If someone has been expressly authorized, they have permission, but having permission doesn't mean they have been expressly authorized</i></p><p><i> In computers, authorization is something that permissions can allow or deny</i></p></div> </blockquote></div> </blockquote> Solo 2004-08-18T19:06:51+00:00 journal