diff --git a/iam-login-service/src/main/java/it/infn/mw/iam/api/requests/exception/GroupRequestValidationError.java b/iam-login-service/src/main/java/it/infn/mw/iam/api/requests/exception/GroupRequestValidationError.java index 7c0475d79..205959e3d 100644 --- a/iam-login-service/src/main/java/it/infn/mw/iam/api/requests/exception/GroupRequestValidationError.java +++ b/iam-login-service/src/main/java/it/infn/mw/iam/api/requests/exception/GroupRequestValidationError.java @@ -22,4 +22,4 @@ public class GroupRequestValidationError extends IllegalArgumentException { public GroupRequestValidationError(String message) { super(message); } -} \ No newline at end of file +} diff --git a/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupIntegrationTests.java b/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupIntegrationTests.java index 960972666..281c8c230 100644 --- a/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupIntegrationTests.java +++ b/iam-login-service/src/test/java/it/infn/mw/iam/test/api/aup/AupIntegrationTests.java @@ -65,9 +65,9 @@ public class AupIntegrationTests extends AupTestSupport { private final String INVALID_AUP_URL = "https://iam.local.io/\""; - private final static String DEFAULT_AUP_TEXT = null; - private final static String DEFAULT_AUP_URL = "http://updated-aup-text.org/"; - private final static String DEFAULT_AUP_DESC = "desc"; + private static final String DEFAULT_AUP_TEXT = null; + private static final String DEFAULT_AUP_URL = "http://updated-aup-text.org/"; + private static final String DEFAULT_AUP_DESC = "desc"; @Autowired diff --git a/iam-persistence/pom.xml b/iam-persistence/pom.xml index ac8ddf060..cfac508e3 100644 --- a/iam-persistence/pom.xml +++ b/iam-persistence/pom.xml @@ -44,11 +44,6 @@ spring-boot-starter-validation - - org.springframework.boot - spring-boot-starter-validation - - org.springframework.boot spring-boot-starter-data-jpa diff --git a/iam-persistence/src/main/java/it/infn/mw/iam/persistence/repository/IamX509CertificateRepository.java b/iam-persistence/src/main/java/it/infn/mw/iam/persistence/repository/IamX509CertificateRepository.java new file mode 100644 index 000000000..7ce6d4ed7 --- /dev/null +++ b/iam-persistence/src/main/java/it/infn/mw/iam/persistence/repository/IamX509CertificateRepository.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2016-2021 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.infn.mw.iam.persistence.repository; + +import java.util.List; +import java.util.Optional; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; + +import it.infn.mw.iam.persistence.model.IamAccount; +import it.infn.mw.iam.persistence.model.IamX509Certificate; + +public interface IamX509CertificateRepository + extends PagingAndSortingRepository { + + @Query("select c.account from IamX509Certificate c where c.subjectDn = :subject") + List findBySubjectDn(@Param("subject") String subject); + + public Optional findBySubjectDnAndIssuerDn(String subjectDn, String issuerDn); + +} \ No newline at end of file