Changeset 1537

Show
Ignore:
Timestamp:
04/03/05 19:42:29
Author:
miyagawa
Message:

0.03 release

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Kwiki-TypeKey/trunk/Changes

    r1532 r1537  
    11Revision history for Perl extension Kwiki::TypeKey 
     2 
     30.03  Fri Apr  1 20:16:20 JST 2005 
     4        * Added logout feature (wacky code to override Spoon cookie capability) 
     5        - Now $tk->skip_expiry_check is always 1 
     6        - need_email=0 
    27 
    380.02  Wed Mar 30 04:47:19 JST 2005 
    49        * Fixed timing of plugin/users creation to avoid perms problem 
    5           (Old installaers: Make sure plugins/users is writable by Kwiki user) 
     10          (Old installers: Make sure plugins/users is writable by Kwiki user) 
    611        * Added Kwiki::Edit::TypeKeyRequired 
    712        - add PREREQ to Makefile.PL 
  • Kwiki-TypeKey/trunk/Makefile.PL

    r1532 r1537  
    77        Authen::TypeKey => 0.02, 
    88        Kwiki => 0.37, 
     9        Kwiki::UserName => 0.14, 
    910    }, 
    1011); 
  • Kwiki-TypeKey/trunk/lib/Kwiki/Edit/TypeKeyRequired.pm

    r1532 r1537  
    11package Kwiki::Edit::TypeKeyRequired; 
    22use strict; 
    3 our $VERSION = 0.02
     3our $VERSION = 0.03
    44 
    55use Kwiki::Plugin '-Base'; 
  • Kwiki-TypeKey/trunk/lib/Kwiki/TypeKey.pm

    r1532 r1537  
    55use mixin 'Kwiki::Installer'; 
    66 
    7 our $VERSION = 0.02
     7our $VERSION = 0.03
    88 
    99const class_id => 'user_name'; 
     
    1616    $registry->add(preload => 'user_name'); 
    1717    $registry->add(action  => "return_typekey"); 
     18    $registry->add(action  => "logout_typekey"); 
    1819} 
    1920 
     
    3334HTML 
    3435    ; 
     36} 
     37 
     38sub logout_typekey { 
     39    $self->hub->cookie->write(typekey => {}); 
     40    # XXX This is the only way to override Kwiki/Spoon Cookie expires, Ingy! 
     41    no warnings 'redefine'; 
     42    my $old = Kwiki::Cookie->can('expires'); 
     43    *Kwiki::Cookie::expires = sub { 
     44        ($_ eq 'typekey') ? 
     45            do { *Kwiki::Cookie::expires = $old; "-3d" } : "+5y"; 
     46    }; 
     47    $self->render_screen(content_pane => 'logout_typekey.html'); 
    3548} 
    3649 
     
    5871 
    5972  > $EDITOR plugins 
    60   # Kwiki::UserName <-- If you use it, comment it out 
     73  # Kwiki::UserName <- If you use it, comment it out 
    6174  Kwiki::TypeKey 
    6275  Kwiki::Edit::TypeKeyRequired <- Optional: If you don't allow anonymous writes 
    6376  > $EDITOR config.yaml 
    6477  users_class: Kwiki::Users::TypeKey 
    65   tk_token: YOUR_TYPEKEY_TOKEN 
     78  tk_token:    YOUR_TYPEKEY_TOKEN 
    6679  script_name: http://www.example.com/kwiki/index.cgi <- needs absURI 
    6780  > kwiki -update 
    68   > chmod go+w plugin/users 
    6981 
    7082=head1 DESCRIPTION 
     
    7991=item * 
    8092 
    81 Now this plugin stores TypeKey response query to cookie store and verifies the data in every request to avoid spoofed cookie. It means every time it issues GET request to TypeKey servers (with If-Modified-Since) and do some crypto calculation, which should be avoided. 
     93Now this plugin stores TypeKey response query to cookie store and verifies the data in every request to avoid spoofed cookie. It means every time it issues GET request to TypeKey servers (with If-Modified-Since) and do some crypto calculation, which should be avoided. We need a patch for Authen::TypeKey. 
    8294 
    8395=item * 
     
    113125<div id="user_name_title"> 
    114126<em>[% IF hub.users.current.name -%] 
    115 (Logged In as <a href="http://profile.typekey.com/[% hub.users.current.name %]/">[% hub.users.current.nick | html %]</a>
     127(Logged In as <a href="http://profile.typekey.com/[% hub.users.current.name %]/">[% hub.users.current.nick | html %]</a>: <a href="[% script_name %]?action=logout_typekey">Logout</a>
    116128[%- ELSE -%] 
    117 [%- USE tk = url("https://www.typekey.com/t/typekey/login") -%]  
    118 (Not Logged In. <a href="[% back = script_name _ "?action=return_typekey&page=" _ hub.cgi.page_name; tk(t=tk_token, v="1.1", _return=back, need_email=1) %]">Login via TypeKey</a>) 
     129[%- USE tk = url("https://www.typekey.com/t/typekey/login") -%] 
     130(Not Logged In: <a href="[% back = script_name _ "?action=return_typekey&page=" _ hub.cgi.page_name; tk(t=tk_token, v="1.1", _return=back, need_email=0) %]">Login via TypeKey</a>) 
    119131[%- END %] 
    120132</em> 
    121133</div> 
    122134<!-- END user_name_title.html --> 
     135__template/tt2/logout_typekey.html__ 
     136<!-- BEGIN logout_typekey.html --> 
     137<p>You've now successfully logged out.</p> 
     138<!-- END logout_typekey.html --> 
  • Kwiki-TypeKey/trunk/lib/Kwiki/Users/TypeKey.pm

    r1532 r1537  
    33use Authen::TypeKey; 
    44 
    5 our $VERSION = 0.02
     5our $VERSION = 0.03
    66use Kwiki::Users '-Base'; 
    77 
     
    3737    return unless $self->is_in_cgi; 
    3838    my $name = ''; 
    39     my $cookie = $self->hub->cookie->jar->{typekey} or return; 
     39    my $cookie = $self->hub->cookie->jar->{typekey}; 
     40    $cookie && $cookie->{sig} or return; 
    4041 
    4142    $self->validate_sig($cookie) or return; 
     
    5253    $tk->key_cache($self->hub->config->tk_key_cache); 
    5354    $tk->token($self->hub->config->tk_token); 
    54     my $expires = $self->hub->config->tk_expires; 
    55     if ($expires == 0){ 
    56         $tk->skip_expiry_check(1); 
    57     } else { 
    58         $tk->expires($expires); 
    59     } 
     55    $tk->skip_expiry_check(1); 
    6056    my $res = $tk->verify($q) or warn $tk->errstr; 
    6157    $res; 
     
    6965__config/typekey.yaml__ 
    7066tk_token: PUT YOUR TOKEN HERE 
    71 tk_expires: 604800 
    7267tk_key_cache: plugin/users/keycache.txt