jsentinel-rest

Integrate jSentinel authentication and authorization into JDK-HttpServer REST applications.

2|Updated Jul 7, 2019
One-click install
npx skills add https://github.com/vaadin-developer/security-for-flow --skill jsentinel-rest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jsentinel-rest
Source: https://github.com/vaadin-developer/security-for-flow/tree/main/docs/skills/claude/jsentinel-rest
Command: npx skills add https://github.com/vaadin-developer/security-for-flow --skill jsentinel-rest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jSentinel-rest, jSentinel-dx-rest, jakarta.servlet-api, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the need for robust security in REST APIs, providing a seamless way to integrate jSentinel into your JDK-HttpServer-based REST application.

Core Features & Use Cases

  • REST API Security: Offers a comprehensive security solution for REST applications using jSentinel.
  • Minimal Stack: Utilizes RestSecurity.bootstrap() and @JSentinelAutoService for easy integration.
  • In-Memory Management: Includes pre-seeded in-memory admin and user accounts, and a TokenStore for Bearer tokens.
  • Endpoint Groups: Supports 4 endpoint groups for authentication, audit, sessions, and users.
  • Use Case: Secure your REST API with minimal effort, ensuring that only authorized users can access sensitive data.

Quick Start

Use the jsentinel-rest skill to secure your REST API by running the following command: ./mvnw -pl <module> -am compile then ./mvnw -pl <module> exec:java -Dexec.mainClass="<base>.RestServer".

Frequently Asked Questions about jsentinel-rest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure a JDK HttpServer REST API with Bearer token authentication?

You can secure a JDK HttpServer REST API by integrating jSentinel to handle Bearer token authentication, session management, and audit logging. It uses RestSecurity.bootstrap() and @JSentinelAutoService for minimal setup.

What is the best way to add session management and audit logging to a REST API?

Adding session management and audit logging to a REST API is achieved by integrating jSentinel. It provides four endpoint groups for authentication, audit, sessions, and users, alongside a TokenStore for managing Bearer tokens.

Can I use jSentinel with a Jakarta Servlet API application?

Yes, you can use jSentinel with a Jakarta Servlet API application. The integration requires jSentinel-rest, jSentinel-dx-rest, and jakarta.servlet-api dependencies to provide authentication and authorization for REST endpoints.

How do I quickly start a REST server with pre-seeded admin and user accounts?

You can quickly start a REST server with pre-seeded in-memory admin and user accounts by compiling your module with ./mvnw compile, then executing the main class using ./mvnw exec:java to launch the secured HttpServer.

Does jSentinel provide built-in user accounts for REST API authentication testing?

Yes, jSentinel provides pre-seeded in-memory admin and user accounts for REST API authentication. This allows you to immediately test authorization and access sensitive data without manually configuring an initial database.

What are the limitations of using in-memory TokenStore for REST API Bearer tokens?

Using an in-memory TokenStore for REST API Bearer tokens limits session persistence to the application's runtime memory. This means all active Bearer tokens and pre-seeded user accounts are lost when the REST server restarts.