{"id":19094972,"url":"https://github.com/phauthentic/correlation-id","last_synced_at":"2026-01-25T15:02:51.145Z","repository":{"id":36461442,"uuid":"225241282","full_name":"Phauthentic/correlation-id","owner":"Phauthentic","description":"Correlation ID and PSR7 middleware to inject it","archived":false,"fork":false,"pushed_at":"2024-03-27T23:52:26.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-30T00:23:28.323Z","etag":null,"topics":["correlation-id","enterprise-patterns","php7","psr7-middleware"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Phauthentic.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-01T22:36:18.000Z","updated_at":"2021-10-03T11:17:19.000Z","dependencies_parsed_at":"2024-03-27T22:26:49.480Z","dependency_job_id":"ae9dd65f-b947-4218-a3fc-3e6d7e9c5460","html_url":"https://github.com/Phauthentic/correlation-id","commit_stats":{"total_commits":13,"total_committers":3,"mean_commits":4.333333333333333,"dds":"0.23076923076923073","last_synced_commit":"0e43145d6b98ec6c30c25cc057ec2b3783123f89"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fcorrelation-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fcorrelation-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fcorrelation-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phauthentic%2Fcorrelation-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Phauthentic","download_url":"https://codeload.github.com/Phauthentic/correlation-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244159991,"owners_count":20408019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correlation-id","enterprise-patterns","php7","psr7-middleware"],"created_at":"2024-11-09T03:32:17.621Z","updated_at":"2026-01-25T15:02:50.247Z","avatar_url":"https://github.com/Phauthentic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Correlation ID\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/Phauthentic/correlation-id/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Phauthentic/correlation-id/)\n[![Code Quality](https://img.shields.io/scrutinizer/g/Phauthentic/correlation-id/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Phauthentic/correlation-id/)\n\nAn implementation of a Correlation ID and a framework agnostic PSR 15-HTTP middlware.\n\n\u003e A Correlation ID, also known as a Transit ID, is a unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain. The Correlation Pattern, which depends on the use of Correlation ID is a well documented Enterprise Integration Pattern.\n\n * [The value of a correlation ID](https://blog.rapid7.com/2016/12/23/the-value-of-correlation-ids/)\n * [Identity Correlation on Wikipedia](https://en.wikipedia.org/wiki/Identity_correlation)\n\n## Documentation\n\n### The Correlation ID Value Object\n\nThe correlation ID is a singleton class that will always return the same ID for the current life-cycle of the request.\n\nCalling `CorrelationID::toString()` will return a string and will return the same string for the whole live cycle of the application. You can compare a string to the Correlation ID by calling `CorrelationID::sameAs('your-string')`.\n\nBy default it uses its internal implementation to generate a UUID v4 as value of the Correlation ID. If you are using [ramsey/uuid](https://github.com/ramsey/uuid), it will use it automatically.\n\n### PSR 15 HTTP Middleware\n\nThe middleware will automatically put the correlation ID into your request object as attribute and header value. By default both use the `CorrelationID` name.\n\n```php\n$middleware = new CorrelationIDMiddleware(\n    CorrelationID::toString()\n);\n```\n\n### Response\n\nSince there is no standard for where this needs to be done, just add the correlation ID to your response where it suits your architecture or framework the best.\n\n```php\n$response-\u003ewithHeader('CorrelationID', CorrelationId::toString());\n```\n\nFor Symfony there is a [bundle](https://github.com/Phauthentic/correlation-id-symfony-bundle) available that will automatically make the Correlation ID available in the request and response object.\n\n## Copyright \u0026 License\n\nLicensed under the [MIT license](LICENSE.txt).\n\nCopyright (c) [Phauthentic](https://github.com/Phauthentic) / Florian Krämer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphauthentic%2Fcorrelation-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphauthentic%2Fcorrelation-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphauthentic%2Fcorrelation-id/lists"}