rrezartprebreza/spring-boot-skills / skills/spring-boot-3/spring-security-review
spring-security-review
VerifiedUse when explicitly reviewing or hardening a Spring Boot application's authorization, request handling, or exposed management endpoints. Not a replacement for ordinary JWT setup or a license to scan deployed systems.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.9 KB |
| agents/openai.yaml | config | 267 B |
| examples/bad-review.md | markdown | 357 B |
| examples/good-review.md | markdown | 729 B |
| templates/DocumentAccess.java | other | 1.6 KB |
templates/DocumentAccess.java
View on GitHubpackage com.example.securityreview;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
public final class DocumentAccess {
public record AccountIdentity(UUID tenantId, UUID accountId) {
public AccountIdentity {
Objects.requireNonNull(tenantId);
Objects.requireNonNull(accountId);
}
}
public interface Store {
Optional<String> findByIdAndTenantIdAndOwnerId(UUID documentId, UUID tenantId, UUID ownerId);
}
private final Store store;
public DocumentAccess(Store store) {
this.store = Objects.requireNonNull(store);
}
// AccountIdentity must be created by trusted authentication/identity mapping, not request binding.
public Optional<String> read(Authentication authentication, UUID documentId) {
if (authentication == null || !authentication.isAuthenticated()
|| authentication instanceof AnonymousAuthenticationToken
|| !(authentication.getPrincipal() instanceof AccountIdentity identity)
|| authentication.getAuthorities().stream()
.noneMatch(authority -> "documents:read".equals(authority.getAuthority()))) {
throw new AccessDeniedException("Document access denied");
}
Objects.requireNonNull(documentId);
return store.findByIdAndTenantIdAndOwnerId(documentId, identity.tenantId(), identity.accountId());
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |