-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Authorisation for Revocation Endpoints (#146)
* Add required authorisation for Revocation Endpoints * Remove ValueMappers Wrapper
- Loading branch information
Showing
12 changed files
with
575 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/eu/europa/ec/dgc/gateway/restapi/filter/CertificateAuthenticationRole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*- | ||
* ---license-start | ||
* EU Digital Green Certificate Gateway Service / dgc-gateway | ||
* --- | ||
* Copyright (C) 2021 T-Systems International GmbH and all other contributors | ||
* --- | ||
* 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. | ||
* ---license-end | ||
*/ | ||
|
||
package eu.europa.ec.dgc.gateway.restapi.filter; | ||
|
||
public enum CertificateAuthenticationRole { | ||
|
||
RevocationListReader, | ||
RevocationUploader, | ||
RevocationDeleter | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/eu/europa/ec/dgc/gateway/restapi/mapper/CertificateRoleMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*- | ||
* ---license-start | ||
* EU Digital Green Certificate Gateway Service / dgc-gateway | ||
* --- | ||
* Copyright (C) 2021 T-Systems International GmbH and all other contributors | ||
* --- | ||
* 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. | ||
* ---license-end | ||
*/ | ||
|
||
package eu.europa.ec.dgc.gateway.restapi.mapper; | ||
|
||
import eu.europa.ec.dgc.gateway.entity.TrustedPartyEntity; | ||
import eu.europa.ec.dgc.gateway.restapi.filter.CertificateAuthenticationRole; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.ValueMapping; | ||
|
||
@Mapper(componentModel = "spring") | ||
public interface CertificateRoleMapper { | ||
|
||
@ValueMapping(source = "RevocationListReader", target = "REVOCATION_LIST_READER") | ||
@ValueMapping(source = "RevocationUploader", target = "REVOCATION_UPLOADER") | ||
@ValueMapping(source = "RevocationDeleter", target = "REVOCATION_DELETER") | ||
TrustedPartyEntity.CertificateRoles dtoToEntity(CertificateAuthenticationRole dto); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/resources/db/changelog/add-certificate-roles-table.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.6.xsd"> | ||
|
||
|
||
<changeSet id="add-certificate-roles-table" author="f11h"> | ||
<createTable tableName="trusted_party_roles"> | ||
<column name="trusted_party_entity_id" type="BIGINT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="role" type="VARCHAR"/> | ||
</createTable> | ||
|
||
<addForeignKeyConstraint baseColumnNames="trusted_party_entity_id" baseTableName="trusted_party_roles" | ||
constraintName="fk_trusted_party_roles_on_trusted_party_entity" | ||
referencedColumnNames="id" referencedTableName="trusted_party"/> | ||
</changeSet> | ||
</databaseChangeLog> |
Oops, something went wrong.