ROLES: ANY
AUTH: NOT REQUIRED
{
"email" : "admin14@gmail.com",
"password" : "pass"
}
returns 200 with JWT authentication token or 403 forbidden in case of invalid credentials
TOKEN PAYLOAD
{
"jti": "zdrowe-jedzenie-jwt",
"sub": "admin14@gmail.com",
"authorities": [
"ROLE_USER"
],
"first-name": "Adam",
"last-name": "Admiński",
"user-id": "b9b49f47-de10-4929-bb28-42cf9e04a06b",
"iat": 1620084842,
"exp": 1620085442
}
TOKEN ENCRYPTION: HS512
ROLES: ANY
AUTH: NOT REQUIRED
{
"email" : "admin14@gmail.com",
"address" : "testowo 10/168",
"password" : "pass",
"confirmPassword": "pass",
"firstName" : "Adam",
"lastName" : "Admiński"
}
creates user and returns 200 or 405 in case of bad password validation user will have role USER by default (non elevated)
ROLES: USER, ADMIN
AUTH: REQUIRED
{
"email" : "admin14@gmail.com",
"address" : "testowo 10/168",
"password" : "pass",
"confirmPassword": "pass",
"firstName" : "Adam",
"lastName" : "Admiński"
}
returns 200 or 405 in case of bad password validation
can only edit your own user entity - otherwise forbidden!
ROLES: ANY
AUTH: NOT REQUIRED
returns products list
ROLES: ANY
AUTH: NOT REQUIRED
returns all product categories
ROLES: ANY
AUTH: NOT REQUIRED
returns array of products of given id
ROLES: ADMIN
AUTH: REQUIRED
{
"name":"bułka",
"description":"przysmak cymes",
"quantity":10
}
adds product to database
ROLES: ADMIN
AUTH: REQUIRED
{
"name": "BONDUELLE Gotowana na parze Cieciorka",
"description": "Cieciorka gotowana na parze to mistrzowskie polaczenie chrupkosci, delikatnosci, pieknej zlotej barwy i skladników odzywczych.",
"category": "Przetwory owocowe i warzywne",
"quantity": 1000,
"price": 5.49
}
edits product in database
ROLES: ADMIN
AUTH: REQUIRED
removes product from database
ROLES: USER
AUTH: REQUIRED
returns active user cart content, user id needs to be authenticated user - otherwise forbidden
ROLES: ANY
AUTH: NOT REQUIRED
returns all stored images - encoded via base64
ROLES: ANY
AUTH: NOT REQUIRED
returns image of product with specified id - encoded via base64
ROLES: ADMIN
AUTH: REQUIRED
{
"id":"1f0ccf58-a390-4aab-af22-439e354d7f50",
"image":"{STRING BASE64}"
}
uploads image for product with specified id - image should be encoded via base64
ROLES: USER WITH ID
AUTH: REQUIRED
{
"productId": "bec096db-7e52-4a4d-9ca3-383dd20e02fb",
"quantity": 3
}
adds product to cart
returns cart content (like GET /cart)
ROLES: USER WITH ID
AUTH: REQUIRED
clears cart for user
ROLES: USER WITH ID
AUTH: REQUIRED
{
"number": "4485568736434905",
"expiration" : "02/26",
"code": "112"
}
creates order out of active user cart - returns 404 if cart doesnt exist