https://github.com/redhatinsights/platform-go-middlewares
A collection of various middleware impls that we can share
https://github.com/redhatinsights/platform-go-middlewares
hacktoberfest
Last synced: about 2 months ago
JSON representation
A collection of various middleware impls that we can share
- Host: GitHub
- URL: https://github.com/redhatinsights/platform-go-middlewares
- Owner: RedHatInsights
- License: mit
- Created: 2019-05-14T20:28:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-08-26T11:53:03.000Z (4 months ago)
- Last Synced: 2025-08-26T15:21:13.075Z (4 months ago)
- Topics: hacktoberfest
- Language: Go
- Homepage:
- Size: 112 KB
- Stars: 3
- Watchers: 8
- Forks: 22
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ConsoleDot Platform Common Middleware
Common Go code for the `console.redhat.com` open-source platform.
### Documentation
[](https://pkg.go.dev/github.com/redhatinsights/platform-go-middlewares)
### Stable version: v2
Usage:
go get github.com/redhatinsights/platform-go-middlewares/v2
Branch name: **master**
### Deprecated version: v1
Usage:
go get github.com/redhatinsights/platform-go-middlewares
The version is frozen now and we only accept security or high-important bugfixes.
Branch name: **v1**
### Major changes (upgrading)
#### v2
* Minimum Go version is 1.20
* Updated of all dependencies to the latest version.
* Updated of unit test version matrix to the last three major Go versions.
* Added new root field `Entitlements` and associated type.
* Deprecated `Get` and `With` functions, use `GetIdentity` and `WithIdentity`.
* Introduced `GetRawIdentity` and `WithRawIdentity` for optional raw identity.
* Deprecated `GetIdentityHeader`, replaced with `GetRawIdentity`. Before calling this function, `WithRawIdentity` must be set.
* `Key` type is no longer exported, use appropriate functions.
* Separated parsing and validation into two exported functions.
* The `EnforceIdentity` function is deprecated. Use the new middleware function `EnforceIdentityWithLogger` with custom logging interface.
* Separated CloudWatch batch-writing client from the logrus hook data structure.
This allows other logging frameworks to use the BatchWriter client, and logrus
clients can use both the BatchWriter and the Hook.