From d2a20dbf460a3c7b3d6eaf7ba0b48229fec3fb86 Mon Sep 17 00:00:00 2001 From: Dmytro Artamonov Date: Mon, 19 Oct 2026 15:26:53 +0300 Subject: [PATCH] fix(config): bind api key length to SECURITY_API_KEY_VALUE_BYTES_SIZE security.api_key.value_bytes_size referenced SECURITY_API_KEY_VALUE_PREFIX, the same variable as value_prefix. SECURITY_API_KEY_VALUE_BYTES_SIZE had no effect, and setting a custom prefix made value_bytes_size resolve to a non-numeric value, which fails int conversion of the @Value injection in ApiKeyServiceImpl and breaks application startup. --- application/src/main/resources/thingsboard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index cf8038545f..adb655496f 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -173,7 +173,7 @@ security: # Prefix for the auto-generated API key. For example, tb_Ood4dQMxWvMH-76z3E_Cv0mZaBWT0Clk3hRSO0P_jNQ value_prefix: "${SECURITY_API_KEY_VALUE_PREFIX:tb_}" # Length of the auto-generated API key. Max is 255 - value_bytes_size: "${SECURITY_API_KEY_VALUE_PREFIX:64}" + value_bytes_size: "${SECURITY_API_KEY_VALUE_BYTES_SIZE:64}" # Enable/disable case-sensitive username login user_login_case_sensitive: "${SECURITY_USER_LOGIN_CASE_SENSITIVE:true}" claim: