CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/springboot-security-basics

Security defaults that belong in every Spring Boot application from day one.

88

1.79x
Quality

83%

Does it follow best practices?

Impact

97%

1.79x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Build a Product Catalog API with Spring Boot

Problem/Feature Description

An e-commerce team needs a REST API for managing their product catalog. The API is built with Spring Boot and Java. A Vue.js storefront running on a separate domain will consume it. The API will be deployed on a cloud VM behind an nginx reverse proxy.

The API needs the following endpoints:

  • GET /api/products -- list all products (supports ?category=electronics&sort=price query parameters)
  • GET /api/products/{id} -- get a single product by ID
  • POST /api/products -- create a new product (accepts name, description, price, category, stockQuantity)
  • PATCH /api/products/{id} -- update an existing product
  • DELETE /api/products/{id} -- delete a product
  • POST /api/products/{id}/reviews -- add a review (accepts author, rating 1-5, comment)

Use an in-memory List as the data store. Products should have id, name, description, price, category, stockQuantity, reviews, and createdAt fields.

Output Specification

Produce:

  • ProductController.java -- REST controller with all CRUD endpoints
  • Product.java -- Product model
  • CreateProductRequest.java -- DTO for product creation
  • SecurityConfig.java -- Application security configuration
  • pom.xml -- With all required dependencies

evals

tile.json