From 82cc974d008624db9dc6f36309f885d711aea258 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 1 Dec 2021 10:57:22 +0100 Subject: [PATCH] renamed constant --- .../common/authorization/utils/secret/GCubeSecret.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/common/authorization/utils/secret/GCubeSecret.java b/src/main/java/org/gcube/common/authorization/utils/secret/GCubeSecret.java index 24c545f..9f5d345 100644 --- a/src/main/java/org/gcube/common/authorization/utils/secret/GCubeSecret.java +++ b/src/main/java/org/gcube/common/authorization/utils/secret/GCubeSecret.java @@ -19,13 +19,13 @@ import org.gcube.common.scope.impl.ScopeBean; */ public class GCubeSecret extends Secret { - public static final String TOKEN_REGEX = "^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}-[a-fA-F0-9]{8,9}){1}$"; + public static final String GCUBE_TOKEN_REGEX = "^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}-[a-fA-F0-9]{8,9}){1}$"; @Override protected void check(String token) throws AuthorizationException { super.check(token); - if(!Pattern.matches(GCubeSecret.TOKEN_REGEX, token)) { - throw new AuthorizationException("The GUCBE token must comply with the regex " + TOKEN_REGEX); + if(!Pattern.matches(GCubeSecret.GCUBE_TOKEN_REGEX, token)) { + throw new AuthorizationException("The GUCBE token must comply with the regex " + GCUBE_TOKEN_REGEX); } }