Skip to content

Commit

Permalink
Fix #460: Configuration startup check
Browse files Browse the repository at this point in the history
Presence check and OTP verification have to be both disabled or both enabled
  • Loading branch information
banterCZ committed Oct 20, 2022
1 parent 86c83dd commit a3c047b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.Assert;

import javax.annotation.PostConstruct;
import java.time.Duration;

/**
Expand Down Expand Up @@ -74,4 +76,9 @@ public class IdentityVerificationConfig {
@Value("${enrollment-server-onboarding.client-evaluation.max-failed-attempts:5}")
private int clientEvaluationMaxFailedAttempts;

@PostConstruct
void validate() {
// Once in the future, we may replace OTP in SCA by NFC document reading
Assert.state(presenceCheckEnabled == verificationOtpEnabled, "Presence check and OTP verification have to be both disabled or both enabled");
}
}

0 comments on commit a3c047b

Please sign in to comment.