Download the PHP package ctw/ctw-middleware-generatedby without Composer

On this page you can find all versions of the php package ctw/ctw-middleware-generatedby. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ctw-middleware-generatedby

Package "ctw/ctw-middleware-generatedby"

Latest Stable Version GitHub Actions

PSR-15 middleware that adds an X-Generated-By header containing a UUID v5 identifier derived from server IP and hostname, enabling anonymous server identification in load-balanced environments.

Introduction

Why This Library Exists

In multi-server deployments behind load balancers, identifying which application server processed a request is essential for debugging and monitoring. However, exposing server IP addresses in response headers creates security risks and violates infrastructure privacy.

This middleware generates a deterministic UUID v5 from the server's IP address (SERVER_ADDR) and hostname (SERVER_NAME):

Problems This Library Solves

  1. Blind load balancing: Without server identification, debugging issues in clustered environments is difficult
  2. IP address exposure: Traditional X-Served-By headers often expose internal IPs, creating security risks
  3. Inconsistent identification: Random request IDs don't help identify servers across multiple requests
  4. Infrastructure leakage: Server hostnames and IPs can reveal infrastructure topology to attackers
  5. Log correlation: Matching application logs to specific servers without a stable identifier is challenging

Where to Use This Library

Design Goals

  1. Privacy-preserving: Uses UUID v5 hashing to hide actual server details
  2. Deterministic: Same server always produces the same UUID across restarts
  3. Standards-based: Uses RFC 4122 UUID v5 (SHA-1 namespace-based)
  4. Minimal overhead: UUID generation is computationally trivial
  5. Non-intrusive: Adds metadata header without modifying response content

Requirements

Installation

Install by adding the package as a Composer requirement:

Usage Examples

Basic Pipeline Registration (Mezzio)

Response Header Output

Inspecting with cURL

ConfigProvider Registration

The package includes a ConfigProvider for automatic factory registration:

UUID Generation

The UUID v5 is generated from a combination of server parameters:

Parameter Source Example
Server IP $_SERVER['SERVER_ADDR'] 192.168.1.100
Server Name $_SERVER['SERVER_NAME'] www.example.com
Combined Concatenated, lowercased 192.168.1.100www.example.com
UUID v5 SHA-1 hash with URL namespace 78ac0e14-0f2b-529e-81e2-a0f50f6029c5

Server Identification Table

Create a mapping table for your infrastructure:

Server IP Hostname UUID
web-01 10.0.1.10 app.example.com a1b2c3d4-...
web-02 10.0.1.11 app.example.com e5f6g7h8-...
web-03 10.0.1.12 app.example.com i9j0k1l2-...

This allows you to identify servers from response headers without exposing infrastructure details.


All versions of ctw-middleware-generatedby with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ctw/ctw-middleware Version ^5.0
psr/container Version ^1.0 || ^2.0
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0
ramsey/uuid Version ^4.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ctw/ctw-middleware-generatedby contains the following files

Loading the files please wait ...