solved a bug on secret validation
This commit is contained in:
parent
05dd9f2482
commit
7f446b680c
|
@ -123,18 +123,22 @@ public class RequestValidator extends RequestHandler {
|
|||
for (SecretFactory<? extends Secret> factory: call.context().allowedSecretFactories()) {
|
||||
try {
|
||||
secret = factory.create(call.request());
|
||||
if (!secret.isValid())
|
||||
RequestError.request_not_authorized_error.fire("authorization with secret "+factory.getSecretClass().getName()+" is not valid ");
|
||||
break;
|
||||
} catch (SecretNotFoundException e) {
|
||||
log.info("authorization with secret {} not found", factory.getSecretClass().getName());
|
||||
} catch (Throwable t) {
|
||||
log.warn("geenric error with secret {}", factory.getSecretClass().getName(), t);
|
||||
log.warn("generic error with secret {}", factory.getSecretClass().getName(), t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Objects.isNull(secret))
|
||||
RequestError.request_not_authorized_error.fire("call not authorized");
|
||||
|
||||
if (!secret.isValid())
|
||||
RequestError.request_not_authorized_error.fire("authorization with secret "+secret.getClass().getSimpleName()+" is not valid ");
|
||||
|
||||
|
||||
return secret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue