Commit b2620c26 authored by Yadd's avatar Yadd

s/datas/data

datas => des données
data => les données
parent 9402f9ff
...@@ -144,7 +144,7 @@ sub base { ...@@ -144,7 +144,7 @@ sub base {
## @method hashRef get(string id) ## @method hashRef get(string id)
# @param $id Apache::Session session ID. # @param $id Apache::Session session ID.
# @return User datas # @return User data
sub get { sub get {
my $self = shift; my $self = shift;
my $id = shift; my $id = shift;
...@@ -165,7 +165,7 @@ sub get { ...@@ -165,7 +165,7 @@ sub get {
## @method hashRef newSession() ## @method hashRef newSession()
# Build a new Apache::Session session. # Build a new Apache::Session session.
# @return User datas (just the session ID) # @return User data (just the session ID)
sub newSession { sub newSession {
my $self = shift; my $self = shift;
$self->generate unless ( $self->{data}->{_session_id} ); $self->generate unless ( $self->{data}->{_session_id} );
...@@ -200,7 +200,7 @@ sub newSession { ...@@ -200,7 +200,7 @@ sub newSession {
} }
## @method boolean save() ## @method boolean save()
# Save user datas if modified. # Save user data if modified.
sub save { sub save {
my $self = shift; my $self = shift;
return unless ( $self->{modified} ); return unless ( $self->{modified} );
......
...@@ -147,7 +147,7 @@ sub _soapCall { ...@@ -147,7 +147,7 @@ sub _soapCall {
## @method hashRef get(string id) ## @method hashRef get(string id)
# @param $id Apache::Session session ID. # @param $id Apache::Session session ID.
# @return User datas # @return User data
sub get { sub get {
my $self = shift; my $self = shift;
my $id = shift; my $id = shift;
...@@ -169,7 +169,7 @@ sub get { ...@@ -169,7 +169,7 @@ sub get {
## @method hashRef newSession() ## @method hashRef newSession()
# Build a new Apache::Session session. # Build a new Apache::Session session.
# @return User datas (just the session ID) # @return User data (just the session ID)
sub newSession { sub newSession {
my $self = shift; my $self = shift;
$self->{data} = $self->_soapCall("newSession"); $self->{data} = $self->_soapCall("newSession");
...@@ -187,7 +187,7 @@ sub newSession { ...@@ -187,7 +187,7 @@ sub newSession {
} }
## @method boolean save() ## @method boolean save()
# Save user datas if modified. # Save user data if modified.
sub save { sub save {
my $self = shift; my $self = shift;
return unless ( $self->{modified} ); return unless ( $self->{modified} );
......
...@@ -100,18 +100,18 @@ sub getConfByNum { ...@@ -100,18 +100,18 @@ sub getConfByNum {
# * openIdIDPList() (old OpenID) # * openIdIDPList() (old OpenID)
# * applicationList() # * applicationList()
# - root: # - root:
# root query (/confs/latest for example) is redirected to metadatas() # root query (/confs/latest for example) is redirected to metadata()
# - other requests: # - other requests:
# they are managed by getKey() # they are managed by getKey()
# - newRSAKey() returns a new RSA key pair if /confs/newRSAKey is called in a # - newRSAKey() returns a new RSA key pair if /confs/newRSAKey is called in a
# POST request # POST request
# - prx() load a request and return the content (for SAML/OIDC metadatas) # - prx() load a request and return the content (for SAML/OIDC metadata)
# 31 - Complex subnodes # 31 - Complex subnodes
# ---------------- # ----------------
## @method PSGI-JSON-response complexNodesRoot($req, $query, $tpl) ## @method PSGI-JSON-response complexNodesRoot($req, $query, $tpl)
# Respond to root requests for virtual hosts and SAMLmetadatas # Respond to root requests for virtual hosts and SAMLmetadata
# #
#@param $req Lemonldap::NG::Common::PSGI::Request #@param $req Lemonldap::NG::Common::PSGI::Request
#@param $query Configuration root key #@param $query Configuration root key
...@@ -686,15 +686,15 @@ sub combModules { ...@@ -686,15 +686,15 @@ sub combModules {
# 33 - Root queries # 33 - Root queries
# ----------- # -----------
## @method PSGI-JSON-response metadatas($req) ## @method PSGI-JSON-response metadata($req)
# Respond to `/conf/:cfgNum` requests by sending configuration metadatas # Respond to `/conf/:cfgNum` requests by sending configuration metadata
# #
# NB: if `full=1` is set in the query, configuration is returned directly in # NB: if `full=1` is set in the query, configuration is returned directly in
# JSON # JSON
# #
#@param $req Lemonldap::NG::Common::PSGI::Request #@param $req Lemonldap::NG::Common::PSGI::Request
#@return PSGI JSON response #@return PSGI JSON response
sub metadatas { sub metadata {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
if ( $req->params('full') and $req->params('full') !~ NO ) { if ( $req->params('full') and $req->params('full') !~ NO ) {
my $c = $self->getConfKey( $req, 'cfgNum' ); my $c = $self->getConfKey( $req, 'cfgNum' );
...@@ -738,13 +738,13 @@ sub metadatas { ...@@ -738,13 +738,13 @@ sub metadatas {
if ( $self->can('userId') ) { if ( $self->can('userId') ) {
$self->userLogger->info( 'User ' $self->userLogger->info( 'User '
. $self->userId($req) . $self->userId($req)
. ' ask for configuration metadatas (' . ' ask for configuration metadata ('
. $res->{cfgNum} . $res->{cfgNum}
. ')' ); . ')' );
} }
else { else {
$self->logger->info( $self->logger->info(
"REST request to get configuration metadatas ($res->{cfgNum})" "REST request to get configuration metadata ($res->{cfgNum})"
); );
} }
return $self->sendJSONresponse( $req, $res ); return $self->sendJSONresponse( $req, $res );
...@@ -764,7 +764,7 @@ sub metadatas { ...@@ -764,7 +764,7 @@ sub metadatas {
sub getKey { sub getKey {
my ( $self, $req, $key, $subkey ) = @_; my ( $self, $req, $key, $subkey ) = @_;
unless ($key) { unless ($key) {
return $self->metadatas($req); return $self->metadata($req);
} }
$self->userLogger->info( $self->userLogger->info(
'User ' . $self->userId($req) . " asks for key $key" ); 'User ' . $self->userId($req) . " asks for key $key" );
......
...@@ -50,8 +50,8 @@ sub _getCipher { ...@@ -50,8 +50,8 @@ sub _getCipher {
## @method string encrypt(string data) ## @method string encrypt(string data)
# Encrypt $data and return it in Base64 format # Encrypt $data and return it in Base64 format
# @param data datas to encrypt # @param data data to encrypt
# @return encrypted datas in Base64 format # @return encrypted data in Base64 format
sub encrypt { sub encrypt {
my ( $self, $data ) = @_; my ( $self, $data ) = @_;
...@@ -73,8 +73,8 @@ sub encrypt { ...@@ -73,8 +73,8 @@ sub encrypt {
## @method string decrypt(string data) ## @method string decrypt(string data)
# Decrypt $data and return it # Decrypt $data and return it
# @param data datas to decrypt in Base64 format # @param data data to decrypt in Base64 format
# @return decrypted datas # @return decrypted data
sub decrypt { sub decrypt {
my ( $self, $data ) = @_; my ( $self, $data ) = @_;
$data =~ s/%2B/\+/ig; $data =~ s/%2B/\+/ig;
...@@ -100,9 +100,9 @@ sub decrypt { ...@@ -100,9 +100,9 @@ sub decrypt {
# Encrypt $data and return it in hexadecimal format # Encrypt $data and return it in hexadecimal format
# Data must be hexadecimal and its length must be a multiple of 32 # Data must be hexadecimal and its length must be a multiple of 32
# the encrypted data have same length as the original data # the encrypted data have same length as the original data
# @param data datas to encrypt # @param data data to encrypt
# @param key optional secondary key # @param key optional secondary key
# @return encrypted datas in hexadecimal data # @return encrypted data in hexadecimal data
sub encryptHex { sub encryptHex {
my ( $self, $data, $key ) = @_; my ( $self, $data, $key ) = @_;
return _cryptHex( $self, $data, $key, "encrypt" ); return _cryptHex( $self, $data, $key, "encrypt" );
...@@ -112,9 +112,9 @@ sub encryptHex { ...@@ -112,9 +112,9 @@ sub encryptHex {
# Decrypt $data and return it in hexadecimal format # Decrypt $data and return it in hexadecimal format
# Data must be hexadecimal and its length must be a multiple of 32 # Data must be hexadecimal and its length must be a multiple of 32
# the decrypted data have same length as the encrypted data # the decrypted data have same length as the encrypted data
# @param data datas to decrypt # @param data data to decrypt
# @param key optional secondary key # @param key optional secondary key
# @return decrypted datas in hexadecimal data # @return decrypted data in hexadecimal data
sub decryptHex { sub decryptHex {
my ( $self, $data, $key ) = @_; my ( $self, $data, $key ) = @_;
return _cryptHex( $self, $data, $key, "decrypt" ); return _cryptHex( $self, $data, $key, "decrypt" );
...@@ -122,10 +122,10 @@ sub decryptHex { ...@@ -122,10 +122,10 @@ sub decryptHex {
## @method private string _cryptHex (string data, string key, string sub) ## @method private string _cryptHex (string data, string key, string sub)
# Auxiliary method to share code between encrypt and decrypt # Auxiliary method to share code between encrypt and decrypt
# @param data datas to decrypt # @param data data to decrypt
# @param key secondary key # @param key secondary key
# @param sub may be "encrypt" or "decrypt" # @param sub may be "encrypt" or "decrypt"
# @return decrypted datas in hexadecimal data # @return decrypted data in hexadecimal data
sub _cryptHex { sub _cryptHex {
my ( $self, $data, $key, $sub ) = @_; my ( $self, $data, $key, $sub ) = @_;
unless ( $data =~ /^([0-9a-fA-F]{2})*$/ ) { unless ( $data =~ /^([0-9a-fA-F]{2})*$/ ) {
......
...@@ -17,7 +17,7 @@ sub newNotification { ...@@ -17,7 +17,7 @@ sub newNotification {
my @notifs; my @notifs;
$json = [$json] unless ( ref($json) eq 'ARRAY' ); $json = [$json] unless ( ref($json) eq 'ARRAY' );
foreach my $notif (@$json) { foreach my $notif (@$json) {
my @datas; my @data;
# Mandatory information # Mandatory information
foreach (qw(date uid reference)) { foreach (qw(date uid reference)) {
...@@ -26,10 +26,10 @@ sub newNotification { ...@@ -26,10 +26,10 @@ sub newNotification {
$self->logger->error("Attribute $_ is missing"); $self->logger->error("Attribute $_ is missing");
return 0; return 0;
} }
push @datas, $tmp; push @data, $tmp;
} }
push @datas, ( $notif->{condition} // '' ); push @data, ( $notif->{condition} // '' );
push @notifs, [ @datas, $jsonString ]; push @notifs, [ @data, $jsonString ];
} }
my $count; my $count;
foreach (@notifs) { foreach (@notifs) {
......
...@@ -14,7 +14,7 @@ has parser => ( ...@@ -14,7 +14,7 @@ has parser => (
} }
); );
# Check XML datas and insert new notifications. # Check XML data and insert new notifications.
# @param $xml XML string containing notification # @param $xml XML string containing notification
# @return number of notifications done # @return number of notifications done
sub newNotification { sub newNotification {
...@@ -29,7 +29,7 @@ sub newNotification { ...@@ -29,7 +29,7 @@ sub newNotification {
foreach foreach
my $notif ( $xml->documentElement->getElementsByTagName('notification') ) my $notif ( $xml->documentElement->getElementsByTagName('notification') )
{ {
my @datas = (); my @data = ();
# Mandatory information # Mandatory information
foreach (qw(date uid reference)) { foreach (qw(date uid reference)) {
...@@ -38,16 +38,16 @@ sub newNotification { ...@@ -38,16 +38,16 @@ sub newNotification {
$self->logger->error("Attribute $_ is missing"); $self->logger->error("Attribute $_ is missing");
return 0; return 0;
} }
push @datas, $tmp; push @data, $tmp;
} }
# Other information # Other information
foreach (qw(condition)) { foreach (qw(condition)) {
my $tmp; my $tmp;
if ( $tmp = $notif->getAttribute($_) ) { if ( $tmp = $notif->getAttribute($_) ) {
push @datas, $tmp; push @data, $tmp;
} }
else { push @datas, ""; } else { push @data, ""; }
} }
my $result = XML::LibXML::Document->new( $version, $encoding ); my $result = XML::LibXML::Document->new( $version, $encoding );
...@@ -56,7 +56,7 @@ sub newNotification { ...@@ -56,7 +56,7 @@ sub newNotification {
$result->setDocumentElement($root); $result->setDocumentElement($root);
$result = $result->serialize; $result = $result->serialize;
utf8::encode($result); utf8::encode($result);
push @notifs, [ @datas, $result ]; push @notifs, [ @data, $result ];
} }
my $count; my $count;
foreach (@notifs) { foreach (@notifs) {
......
...@@ -33,13 +33,13 @@ sub new { ...@@ -33,13 +33,13 @@ sub new {
$self->env->{PATH_INFO} ||= '/'; $self->env->{PATH_INFO} ||= '/';
$self->{uri} = uri_unescape( $self->env->{REQUEST_URI} ); $self->{uri} = uri_unescape( $self->env->{REQUEST_URI} );
$self->{uri} =~ s|^//+|/|g; $self->{uri} =~ s|^//+|/|g;
$self->{datas} = {}; $self->{data} = {};
$self->{error} = 0; $self->{error} = 0;
$self->{respHeaders} = []; $self->{respHeaders} = [];
return bless( $self, $_[0] ); return bless( $self, $_[0] );
} }
sub datas { $_[0]->{datas} } sub data { $_[0]->{data} }
sub uri { $_[0]->{uri} } sub uri { $_[0]->{uri} }
......
...@@ -20,12 +20,12 @@ sub new { ...@@ -20,12 +20,12 @@ sub new {
return bless { obj => $obj, func => \@func, req => $req }, $class; return bless { obj => $obj, func => \@func, req => $req }, $class;
} }
## @method datas AUTOLOAD() ## @method data AUTOLOAD()
# Call the wanted function with the object given to the constructor. # Call the wanted function with the object given to the constructor.
# AUTOLOAD() is a magic method called by Perl interpreter fon non existent # AUTOLOAD() is a magic method called by Perl interpreter fon non existent
# functions. Here, we use it to call the wanted function (given by $AUTOLOAD) # functions. Here, we use it to call the wanted function (given by $AUTOLOAD)
# if it is authorizated # if it is authorizated
# @return datas provided by the exported function # @return data provided by the exported function
sub AUTOLOAD { sub AUTOLOAD {
my $self = shift; my $self = shift;
$AUTOLOAD =~ s/.*:://; $AUTOLOAD =~ s/.*:://;
......
...@@ -162,7 +162,7 @@ sub redirectFilter { ...@@ -162,7 +162,7 @@ sub redirectFilter {
while ( $f->read( my $buffer, 1024 ) ) { while ( $f->read( my $buffer, 1024 ) ) {
} }
$class->updateStatus( $f->r, '$class->REDIRECT', $class->updateStatus( $f->r, '$class->REDIRECT',
$class->datas->{ $class->tsv->{whatToTrace} }, 'filter' ); $class->data->{ $class->tsv->{whatToTrace} }, 'filter' );
return $class->OK; return $class->OK;
} }
......
...@@ -62,9 +62,9 @@ sub new { ...@@ -62,9 +62,9 @@ sub new {
return $self; return $self;
} }
sub datas { sub data {
my ($self) = @_; my ($self) = @_;
return $self->{datas} ||= {}; return $self->{data} ||= {};
} }
1; 1;
...@@ -169,7 +169,7 @@ sub _authAndTrace { ...@@ -169,7 +169,7 @@ sub _authAndTrace {
} }
## @method hashRef user() ## @method hashRef user()
# @return hash of user datas # @return hash of user data
sub user { sub user {
my ( $self, $req ) = @_; my ( $self, $req ) = @_;
return $req->userData return $req->userData
......
...@@ -94,7 +94,7 @@ sub run { ...@@ -94,7 +94,7 @@ sub run {
unless $class->_isAlive(); unless $class->_isAlive();
# Value to store # Value to store
my $value = $class->datas->{$secureTokenAttribute}; my $value = $class->data->{$secureTokenAttribute};
# Set token # Set token
my $key = $class->_setToken( $value, $secureTokenExpiration ); my $key = $class->_setToken( $value, $secureTokenExpiration );
......
...@@ -53,7 +53,7 @@ sub run { ...@@ -53,7 +53,7 @@ sub run {
# Build URL # Build URL
my $zimbra_url = my $zimbra_url =
$class->_buildZimbraPreAuthUrl( $req, $zimbraPreAuthKey, $zimbraUrl, $class->_buildZimbraPreAuthUrl( $req, $zimbraPreAuthKey, $zimbraUrl,
$class->datas->{$zimbraAccountKey}, $class->data->{$zimbraAccountKey},
$zimbraBy, $timeout ); $zimbraBy, $timeout );
# Header location # Header location
...@@ -76,7 +76,7 @@ sub _buildZimbraPreAuthUrl { ...@@ -76,7 +76,7 @@ sub _buildZimbraPreAuthUrl {
# Expiration time is calculated with _utime and timeout # Expiration time is calculated with _utime and timeout
my $expires = my $expires =
$timeout ? ( $class->datas->{_utime} + $timeout ) * 1000 : $timeout; $timeout ? ( $class->data->{_utime} + $timeout ) * 1000 : $timeout;
# Timestamp # Timestamp
my $timestamp = time() * 1000; my $timestamp = time() * 1000;
......
...@@ -406,7 +406,7 @@ sub postUrlInit { ...@@ -406,7 +406,7 @@ sub postUrlInit {
{ {
$class->tsv->{maintenance}->{$vhost} = 1; $class->tsv->{maintenance}->{$vhost} = 1;
$class->logger->error( $class->logger->error(
"$class: Unable to build post datas: " "$class: Unable to build post data: "
. $class->tsv->{jail}->error ); . $class->tsv->{jail}->error );
} }
...@@ -552,7 +552,7 @@ sub substitute { ...@@ -552,7 +552,7 @@ sub substitute {
$expr =~ s/\$vhost\b/\$ENV{HTTP_HOST}/sg; $expr =~ s/\$vhost\b/\$ENV{HTTP_HOST}/sg;
$expr =~ s/\$ip\b/\$ENV{REMOTE_ADDR}/sg; $expr =~ s/\$ip\b/\$ENV{REMOTE_ADDR}/sg;
# substitute vars with session datas, excepts special vars $_ and $\d+ # substitute vars with session data, excepts special vars $_ and $\d+
$expr =~ s/\$(?!ENV)([_a-zA-Z]\w*)/\$s->{$1}/sg; $expr =~ s/\$(?!ENV)([_a-zA-Z]\w*)/\$s->{$1}/sg;
$expr =~ s/\$ENV\{/\$r->{env}->\{/g; $expr =~ s/\$ENV\{/\$r->{env}->\{/g;
......
...@@ -160,7 +160,7 @@ sub run { ...@@ -160,7 +160,7 @@ sub run {
# Store local macros # Store local macros
if ( keys %$session > $kc ) { if ( keys %$session > $kc ) {
$class->logger->debug("Update local cache"); $class->logger->debug("Update local cache");
$req->datas->{session}->update( $session, { updateCache => 2 } ); $req->data->{session}->update( $session, { updateCache => 2 } );
} }
# Hide Lemonldap::NG cookie # Hide Lemonldap::NG cookie
...@@ -435,16 +435,16 @@ sub retrieveSession { ...@@ -435,16 +435,16 @@ sub retrieveSession {
# persistent connection). # persistent connection).
# NB: timout is here the same value as current HTTP/1.1 Keep-Alive timeout # NB: timout is here the same value as current HTTP/1.1 Keep-Alive timeout
# (15 seconds) # (15 seconds)
if ( defined $class->datas->{_session_id} if ( defined $class->data->{_session_id}
and $id eq $class->datas->{_session_id} and $id eq $class->data->{_session_id}
and ( $now - $class->datasUpdate < 15 ) )