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

Build a User Management API with Spring Boot

Problem/Feature Description

A startup needs a user management API built with Spring Boot and Java. The API handles user registration, login, and profile management. A React single-page app hosted on a separate domain will consume this API. The backend will run on AWS behind an Application Load Balancer.

The API needs the following endpoints:

  • POST /api/auth/register -- create a new user account (accepts name, email, password)
  • POST /api/auth/login -- authenticate and return user info
  • GET /api/users/me -- return the current user's profile
  • PATCH /api/users/me -- update the current user's profile (name, email)
  • GET /api/users -- list all users (admin only)
  • DELETE /api/users/{id} -- delete a user account (admin only)

Use an in-memory Map or List as the data store (no database required). Users should have id, name, email, password, role (USER or ADMIN), and createdAt fields.

Output Specification

Produce:

  • SecurityConfig.java -- Spring Security configuration
  • UserController.java -- REST controller with all endpoints
  • UserService.java -- Business logic for user operations
  • User.java -- User entity/model
  • pom.xml -- With all required dependencies

evals

tile.json