felix-reichel / kotlin-spring-boot-rest-jpa-jwt-starter

kotlin spring-boot 2 rest/jpa/jwt starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kotlin-spring-boot-rest-jpa-jwt-starter

Build Status

Features:

  • spring-boot 2.1.0.RELEASE
  • kotlin 1.3.0
  • JWT Authentication/Authorization with spring-security inspired by Auth0
  • JPA mysql
  • Junit 5 Tests
  • Travis CI

Install

  • create mysql db
CREATE DATABASE starterspringkotlin;
GRANT ALL ON starterspringkotlin.* TO starterspringkotlin@localhost IDENTIFIED BY 'starterspringkotlin';
FLUSH PRIVILEGES;
  • compile and run
mvn clean compile test
mvn spring-boot:run

Test

curl http://localhost:4080/starter-test/api/test
curl http://localhost:4080/starter-test/api/restricted
curl -i -H "Content-Type: application/json" -X POST -d '{ "username": "john.doe", "password": "test1234"}' http://localhost:4080/starter-test/login
curl  -H "Authorization: Bearer ******"  http://localhost:4080/starter-test/api/restricted
curl -H "Authorization: Bearer ******" http://localhost:4080/starter-test/actuator/health

Changelog

  • v0.2.0-SNAPSHOT: update spring-boot 2.1.0 and kotlin 1.3.0
  • v0.1.0-SNAPSHOT: switch to jar packaging standalone app, update kotlin 1.2.61, jwt 0.10.5
  • v0.0.5-SNAPSHOT: update spring-boot 2.0.4.RELEASE, kotlin 1.2.60, jwt 0.10.1
  • v0.0.4-SNAPSHOT: update spring-boot 2.0.3.RELEASE
  • v0.0.3-SNAPSHOT: update spring-boot 2.0.2.RELEASE, kotlin 1.2.50, removed custom RestExceptionHandler
  • v0.0.2-SNAPSHOT: update spring-boot 2.0.0.RELEASE, kotlin 1.2.30, Junit5 5.1.0

About

kotlin spring-boot 2 rest/jpa/jwt starter

License:MIT License


Languages

Language:Kotlin 100.0%