Skip to content

Provides a number of http-related utilities

License

Notifications You must be signed in to change notification settings

cuioss/cui-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CUI-HTTP

2. What is it?

Security-focused HTTP utilities library providing validation pipelines, SSL/TLS context management, and HTTP client handlers with comprehensive attack pattern detection.

3. Maven Coordinates

<dependency>
    <groupId>de.cuioss</groupId>
    <artifactId>cui-http</artifactId>
</dependency>

Test artifact:

<dependency>
    <groupId>de.cuioss</groupId>
    <artifactId>cui-http</artifactId>
    <classifier>generators</classifier>
    <scope>test</scope>
</dependency>

4. Components

4.1. HTTP Security Validation

  • Validation pipelines for paths, parameters, headers, bodies

  • Attack pattern detection (path traversal, parameter injection, protocol violations)

  • Configuration via SecurityConfigurationBuilder

4.2. HTTP Client Handlers

  • HttpHandler - Builder-based HTTP client with SSL defaults

  • SecureSSLContextProvider - TLS 1.2+ SSL context

  • HttpStatusFamily - RFC 7231 status classification

4.3. Security Testing

  • Attack databases with CVE patterns and OWASP vectors

  • Test data generators for security validation

  • JUnit 5 integration with ArgumentsProvider

5. Usage Example

// HTTP Client
HttpHandler handler = HttpHandler.builder()
    .uri("https://api.example.com/data")
    .connectionTimeoutSeconds(10)
    .build();

HttpClient client = handler.createHttpClient();
HttpRequest request = handler.requestBuilder()
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

// Security Validation
SecurityConfiguration config = SecurityConfiguration.builder()
    .maxPathLength(2048)
    .build();

URLPathValidationPipeline pipeline = new URLPathValidationPipeline(
    config, new SecurityEventCounter());

String validated = pipeline.validate("/api/users/123").orElseThrow();

6. Build Commands

./mvnw clean install          # Build and install
./mvnw test                   # Run tests
./mvnw -Ppre-commit clean verify  # Pre-commit checks (MANDATORY)
./mvnw -Pcoverage clean verify    # Coverage report

8. Dependencies

  • Java 21+

  • cui-java-tools

  • JSpecify (null-safety)

  • Lombok (code generation)

  • JUnit 5 (test only)

About

Provides a number of http-related utilities

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors 3

  •  
  •  
  •  

Languages