Skip to content

Commit 1b6afe5

Browse files
SK-2071: revert api key validation
1 parent 991a4fc commit 1b6afe5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/com/skyflow/utils/validations/Validations.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ public static void validateCredentials(Credentials credentials) throws SkyflowEx
185185
LogUtil.printErrorLog(ErrorLogs.EMPTY_API_KEY_VALUE.getLog());
186186
throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.EmptyApikey.getMessage());
187187
} else {
188-
// Pattern pattern = Pattern.compile(Constants.API_KEY_REGEX);
189-
// Matcher matcher = pattern.matcher(apiKey);
190-
// if (!matcher.matches()) {
191-
// LogUtil.printErrorLog(ErrorLogs.INVALID_API_KEY.getLog());
192-
// throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.InvalidApikey.getMessage());
193-
// }
188+
Pattern pattern = Pattern.compile(Constants.API_KEY_REGEX);
189+
Matcher matcher = pattern.matcher(apiKey);
190+
if (!matcher.matches()) {
191+
LogUtil.printErrorLog(ErrorLogs.INVALID_API_KEY.getLog());
192+
throw new SkyflowException(ErrorCode.INVALID_INPUT.getCode(), ErrorMessage.InvalidApikey.getMessage());
193+
}
194194
}
195195
} else if (roles != null) {
196196
if (roles.isEmpty()) {

0 commit comments

Comments
 (0)