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); } }