Manage exported variables for WebID (#636)

This commit is contained in:
Clément Oudot 2014-02-18 16:34:08 +00:00
parent 7b9a5b1887
commit c4f277c8c8
5 changed files with 21 additions and 5 deletions

View File

@ -1400,6 +1400,13 @@ has 'webIDAuthnLevel' => (
documentation => 'WebID authentication level', documentation => 'WebID authentication level',
); );
has 'webIDExportedVars' => (
is => 'rw',
isa => 'HashRef',
default => sub { return {}; },
documentation => 'WebID exported variables',
);
has 'whatToTrace' => ( has 'whatToTrace' => (
is => 'rw', is => 'rw',
isa => 'Str', isa => 'Str',

View File

@ -132,6 +132,7 @@ sub unserialize {
|samlStorageOptions |samlStorageOptions
|sessionDataToRemember |sessionDataToRemember
|vhostOptions |vhostOptions
|webIDExportedVars
)$/ )$/
and $v ||= {} and not ref($v) and $v ||= {} and not ref($v)
) )

View File

@ -599,10 +599,16 @@ sub struct {
# WebID # WebID
webIDParams => { webIDParams => {
_nodes => [qw(webIDAuthnLevel webIDWhitelist)], _nodes =>
_help => 'authWebID', [qw(webIDAuthnLevel cn:webIDExportedVars webIDWhitelist)],
webIDAuthnLevel => 'int:webIDAuthnLevel', _help => 'authWebID',
webIDWhitelist => 'text:/webIDWhitelist', webIDAuthnLevel => 'int:webIDAuthnLevel',
webIDExportedVars => {
_nodes => ['hash:/webIDExportedVars:vars:btext'],
_js => 'hashRoot',
_help => 'authWebID',
},
webIDWhitelist => 'text:/webIDWhitelist',
}, },
# DBI # DBI

View File

@ -389,6 +389,7 @@ sub en {
virtualHosts => 'Virtual Hosts', virtualHosts => 'Virtual Hosts',
warning => 'Warning', warning => 'Warning',
webIDAuthnLevel => 'Authentication level', webIDAuthnLevel => 'Authentication level',
webIDExportedVars => 'Exported variables',
webIDParams => 'WebID parameters', webIDParams => 'WebID parameters',
webIDWhitelist => 'WebID whitelist', webIDWhitelist => 'WebID whitelist',
whatToTrace => "REMOTE_USER", whatToTrace => "REMOTE_USER",
@ -880,6 +881,7 @@ sub fr {
virtualHosts => 'Hôtes virtuels', virtualHosts => 'Hôtes virtuels',
warning => 'Attention', warning => 'Attention',
webIDAuthnLevel => 'Niveau d\'authentification', webIDAuthnLevel => 'Niveau d\'authentification',
webIDExportedVars => 'Variables exportées',
webIDParams => 'Paramètres WebID', webIDParams => 'Paramètres WebID',
webIDWhitelist => 'Liste blanche WebID', webIDWhitelist => 'Liste blanche WebID',
whatToTrace => "REMOTE_USER", whatToTrace => "REMOTE_USER",

View File

@ -45,7 +45,7 @@ sub setSessionInfo {
return PE_ERROR; return PE_ERROR;
} }
while ( my ( $k, $v ) = each %{ $self->{exportedVars} } ) { while ( my ( $k, $v ) = each ( %{ $self->{exportedVars} } , %{ $self->{webIDExportedVars} } ) ) {
my $attr = $k; my $attr = $k;
my $req; my $req;
$attr =~ s/^!// and $req = 1; $attr =~ s/^!// and $req = 1;