2023-07-27 13:03:35 +02:00
/ *
2024-09-24 09:42:07 +02:00
* Copyright ( c ) 2020 - present Cloudogu GmbH
2023-07-27 13:03:35 +02:00
*
2024-09-24 09:42:07 +02:00
* This program is free software : you can redistribute it and / or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation , version 3 .
2023-07-27 13:03:35 +02:00
*
2024-09-24 09:42:07 +02:00
* This program is distributed in the hope that it will be useful , but WITHOUT
* ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE . See the GNU Affero General Public License for more
* details .
2023-07-27 13:03:35 +02:00
*
2024-09-24 09:42:07 +02:00
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see https : //www.gnu.org/licenses/.
2023-07-27 13:03:35 +02:00
* /
package sonia.scm.security ;
2023-11-29 18:14:03 +01:00
import jakarta.inject.Inject ;
import sonia.scm.EagerSingleton ;
import sonia.scm.config.ConfigValue ;
2023-07-27 13:03:35 +02:00
2023-11-29 18:14:03 +01:00
@EagerSingleton
public class JwtConfig {
2023-07-27 13:03:35 +02:00
2023-11-29 18:14:03 +01:00
private final boolean endlessJwt ;
@Inject
public JwtConfig (
@ConfigValue (
key = " endlessJwt " ,
defaultValue = " false " ,
2025-02-25 13:16:27 +01:00
description = " The lifespan of the issued JWT tokens should be endless. Logged-in users are no longer automatically logged out. Any other expiration time will be overridden " )
2023-11-29 18:14:03 +01:00
boolean endlessJwt ) {
this . endlessJwt = endlessJwt ;
}
public boolean isEndlessJwtEnabled ( ) {
return this . endlessJwt ;
2023-07-27 13:03:35 +02:00
}
}