Skip to content

Commit

Permalink
Delete UNIQUE contraint on subject_dn column
Browse files Browse the repository at this point in the history
of iam_x509_cert because it causes certificate
duplication error with same dn but different issuer
  • Loading branch information
rmiccoli committed Nov 23, 2023
1 parent 2c11a7c commit 9be053f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ public void testx509AccountLinking() throws Exception {
.andExpect(
flash().attribute(ACCOUNT_LINKING_DASHBOARD_MESSAGE_KEY, equalTo(confirmationMsg)));

linkedAccount = iamAccountRepo.findByUsername("test")
.orElseThrow(() -> new AssertionFailedError("Expected user linked to certificate not found"));

assertThat(linkedAccount.getX509Certificates().size(), is(2));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ private HttpHeaders test2SSLHeaders(boolean verified, String verificationError)
private HttpHeaders test1SSLHeaders(boolean verified, String verificationError) {
HttpHeaders headers = new HttpHeaders();
headers.add(DefaultX509AuthenticationCredentialExtractor.Headers.CLIENT_CERT.getHeader(),
TEST_0_CERT_STRING_NGINX);
TEST_1_CERT_STRING_NGINX);

headers.add(DefaultX509AuthenticationCredentialExtractor.Headers.SUBJECT.getHeader(),
TEST_0_SUBJECT);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Drop unique constraint on subject dn
ALTER TABLE iam_x509_cert DROP INDEX subject_dn;

0 comments on commit 9be053f

Please sign in to comment.