Skip to content

PorresM/kipos-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KIPOS API

Kipos API description.

Table of Contents generated with DocToc

Run

Prerequisite

Dependencies required before installing the project:

Database & mail services setup

Postgresql and MailDev can be easily up and running thanks to this docker-compose command:

docker-compose up

Configuration

  • application.yml file contains the main configuration.
  • application-dev.yml file contains the dev configuration and override the main configuration.
  • application-test.yml file contains the test configuration.

To correctly setup the dev environment, simply add "dev" value to "active profiles" in your Spring boot configuration.

Project dev env links

Development

External references and documentations

Rights and access management

Rights and access management is carried out via Spring Security. The @PreAuthorize annotation is used to check access to an endpoint. Business checks can also be done through the service call in the annotation.

See the documentation: Spring Security 3.0.x

WS HTTP response and Exception handling (ApiException)

To return an HTTP code other than 200 as a response to a WS (in the event of a functional or technical error), all you have to do is throw an ApiException which takes an HTTP code and a message as parameters. It will be caught by an ExceptionHandler and returned in response to the WS with the specified HTTP code. This exception can be called anywhere at any time and it stops the current processing to return the desired error.

Authentication

JWT is used for authentication, which means that for calls requiring authentication, you must have the token retrieved by the /auth /login call and send it in the header of the request:

key: Authorization
value: Bearer {your-token}

About

Kipos API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published