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-2/

Build a Room Booking API with Spring Boot

Problem/Feature Description

A coworking space needs a REST API for managing room bookings. The API is built with Spring Boot and Java. An Angular frontend running on a separate domain will consume it. Users must register and log in to make bookings.

The API needs the following endpoints:

  • POST /api/auth/register -- register a new user (accepts name, email, password)
  • POST /api/auth/login -- authenticate and return user info
  • GET /api/rooms -- list all available rooms
  • POST /api/bookings -- create a booking (accepts roomId, date, startTime, endTime)
  • GET /api/bookings/mine -- list the current user's bookings
  • DELETE /api/bookings/{id} -- cancel a booking (only the booking owner or admin)
  • GET /api/admin/bookings -- list all bookings (admin only)

Use an in-memory data store. Rooms have id, name, capacity. Bookings have id, roomId, userId, date, startTime, endTime, createdAt. Users have id, name, email, password, role (USER/ADMIN).

Output Specification

Produce:

  • SecurityConfig.java -- Spring Security configuration
  • AuthController.java -- Registration and login endpoints
  • BookingController.java -- Booking CRUD endpoints
  • RoomController.java -- Room listing endpoint
  • UserService.java -- User registration and authentication logic
  • pom.xml -- With all required dependencies

evals

tile.json