renamed constant
This commit is contained in:
parent
00ef2c1944
commit
82cc974d00
|
@ -19,13 +19,13 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
*/
|
*/
|
||||||
public class GCubeSecret extends Secret {
|
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
|
@Override
|
||||||
protected void check(String token) throws AuthorizationException {
|
protected void check(String token) throws AuthorizationException {
|
||||||
super.check(token);
|
super.check(token);
|
||||||
if(!Pattern.matches(GCubeSecret.TOKEN_REGEX, token)) {
|
if(!Pattern.matches(GCubeSecret.GCUBE_TOKEN_REGEX, token)) {
|
||||||
throw new AuthorizationException("The GUCBE token must comply with the regex " + TOKEN_REGEX);
|
throw new AuthorizationException("The GUCBE token must comply with the regex " + GCUBE_TOKEN_REGEX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue