restfeed-server-spring

REST Feed server Spring support

Лицензия

Лицензия

Группа

Группа

org.restfeeds
Идентификатор

Идентификатор

restfeed-server-spring
Последняя версия

Последняя версия

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

restfeed-server-spring
REST Feed server Spring support
Ссылка на сайт

Ссылка на сайт

https://github.com/rest-feeds/rest-feeds
Система контроля версий

Система контроля версий

http://github.com/rest-feeds/restfeed-server-spring/tree/master

Скачать restfeed-server-spring

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.restfeeds/restfeed-server-spring/ -->
<dependency>
    <groupId>org.restfeeds</groupId>
    <artifactId>restfeed-server-spring</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.restfeeds/restfeed-server-spring/
implementation 'org.restfeeds:restfeed-server-spring:0.0.1'
// https://jarcasting.com/artifacts/org.restfeeds/restfeed-server-spring/
implementation ("org.restfeeds:restfeed-server-spring:0.0.1")
'org.restfeeds:restfeed-server-spring:jar:0.0.1'
<dependency org="org.restfeeds" name="restfeed-server-spring" rev="0.0.1">
  <artifact name="restfeed-server-spring" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.restfeeds', module='restfeed-server-spring', version='0.0.1')
)
libraryDependencies += "org.restfeeds" % "restfeed-server-spring" % "0.0.1"
[org.restfeeds/restfeed-server-spring "0.0.1"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-web jar 2.2.2.RELEASE
org.springframework.boot : spring-boot-starter-jdbc Необязательный jar 2.2.2.RELEASE
org.springframework.boot : spring-boot-starter-security Необязательный jar 2.2.2.RELEASE
org.restfeeds : restfeed-server jar 0.0.2

test (3)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-test jar 2.2.2.RELEASE
org.springframework.security : spring-security-test jar
com.h2database : h2 jar 1.4.200

Модули Проекта

Данный проект не имеет модулей.

restfeed-server-spring

Maven Central

Spring Boot support for a REST Feed server endpoint.

Getting Started

Go to start.spring.io and create an new application. Select these dependencies:

  • Spring Web (to provide an HTTP endpoint)
  • JDBC API (for database connectivity)

for testing, you might also want to add

  • H2 Database

Then add this library to your pom.xml:

    <dependency>
      <groupId>org.restfeeds</groupId>
      <artifactId>restfeed-server-spring</artifactId>
      <version>0.0.1</version>
    </dependency>

The RestFeedServerAutoConfiguration adds all relevant beans.

Add these properties to your application.properties:

restfeed.server.feed=myfeed
restfeed.server.path=/myfeed
restfeed.server.limit=1000
restfeed.server.jdbc.table=feed

Next, make sure to have a valid schema for you database set up (use Flyway or the schema.sql file):

create table feed
(
    position identity primary key,
    id       varchar(1024) not null,
    type     varchar(1024),
    resource varchar(1024),
    method   varchar(1024),
    timestamp timestamp,
    data      clob
);

and make sure your database is connected in your application.properties:

spring.datasource.url=jdbc:h2:mem:testdb

Finally, make sure that your application adds new feed items by calling the FeedItemRepository#append method.

feedItemRepository.append(
    "myfeed",
    UUID.randomUUID().toString(),
    "application/vnd.org.example.resource",
    "/myresource/123",
    "PUT",
    Instant.now().toString(),
    data);

When you start the application, you can connect to http://localhost:8080/myfeed.

Find a fully working example at https://github.com/rest-feeds/rest-feed-server-example-spring-web.

Security

Basic Auth is optionally supported.

Add the spring-boot-starter-security dependency to your pom.xml:

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

and specify a username and password in your application.properties:

# alice:secure123
restfeed.server.credentials[0].username=alice
restfeed.server.credentials[0].password={bcrypt}$2a$10$WWJ/p6BOga2R5TRb2LIy4OzlPNiwNM0/aikVKuQ74dKgs67xLIeGS

The password should be encoded, e. g. with BCrypt.

Версии библиотеки

Версия
0.0.1