Skip to content

Commit

Permalink
Merge pull request #101 from FAIRDataTeam/release/1.7.0
Browse files Browse the repository at this point in the history
Release 1.7.0
  • Loading branch information
MarekSuchanek authored Jan 20, 2021
2 parents 82acd3f + fc86c49 commit 818a703
Show file tree
Hide file tree
Showing 104 changed files with 5,732 additions and 109 deletions.
158 changes: 158 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.7.0]

### Added

- Possibility to change profile and password for current user
- FDP Index functionality (moved from [FAIRDataPoint-index](https://github.com/FAIRDataTeam/FAIRDataPoint-index))
- Harvestor for collecting metadata
- Support for PROF profiles
- Metadata search including RDF type

### Fixed

- Fix schema.org URL in pom.xml

## [1.6.0]

### Added

- API keys
- Draft state for stored metadata

## [1.5.0]

### Added

- Support custom resource definitions allowing more children

### Changed

- Upgrade Java JDK from 11 to 14
- Switch to `OffsetDateTime`

## [1.4.0]

### Added

- Ping service (for *call home* functionality)

### Fixed

- Fix saving of nested entities in metadata
- Fix Git app info in actuator endpoint

### Removed

- `themeTaxonomies` on incoming catalog

## [1.3.0]

### Added

- Shape definitions with DASH support
- Endpoint for bootstrapping [Client]
- Validation for SHACL definitions in shapes
- Production migration for shape definitions

### Changed

- Embed fairmetadata4j into the project
- Split instanceUrl to clientUrl and persistentUrl

### Removed

- Internal PID system
- Dashboard identifier

## [1.2.1]

### Fixed

- HTTP XFF (`X-Forwarded-For`) headers and `PUBLIC_PATH` envvar replaced using `instanceUrl`

## [1.2.0]

### Added

- References to related repositories
- Option to customize metamodel (metadata layers)

### Changed

- Switch to GitHub Actions (from Travis CI)
- Swagger config reflects `instanceUrl`
- Reformatted and updated SHACL definitions to use `sh:and` according to the FDP specification

## [1.1.0]

### Added

- Endpoint for [Client] configuration
- Spring Boot Actuator for monitoring and service info

### Changed

- Unified package names (`dtl` to `dtls`)
- Loading of production configuration

### Fixed

- Fix crashing on mapping null descriptions, licenses, etc.

### Removed

- Fallback to `InMemory` when a connection to the configured repository fails

## [1.0.0]

Refactored and cleaned-up version of reference FAIR Data Point implementation supporting a new [FAIRDataPoint-client](https://github.com/FAIRDataTeam/FAIRDataPoint-client).

### Added

- ACLs and use Spring Security with Mongo for authentication
- User Management and Metadata for [FAIRDataPoint-client](https://github.com/FAIRDataTeam/FAIRDataPoint-client)
- Themes caching for catalog and several other optimizations

### Changed

- Complete refactoring, cleaning accumulated changed and deprecations, reformatting code
- Upgrade Java JDK from 8 to 11
- Enhanced Swagger UI API documentation
- Improve CI (on Travis) to automatically build and publish Docker image

### Fixed

- Several fixes of metadata, configuration, tests, and convertors

## [0.1-beta]

The first release of reference FAIR Data Point implementation.

### Added

- REST API according to the FDP specification supporting `GET`, `POST`, and `PATCH` for **repository**, **catalog**, **dataset**, and **distribution** layers
- API documentation using Swagger UI


[Client]: https://github.com/FAIRDataTeam/FAIRDataPoint-client

[Unreleased]: /../../compare/master...develop
[0.1-beta]: /../../tree/0.1-beta
[1.0.0]: /../../tree/v1.0.0
[1.1.0]: /../../tree/v1.1.0
[1.2.0]: /../../tree/v1.2.0
[1.2.1]: /../../tree/v1.2.1
[1.3.0]: /../../tree/v1.3.0
[1.4.0]: /../../tree/v1.4.0
[1.5.0]: /../../tree/v1.5.0
[1.6.0]: /../../tree/v1.6.0
[1.7.0]: /../../tree/v1.7.0
35 changes: 8 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,22 @@ More information about FDP and how to deploy can be found at [FDP Deployment Doc

**Stack:**

- **Java** (recommended JDK 11)
- **Java** (minimally JDK 14, or higher)
- **Maven** (recommended 3.2.5 or higher)
- **Docker** (recommended 17.09.0-ce or higher) - *for build of production image*

**Additional libraries:**

1. Install `fairmetadata4j`

```bash
$ git clone https://github.com/FAIRDataTeam/fairmetadata4j
$ cd fairmetadata4j
$ mvn install
```
2. Install `spring-rdf-migration`

```
$ git clone https://github.com/FAIRDataTeam/spring-rdf-migration.git
$ cd spring-rdf-migration
$ mvn install
```

3. Install `spring-security-acl-mongodb`
### Build & Run

```
$ git clone https://github.com/FAIRDataTeam/spring-security-acl-mongodb
$ cd spring-security-acl-mongodb
$ mvn install
```
To run the application, a mongodb instance is required to be running. To configure the mongodb address, instruct spring-boot to use the `development` profile. Run these commands from the root of the project.

### Build & Run
```bash
$ mvn spring-boot:run -Dspring-boot.run.profiles=development
```

Run these commands from the root of the project
Alternatively, create an `application.yml` file in the project root and [configure the mongodb address](https://fairdatapoint.readthedocs.io/en/latest/deployment/advanced-configuration.html#mongo-db), and then run these commands from the root of the project.

```bash
$ mvn spring-boot:start
$ mvn spring-boot:run
```

### Run tests
Expand Down
8 changes: 6 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>nl.dtls</groupId>
<artifactId>fairdatapoint</artifactId>
<version>1.6.0</version>
<version>1.7.0</version>
<packaging>jar</packaging>

<name>FairDataPoint</name>
Expand Down Expand Up @@ -130,6 +130,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl-mongodb</artifactId>
Expand Down Expand Up @@ -339,7 +343,7 @@
<prefix>fdp</prefix>
</vocabulary>
<vocabulary>
<url>https://raw.githubusercontent.com/schemaorg/schemaorg/master/data/releases/3.4/schema.ttl</url>
<url>https://raw.githubusercontent.com/schemaorg/schemaorg/main/data/releases/3.4/schema.ttl</url>
<namespace>http://schema.org/</namespace>
<prefix>schemaOrg</prefix>
</vocabulary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
import lombok.extern.slf4j.Slf4j;
import nl.dtls.fairdatapoint.api.dto.error.ErrorDTO;
import nl.dtls.fairdatapoint.entity.exception.*;
import nl.dtls.fairdatapoint.entity.index.exception.IndexException;
import nl.dtls.fairdatapoint.service.metadata.exception.MetadataServiceException;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.Rio;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.web.bind.annotation.ControllerAdvice;
Expand Down Expand Up @@ -112,29 +114,9 @@ public ErrorDTO handleInternalServerError(Exception e) {
return new ErrorDTO(HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage());
}

// @ExceptionHandler(MethodArgumentNotValidException.class)
// @ResponseStatus(HttpStatus.BAD_REQUEST)
// @ResponseBody
// public ErrorDTO processValidationError(MethodArgumentNotValidException ex) {
// BindingResult result = ex.getBindingResult();
// FieldError error = result.getFieldError();
// return processFieldError(error);
// }
//
// private ErrorDTO processFieldError(FieldError error) {
// ErrorResponse errorResponse = new ErrorResponse();
// if (error != null) {
// Locale currentLocale = LocaleContextHolder.getLocale();
//// errorResponse.setMessage(error.getDefaultMessage());
// }
// return new ErrorDTO(HttpStatus.BAD_REQUEST, error.getDefaultMessage());
// }
//
// @ExceptionHandler(JsonMappingException.class)
// @ResponseStatus(HttpStatus.BAD_REQUEST)
// @ResponseBody
// public ErrorDTO processValidationError(JsonMappingException ex) {
// return null;
// }
@ExceptionHandler(IndexException.class)
public ResponseEntity<ErrorDTO> handleIndexException(IndexException exception) {
return new ResponseEntity<>(exception.getErrorDTO(), exception.getStatus());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* The MIT License
* Copyright © 2017 DTL
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package nl.dtls.fairdatapoint.api.controller.index;

import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import nl.dtls.fairdatapoint.entity.index.event.Event;
import nl.dtls.fairdatapoint.service.index.event.EventService;
import nl.dtls.fairdatapoint.service.index.webhook.WebhookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.UUID;

@Log4j2
@RestController
@RequestMapping("/index/admin")
public class AdminController {

@Autowired
private EventService eventService;

@Autowired
private WebhookService webhookService;

@ApiOperation(value = "trigger", hidden = true)
@PostMapping("/trigger")
@PreAuthorize("hasRole('ADMIN')")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void triggerMetadataRetrieve(@RequestParam(required = false) String clientUrl, HttpServletRequest request) {
log.info("Received ping from {}", request.getRemoteAddr());
final Event event = eventService.acceptAdminTrigger(request, clientUrl);
webhookService.triggerWebhooks(event);
eventService.triggerMetadataRetrieval(event);
}

@ApiOperation(value = "ping webhook", hidden = true)
@PostMapping("/ping-webhook")
@PreAuthorize("hasRole('ADMIN')")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void webhookPing(@RequestParam(required = true) UUID webhook, HttpServletRequest request) {
log.info("Received webhook {} ping trigger from {}", webhook, request.getRemoteAddr());
final Event event = webhookService.handleWebhookPing(request, webhook);
webhookService.triggerWebhooks(event);
}
}
Loading

0 comments on commit 818a703

Please sign in to comment.