From 4aeeeb03658e290ca940184bdfd598d614f5861c Mon Sep 17 00:00:00 2001 From: Martin Weise <martin.weise@tuwien.ac.at> Date: Mon, 31 Mar 2025 12:15:20 +0000 Subject: [PATCH] Cannot use @NotNull with Principal --- .docs/changelog.md | 2 + .../target/create-event-listener.jar | Bin 10141 -> 10141 bytes .../at/tuwien/endpoints/SubsetEndpoint.java | 6 +-- .../at/tuwien/endpoints/TableEndpoint.java | 8 ++-- dbrepo-gateway-service/data.json | 14 ------- .../ifs/dbrepo/endpoints/AccessEndpoint.java | 15 ++++--- .../dbrepo/endpoints/DatabaseEndpoint.java | 14 +++---- .../dbrepo/endpoints/IdentifierEndpoint.java | 8 ++-- .../ifs/dbrepo/endpoints/ImageEndpoint.java | 4 +- .../dbrepo/endpoints/OntologyEndpoint.java | 4 +- .../ifs/dbrepo/endpoints/TableEndpoint.java | 38 ++++++++---------- .../ifs/dbrepo/endpoints/UserEndpoint.java | 6 +-- .../ifs/dbrepo/endpoints/ViewEndpoint.java | 6 +-- .../src/main/resources/datatypes.json | 15 ------- helm/dbrepo/files/create-event-listener.jar | Bin 10141 -> 10141 bytes 15 files changed, 54 insertions(+), 86 deletions(-) delete mode 100644 dbrepo-gateway-service/data.json delete mode 100644 dbrepo-metadata-service/rest-service/src/main/resources/datatypes.json diff --git a/.docs/changelog.md b/.docs/changelog.md index 47439d975f..af778b5ec5 100644 --- a/.docs/changelog.md +++ b/.docs/changelog.md @@ -6,6 +6,8 @@ author: Martin Weise #### Features +* Fixed a bug where validation of missing `Principal` object in Java services caused a 400 error instead of a 401 error + in [#512](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/issues/512). * Refactored internal Java-based testing data that improves test consistency in [#510](https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/issues/510). * Added automated dashboard generation for all public databases where each view has an overview of its data and diff --git a/dbrepo-auth-service/listeners/target/create-event-listener.jar b/dbrepo-auth-service/listeners/target/create-event-listener.jar index 5632a876e9fcc5546b307f7a795c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x80cPV2r_9ro@fm+5Y{uEn#{qLZ7a{d;EJSf?y<S^m@i zCpB?*#d3VNd~Kbw`>x-NQ{1o0*w!+rHZ0jVmDzt?@D<B1pEUfB1sYiKpBAc;__=O_ zNy72N=lfW)<!$Us79?DFVI%$R`-PV0_oQy`<^3%<zx#r-o#)Sb_HTive>QCu6XmU3 zKkL!e3kFMgKJU_Q&63`EaPO+<8$FF2o-5n-AK1u0>+s>qT$_ci<vM!~-IK{&ZngGV zr=I%r;<>2>)6OsVoTuuwG}3hSvk9RueN-3pf1elo_vxK{DHThXn=JenYcnNVSRCb} znkE*0;R8hk7Xt$a1H-$d$r~9}ncgN%zQL#mqBxl3L6jzw8q>R^$$?DTAgYeZ6hv)h z@&?H<F`olbmzaB)-X?8MV42GVqW`n;aDr%Ffm%V3;vU7>AWBnd3I{B<Cm&U^0*Nsy zn}Q6mP__e670UV`YNfInNbaGsHHeZ^aRpJSD$yXhLn<L4N<uXcM0Kdffv6X%P9RE0 QZ8u2eOSMc86{7A505}~K1poj5 diff --git a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/SubsetEndpoint.java b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/SubsetEndpoint.java index fcc9d3cdec..2a7add8ff4 100644 --- a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/SubsetEndpoint.java +++ b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/SubsetEndpoint.java @@ -469,11 +469,11 @@ public class SubsetEndpoint extends RestEndpoint { public ResponseEntity<QueryDto> persist(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("queryId") UUID queryId, @NotNull @Valid @RequestBody QueryPersistDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, RemoteUnavailableException, DatabaseNotFoundException, QueryStorePersistException, DatabaseUnavailableException, QueryNotFoundException, UserNotFoundException, MetadataServiceException { - log.debug("endpoint persist query, databaseId={}, queryId={}, data.persist={}, principal.name={}", databaseId, - queryId, data.getPersist(), principal.getName()); + log.debug("endpoint persist query, databaseId={}, queryId={}, data.persist={}", databaseId, queryId, + data.getPersist()); final DatabaseDto database = cacheService.getDatabase(databaseId); if (!isSystem(principal)) { cacheService.getAccess(databaseId, getId(principal)); diff --git a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java index e801ce2a45..d699fb920d 100644 --- a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java +++ b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/endpoints/TableEndpoint.java @@ -364,7 +364,7 @@ public class TableEndpoint extends RestEndpoint { public ResponseEntity<Void> insertRawTuple(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, @Valid @RequestBody TupleDto data, - @NotNull Principal principal, + Principal principal, @RequestHeader("Authorization") String authorization) throws DatabaseUnavailableException, RemoteUnavailableException, TableNotFoundException, TableMalformedException, QueryMalformedException, NotAllowedException, StorageUnavailableException, @@ -418,7 +418,7 @@ public class TableEndpoint extends RestEndpoint { public ResponseEntity<Void> updateRawTuple(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, @Valid @RequestBody TupleUpdateDto data, - @NotNull Principal principal, + Principal principal, @RequestHeader("Authorization") String authorization) throws DatabaseUnavailableException, RemoteUnavailableException, TableNotFoundException, TableMalformedException, QueryMalformedException, NotAllowedException, MetadataServiceException, @@ -473,7 +473,7 @@ public class TableEndpoint extends RestEndpoint { public ResponseEntity<Void> deleteRawTuple(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, @Valid @RequestBody TupleDeleteDto data, - @NotNull Principal principal, + Principal principal, @RequestHeader("Authorization") String authorization) throws DatabaseUnavailableException, RemoteUnavailableException, TableNotFoundException, TableMalformedException, QueryMalformedException, NotAllowedException, MetadataServiceException, @@ -643,7 +643,7 @@ public class TableEndpoint extends RestEndpoint { public ResponseEntity<Void> importDataset(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, @Valid @RequestBody ImportDto data, - @NotNull Principal principal, + Principal principal, @RequestHeader("Authorization") String authorization) throws RemoteUnavailableException, TableNotFoundException, NotAllowedException, MetadataServiceException, StorageNotFoundException, MalformedException, StorageUnavailableException, QueryMalformedException, diff --git a/dbrepo-gateway-service/data.json b/dbrepo-gateway-service/data.json deleted file mode 100644 index f75a07bba8..0000000000 --- a/dbrepo-gateway-service/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "1", - "value": "235", - "site": "LAA", - "timestamp": "2025-03-09T11:00:00Z" - }, - { - "id": "2", - "value": "44", - "site": "Vienna", - "timestamp": "2025-03-08T12:34:34Z" - } -] diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/AccessEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/AccessEndpoint.java index db425fe839..a605ec126f 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/AccessEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/AccessEndpoint.java @@ -95,7 +95,7 @@ public class AccessEndpoint extends AbstractEndpoint { public ResponseEntity<DatabaseAccessDto> create(@NotNull @PathVariable("databaseId") UUID databaseId, @PathVariable("userId") UUID userId, @Valid @RequestBody CreateAccessDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, UserNotFoundException, AccessNotFoundException, SearchServiceException, SearchServiceConnectionException, DashboardServiceException, DashboardServiceConnectionException { @@ -159,12 +159,12 @@ public class AccessEndpoint extends AbstractEndpoint { public ResponseEntity<Void> update(@NotNull @PathVariable("databaseId") UUID databaseId, @PathVariable("userId") UUID userId, @Valid @RequestBody CreateAccessDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, UserNotFoundException, AccessNotFoundException, SearchServiceException, SearchServiceConnectionException, DashboardServiceException, DashboardServiceConnectionException { - log.debug("endpoint modify database access, databaseId={}, userId={}, access.type={}, principal.name={}", - databaseId, userId, data.getType(), principal.getName()); + log.debug("endpoint modify database access, databaseId={}, userId={}, access.type={}", databaseId, userId, + data.getType()); final Database database = databaseService.findById(databaseId); if (!database.getOwner().getId().equals(getId(principal))) { log.error("Failed to update access: not owner"); @@ -212,10 +212,9 @@ public class AccessEndpoint extends AbstractEndpoint { }) public ResponseEntity<DatabaseAccessDto> find(@NotNull @PathVariable("databaseId") UUID databaseId, @PathVariable("userId") UUID userId, - @NotNull Principal principal) throws DatabaseNotFoundException, + Principal principal) throws DatabaseNotFoundException, UserNotFoundException, AccessNotFoundException, NotAllowedException { - log.debug("endpoint get database access, databaseId={}, userId={}, principal.name={}", databaseId, userId, - principal.getName()); + log.debug("endpoint get database access, databaseId={}, userId={}", databaseId, userId); if (!userId.equals(getId(principal))) { if (!hasRole(principal, "check-foreign-database-access")) { log.error("Failed to find access: foreign user"); @@ -267,7 +266,7 @@ public class AccessEndpoint extends AbstractEndpoint { }) public ResponseEntity<Void> revoke(@NotNull @PathVariable("databaseId") UUID databaseId, @PathVariable("userId") UUID userId, - @NotNull Principal principal) throws NotAllowedException, DataServiceException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, UserNotFoundException, AccessNotFoundException, SearchServiceException, SearchServiceConnectionException, DashboardServiceException, DashboardServiceConnectionException { diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/DatabaseEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/DatabaseEndpoint.java index 41d2801209..0474215e01 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/DatabaseEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/DatabaseEndpoint.java @@ -163,7 +163,7 @@ public class DatabaseEndpoint extends AbstractEndpoint { schema = @Schema(implementation = ApiErrorDto.class))}), }) public ResponseEntity<DatabaseBriefDto> create(@Valid @RequestBody CreateDatabaseDto data, - @NotNull Principal principal) throws DataServiceException, + Principal principal) throws DataServiceException, DataServiceConnectionException, UserNotFoundException, DatabaseNotFoundException, ContainerNotFoundException, SearchServiceException, SearchServiceConnectionException, ContainerQuotaException, DashboardServiceException, DashboardServiceConnectionException { @@ -222,7 +222,7 @@ public class DatabaseEndpoint extends AbstractEndpoint { schema = @Schema(implementation = ApiErrorDto.class))}), }) public ResponseEntity<DatabaseBriefDto> refreshTableMetadata(@NotNull @PathVariable("databaseId") UUID databaseId, - @NotNull Principal principal) throws DataServiceException, + Principal principal) throws DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, SearchServiceException, SearchServiceConnectionException, NotAllowedException, MalformedException, TableNotFoundException { log.debug("endpoint refresh database metadata, databaseId={}", databaseId); @@ -270,10 +270,10 @@ public class DatabaseEndpoint extends AbstractEndpoint { schema = @Schema(implementation = ApiErrorDto.class))}), }) public ResponseEntity<DatabaseBriefDto> refreshViewMetadata(@NotNull @PathVariable("databaseId") UUID databaseId, - @NotNull Principal principal) throws DataServiceException, + Principal principal) throws DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, SearchServiceException, SearchServiceConnectionException, NotAllowedException, ViewNotFoundException { - log.debug("endpoint refresh database metadata, databaseId={}, principal.name={}", databaseId, principal.getName()); + log.debug("endpoint refresh database metadata, databaseId={}", databaseId); final Database database = databaseService.findById(databaseId); if (!database.getOwner().getId().equals(getId(principal))) { log.error("Failed to refresh database views metadata: not owner"); @@ -324,7 +324,7 @@ public class DatabaseEndpoint extends AbstractEndpoint { }) public ResponseEntity<DatabaseBriefDto> visibility(@NotNull @PathVariable("databaseId") UUID databaseId, @Valid @RequestBody DatabaseModifyVisibilityDto data, - @NotNull Principal principal) throws DatabaseNotFoundException, + Principal principal) throws DatabaseNotFoundException, NotAllowedException, SearchServiceException, SearchServiceConnectionException, DashboardServiceException, DashboardServiceConnectionException { log.debug("endpoint modify database visibility, databaseId={}, data={}", databaseId, data); @@ -381,7 +381,7 @@ public class DatabaseEndpoint extends AbstractEndpoint { }) public ResponseEntity<DatabaseBriefDto> transfer(@NotNull @PathVariable("databaseId") UUID databaseId, @Valid @RequestBody DatabaseTransferDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, UserNotFoundException, SearchServiceException, SearchServiceConnectionException { log.debug("endpoint transfer database, databaseId={}, transferDto.id={}", databaseId, data.getId()); @@ -437,7 +437,7 @@ public class DatabaseEndpoint extends AbstractEndpoint { }) public ResponseEntity<DatabaseBriefDto> modifyImage(@NotNull @PathVariable("databaseId") UUID databaseId, @Valid @RequestBody DatabaseModifyImageDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DatabaseNotFoundException, SearchServiceException, SearchServiceConnectionException, StorageUnavailableException, StorageNotFoundException { log.debug("endpoint modify database image, databaseId={}, data.key={}", databaseId, data.getKey()); diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/IdentifierEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/IdentifierEndpoint.java index cf44837a27..ea6e569e52 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/IdentifierEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/IdentifierEndpoint.java @@ -374,13 +374,13 @@ public class IdentifierEndpoint extends AbstractEndpoint { }) public ResponseEntity<IdentifierDto> save(@NotNull @PathVariable("identifierId") UUID identifierId, @NotNull @Valid @RequestBody IdentifierSaveDto data, - @NotNull Principal principal) throws UserNotFoundException, + Principal principal) throws UserNotFoundException, DatabaseNotFoundException, MalformedException, NotAllowedException, DataServiceException, DataServiceConnectionException, SearchServiceException, QueryNotFoundException, SearchServiceConnectionException, IdentifierNotFoundException, ViewNotFoundException, TableNotFoundException, ExternalServiceException { - log.debug("endpoint save identifier, identifierId={}, data.id={}, principal.name={}", identifierId, - data.getId(), principal.getName()); + log.debug("endpoint save identifier, identifierId={}, data.id={}", identifierId, + data.getId()); final Database database = databaseService.findById(data.getDatabaseId()); final User caller = userService.findById(getId(principal)); final Identifier identifier = identifierService.find(identifierId); @@ -475,7 +475,7 @@ public class IdentifierEndpoint extends AbstractEndpoint { schema = @Schema(implementation = ApiErrorDto.class))}), }) public ResponseEntity<IdentifierDto> create(@NotNull @Valid @RequestBody CreateIdentifierDto data, - @NotNull Principal principal) throws DatabaseNotFoundException, + Principal principal) throws DatabaseNotFoundException, UserNotFoundException, NotAllowedException, MalformedException, DataServiceConnectionException, SearchServiceException, DataServiceException, QueryNotFoundException, SearchServiceConnectionException, IdentifierNotFoundException, ViewNotFoundException, ExternalServiceException { diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ImageEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ImageEndpoint.java index cc2dbff7b8..3137e08a68 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ImageEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ImageEndpoint.java @@ -95,9 +95,9 @@ public class ImageEndpoint extends AbstractEndpoint { schema = @Schema(implementation = ApiErrorDto.class))}), }) public ResponseEntity<ImageDto> create(@Valid @RequestBody ImageCreateDto data, - @NotNull Principal principal) throws ImageAlreadyExistsException, + Principal principal) throws ImageAlreadyExistsException, ImageInvalidException { - log.debug("endpoint create image, data={}, principal.name={}", data, principal.getName()); + log.debug("endpoint create image, data={}", data); return ResponseEntity.status(HttpStatus.CREATED) .body(metadataMapper.containerImageToImageDto( imageService.create(data, principal))); diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/OntologyEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/OntologyEndpoint.java index b69e723308..da48971adb 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/OntologyEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/OntologyEndpoint.java @@ -104,8 +104,8 @@ public class OntologyEndpoint extends AbstractEndpoint { schema = @Schema(implementation = OntologyDto.class))}) }) public ResponseEntity<OntologyDto> create(@NotNull @Valid @RequestBody OntologyCreateDto data, - @NotNull Principal principal) { - log.debug("endpoint create ontology, data={}, principal.name={}", data, principal.getName()); + Principal principal) { + log.debug("endpoint create ontology, data={}", data); return ResponseEntity.status(HttpStatus.CREATED) .body(metadataMapper.ontologyToOntologyDto(ontologyService.create(data, principal))); } diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/TableEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/TableEndpoint.java index 67c23e9bc3..211efe731e 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/TableEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/TableEndpoint.java @@ -165,10 +165,9 @@ public class TableEndpoint extends AbstractEndpoint { }) public ResponseEntity<List<EntityDto>> analyseTable(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, - @NotNull Principal principal) + Principal principal) throws MalformedException, TableNotFoundException, DatabaseNotFoundException, NotAllowedException { - log.debug("endpoint analyse table semantics, databaseId={}, tableId={}, principal.name={}", databaseId, tableId, - principal); + log.debug("endpoint analyse table semantics, databaseId={}, tableId={}", databaseId, tableId); final Database database = databaseService.findById(databaseId); final Table table = tableService.findById(database, tableId); if (!table.getOwner().getId().equals(getId(principal))) { @@ -217,11 +216,10 @@ public class TableEndpoint extends AbstractEndpoint { }) public ResponseEntity<Void> updateStatistic(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, - @NotNull Principal principal) + Principal principal) throws TableNotFoundException, DatabaseNotFoundException, SearchServiceException, NotAllowedException, SearchServiceConnectionException, MalformedException, DataServiceException, DataServiceConnectionException { - log.debug("endpoint update table statistics, databaseId={}, tableId={}, principal.name={}", databaseId, tableId, - principal.getName()); + log.debug("endpoint update table statistics, databaseId={}, tableId={}", databaseId, tableId); final Database database = databaseService.findById(databaseId); final Table table = tableService.findById(database, tableId); if (!table.getOwner().getId().equals(getId(principal)) && !isSystem(principal)) { @@ -276,12 +274,12 @@ public class TableEndpoint extends AbstractEndpoint { @NotNull @PathVariable("tableId") UUID tableId, @NotNull @PathVariable("columnId") UUID columnId, @NotNull @Valid @RequestBody ColumnSemanticsUpdateDto updateDto, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, MalformedException, DataServiceException, DataServiceConnectionException, UserNotFoundException, TableNotFoundException, DatabaseNotFoundException, AccessNotFoundException, SearchServiceException, SearchServiceConnectionException, OntologyNotFoundException, SemanticEntityNotFoundException { - log.debug("endpoint update table, databaseId={}, tableId={}, columnId={}, principal.name={}", databaseId, - tableId, columnId, principal.getName()); + log.debug("endpoint update table, databaseId={}, tableId={}, columnId={}", databaseId, + tableId, columnId); final Database database = databaseService.findById(databaseId); final Table table = tableService.findById(database, tableId); if (!hasRole(principal, "modify-foreign-table-column-semantics")) { @@ -325,10 +323,10 @@ public class TableEndpoint extends AbstractEndpoint { public ResponseEntity<List<TableColumnEntityDto>> analyseTableColumn(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, @NotNull @PathVariable("columnId") UUID columnId, - @NotNull Principal principal) + Principal principal) throws MalformedException, TableNotFoundException, DatabaseNotFoundException { - log.debug("endpoint analyse table column semantics, databaseId={}, tableId={}, columnId={}, principal.name={}", - databaseId, tableId, columnId, principal.getName()); + log.debug("endpoint analyse table column semantics, databaseId={}, tableId={}, columnId={}", + databaseId, tableId, columnId); return ResponseEntity.ok() .body(entityService.suggestByColumn( tableService.findColumnById( @@ -381,13 +379,12 @@ public class TableEndpoint extends AbstractEndpoint { }) public ResponseEntity<TableBriefDto> create(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @Valid @RequestBody CreateTableDto data, - @NotNull Principal principal) throws NotAllowedException, MalformedException, + Principal principal) throws NotAllowedException, MalformedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, UserNotFoundException, AccessNotFoundException, TableNotFoundException, TableExistsException, SearchServiceException, SearchServiceConnectionException, OntologyNotFoundException, SemanticEntityNotFoundException, DashboardServiceException, DashboardServiceConnectionException { - log.debug("endpoint create table, databaseId={}, data.name={}, principal.name={}", databaseId, data.getName(), - principal.getName()); + log.debug("endpoint create table, databaseId={}, data.name={}", databaseId, data.getName()); final Database database = databaseService.findById(databaseId); endpointValidator.validateOnlyAccess(database, principal, true); endpointValidator.validateColumnCreateConstraints(data); @@ -439,12 +436,12 @@ public class TableEndpoint extends AbstractEndpoint { public ResponseEntity<TableBriefDto> update(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, @NotNull @Valid @RequestBody TableUpdateDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, TableNotFoundException, SearchServiceException, SearchServiceConnectionException, DashboardServiceException, DashboardServiceConnectionException { - log.debug("endpoint update table, databaseId={}, data.is_public={}, data.is_schema_public={}, principal.name={}", - databaseId, data.getIsPublic(), data.getIsSchemaPublic(), principal.getName()); + log.debug("endpoint update table, databaseId={}, data.is_public={}, data.is_schema_public={}", + databaseId, data.getIsPublic(), data.getIsSchemaPublic()); final Database database = databaseService.findById(databaseId); final Table table = tableService.findById(database, tableId); if (!table.getOwner().getId().equals(getId(principal))) { @@ -544,12 +541,11 @@ public class TableEndpoint extends AbstractEndpoint { }) public ResponseEntity<Void> delete(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("tableId") UUID tableId, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, TableNotFoundException, DatabaseNotFoundException, SearchServiceException, SearchServiceConnectionException, DashboardServiceException, DashboardServiceConnectionException { - log.debug("endpoint delete table, databaseId={}, tableId={}, principal.name={}", databaseId, tableId, - principal.getName()); + log.debug("endpoint delete table, databaseId={}, tableId={}", databaseId, tableId); final Database database = databaseService.findById(databaseId); final Table table = tableService.findById(database, tableId); /* roles */ diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/UserEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/UserEndpoint.java index 996ba610f0..1de29eef1b 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/UserEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/UserEndpoint.java @@ -132,9 +132,9 @@ public class UserEndpoint extends AbstractEndpoint { schema = @Schema(implementation = ApiErrorDto.class))}), }) public ResponseEntity<UserDto> find(@NotNull @PathVariable("userId") UUID userId, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, UserNotFoundException { - log.debug("endpoint find a user, userId={}, principal.name={}", userId, principal.getName()); + log.debug("endpoint find a user, userId={}", userId); /* check */ final User user = userService.findById(userId); if (!user.getId().equals(getId(principal)) && !hasRole(principal, "find-foreign-user")) { @@ -192,7 +192,7 @@ public class UserEndpoint extends AbstractEndpoint { }) public ResponseEntity<UserBriefDto> modify(@NotNull @PathVariable("userId") UUID userId, @NotNull @Valid @RequestBody UserUpdateDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, UserNotFoundException, AuthServiceException { log.debug("endpoint modify a user, userId={}, data={}", userId, data); final User user = userService.findById(userId); diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ViewEndpoint.java b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ViewEndpoint.java index 99d7d2a12d..2c4bfd4e44 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ViewEndpoint.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/ac/tuwien/ifs/dbrepo/endpoints/ViewEndpoint.java @@ -140,7 +140,7 @@ public class ViewEndpoint extends AbstractEndpoint { }) public ResponseEntity<ViewBriefDto> create(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @Valid @RequestBody CreateViewDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, MalformedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, UserNotFoundException, SearchServiceException, SearchServiceConnectionException, TableNotFoundException, ImageNotFoundException, ViewExistsException, DashboardServiceException, DashboardServiceConnectionException { @@ -252,7 +252,7 @@ public class ViewEndpoint extends AbstractEndpoint { }) public ResponseEntity<Void> delete(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("viewId") UUID viewId, - @NotNull Principal principal) throws NotAllowedException, DataServiceException, + Principal principal) throws NotAllowedException, DataServiceException, DataServiceConnectionException, DatabaseNotFoundException, ViewNotFoundException, SearchServiceException, SearchServiceConnectionException, UserNotFoundException, DashboardServiceException, DashboardServiceConnectionException { @@ -308,7 +308,7 @@ public class ViewEndpoint extends AbstractEndpoint { public ResponseEntity<ViewBriefDto> update(@NotNull @PathVariable("databaseId") UUID databaseId, @NotNull @PathVariable("viewId") UUID viewId, @NotNull @Valid @RequestBody ViewUpdateDto data, - @NotNull Principal principal) throws NotAllowedException, + Principal principal) throws NotAllowedException, DataServiceConnectionException, DatabaseNotFoundException, ViewNotFoundException, SearchServiceException, SearchServiceConnectionException, UserNotFoundException, DashboardServiceException, DashboardServiceConnectionException { diff --git a/dbrepo-metadata-service/rest-service/src/main/resources/datatypes.json b/dbrepo-metadata-service/rest-service/src/main/resources/datatypes.json deleted file mode 100644 index 3779d12cbe..0000000000 --- a/dbrepo-metadata-service/rest-service/src/main/resources/datatypes.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "name": "", - "size": { - "min": 0, - "required": true - }, - "d": { - "required": false - }, - "documentation": "https://mariadb.com/kb/en/bigint/", - "quoted": false, - "buildable": true - } -] \ No newline at end of file diff --git a/helm/dbrepo/files/create-event-listener.jar b/helm/dbrepo/files/create-event-listener.jar index 5632a876e9fcc5546b307f7a795c6fbf2087d302..b06b36948412531f7600be5319d91696faf23810 100644 GIT binary patch delta 619 zcmbR1Ki6L<z?+#xgn@yBgCR7pK8o+`PxpyJO7*_QhZF?%rmOvLv}gDsC_FoQYx}i} zWp3H;9j>(*DoWls^6P!~#bYZkXI3+aecSl{<Fu&;RqT8(r6ZPWPoAVG-E#0wlf#J@ zZ)QxInsIPK_3EO#O{&Raa|JfLiA%<&RPS2p_%qv6Vvf?@%U%oCyTqG{O_<~pwL)7< z>dZ>!+gYsJ>rc$9zA|;6@2oYOG$YSwJ@2rYWSa6MFhRm*YAK_t#Gl#k*?#p-@U1)X ze{%8exMeEtYhq9Rd{~fB^<2V?owtqiC`(apS(wF^-b2Tl9;a8@@a(y`F<xwusO^1b z4_%-7A6Et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