Modify ServiceToken TTL option (#1773)
This commit is contained in:
parent
dece7d8aa0
commit
455221781f
|
@ -19,7 +19,7 @@ sub fetchId {
|
|||
my ( $t, $_session_id, @vhosts ) = split /:/, $s;
|
||||
|
||||
# $_session_id and at least one vhost
|
||||
unless (@vhosts and $_session_id) {
|
||||
unless ( @vhosts and $_session_id ) {
|
||||
$class->userLogger->error('Bad service token');
|
||||
return 0;
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ sub fetchId {
|
|||
|
||||
# Is token in good interval ?
|
||||
my $localConfig = $class->localConfig;
|
||||
my $ttl = $localConfig->{vhostOptions}->{$vh}->{vhostServiceTokenTTL} || $class->tsv->{handlerServiceTokenTTL};
|
||||
my $ttl =
|
||||
$localConfig->{vhostOptions}->{$vh}->{vhostServiceTokenTTL} <= 0
|
||||
? $class->tsv->{handlerServiceTokenTTL}
|
||||
: $localConfig->{vhostOptions}->{$vh}->{vhostServiceTokenTTL};
|
||||
unless ( $t <= time and $t > time - $ttl ) {
|
||||
$class->userLogger->warn('Expired service token');
|
||||
return 0;
|
||||
|
|
|
@ -3558,7 +3558,7 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
|
|||
'type' => 'int'
|
||||
},
|
||||
'vhostServiceTokenTTL' => {
|
||||
'default' => 30,
|
||||
'default' => -1,
|
||||
'type' => 'int'
|
||||
},
|
||||
'vhostType' => {
|
||||
|
|
|
@ -1698,7 +1698,7 @@ sub attributes {
|
|||
},
|
||||
vhostServiceTokenTTL => {
|
||||
type => 'int',
|
||||
default => 30,
|
||||
default => -1,
|
||||
},
|
||||
vhostAliases => { type => 'text', },
|
||||
vhostType => {
|
||||
|
|
|
@ -1205,7 +1205,7 @@ function templates(tpl,key) {
|
|||
"type" : "int"
|
||||
},
|
||||
{
|
||||
"default" : 30,
|
||||
"default" : -1,
|
||||
"get" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
||||
"id" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
||||
"title" : "vhostServiceTokenTTL",
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user