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;
|
my ( $t, $_session_id, @vhosts ) = split /:/, $s;
|
||||||
|
|
||||||
# $_session_id and at least one vhost
|
# $_session_id and at least one vhost
|
||||||
unless (@vhosts and $_session_id) {
|
unless ( @vhosts and $_session_id ) {
|
||||||
$class->userLogger->error('Bad service token');
|
$class->userLogger->error('Bad service token');
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,10 @@ sub fetchId {
|
||||||
|
|
||||||
# Is token in good interval ?
|
# Is token in good interval ?
|
||||||
my $localConfig = $class->localConfig;
|
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 ) {
|
unless ( $t <= time and $t > time - $ttl ) {
|
||||||
$class->userLogger->warn('Expired service token');
|
$class->userLogger->warn('Expired service token');
|
||||||
return 0;
|
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'
|
'type' => 'int'
|
||||||
},
|
},
|
||||||
'vhostServiceTokenTTL' => {
|
'vhostServiceTokenTTL' => {
|
||||||
'default' => 30,
|
'default' => -1,
|
||||||
'type' => 'int'
|
'type' => 'int'
|
||||||
},
|
},
|
||||||
'vhostType' => {
|
'vhostType' => {
|
||||||
|
|
|
@ -1698,7 +1698,7 @@ sub attributes {
|
||||||
},
|
},
|
||||||
vhostServiceTokenTTL => {
|
vhostServiceTokenTTL => {
|
||||||
type => 'int',
|
type => 'int',
|
||||||
default => 30,
|
default => -1,
|
||||||
},
|
},
|
||||||
vhostAliases => { type => 'text', },
|
vhostAliases => { type => 'text', },
|
||||||
vhostType => {
|
vhostType => {
|
||||||
|
|
|
@ -1205,7 +1205,7 @@ function templates(tpl,key) {
|
||||||
"type" : "int"
|
"type" : "int"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default" : 30,
|
"default" : -1,
|
||||||
"get" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
"get" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
||||||
"id" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
"id" : tpl+"s/"+key+"/"+"vhostServiceTokenTTL",
|
||||||
"title" : "vhostServiceTokenTTL",
|
"title" : "vhostServiceTokenTTL",
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user