Commit 109ceab4 authored by Yadd's avatar Yadd
Browse files

Some comments

parent e9256609
Pipeline #1441 passed with stage
in 2 minutes and 30 seconds
......@@ -8,6 +8,7 @@ server {
internal;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
#fastcgi_pass 127.0.0.1:9090;
# Drop post datas
fastcgi_pass_request_body off;
......
......@@ -9,16 +9,27 @@ sub fetchId {
my $token = $req->{env}->{HTTP_X_LLNG_TOKEN};
return $class->Lemonldap::NG::Handler::Main::fetchId($req) unless ($token);
$class->logger->debug('Found token header');
# Decrypt token
my $s = $class->tsv->{cipher}->decrypt($token);
# Token format:
# time:_session_id:vhost1:vhost2,...
my ( $t, $_session_id, @vhosts ) = split /:/, $s;
# At least one vhost
unless (@vhosts) {
$class->userLogger->error('Bad token');
$class->userLogger->error('Bad service token');
return 0;
}
# Is token in good interval ?
unless ( $t <= time and $t > time - 30 ) {
$class->userLogger->warn('Expired token');
$class->userLogger->warn('Expired service token');
return 0;
}
# Is vhost listed in token ?
my $vh = $class->resolveAlias($req);
unless ( grep { $_ eq $vh } @vhosts ) {
$class->userLogger->error(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment