mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
feat: create user scim v2 endpoint (#9132)
# Which Problems Are Solved - Adds infrastructure code (basic implementation, error handling, middlewares, ...) to implement the SCIM v2 interface - Adds support for the user create SCIM v2 endpoint # How the Problems Are Solved - Adds support for the user create SCIM v2 endpoint under `POST /scim/v2/{orgID}/Users` # Additional Context Part of #8140
This commit is contained in:
26
internal/api/http/middleware/handler.go
Normal file
26
internal/api/http/middleware/handler.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package middleware
|
||||
|
||||
import "net/http"
|
||||
|
||||
// HandlerFuncWithError is a http handler func which can return an error
|
||||
// the error should then get handled later on in the pipeline by an error handler
|
||||
// the error handler can be dependent on the interface standard (e.g. SCIM, Problem Details, ...)
|
||||
type HandlerFuncWithError = func(w http.ResponseWriter, r *http.Request) error
|
||||
|
||||
// MiddlewareWithErrorFunc is a http middleware which can return an error
|
||||
// the error should then get handled later on in the pipeline by an error handler
|
||||
// the error handler can be dependent on the interface standard (e.g. SCIM, Problem Details, ...)
|
||||
type MiddlewareWithErrorFunc = func(HandlerFuncWithError) HandlerFuncWithError
|
||||
|
||||
// ErrorHandlerFunc handles errors and returns a regular http handler
|
||||
type ErrorHandlerFunc = func(HandlerFuncWithError) http.Handler
|
||||
|
||||
func ChainedWithErrorHandler(errorHandler ErrorHandlerFunc, middlewares ...MiddlewareWithErrorFunc) func(HandlerFuncWithError) http.Handler {
|
||||
return func(next HandlerFuncWithError) http.Handler {
|
||||
for i := len(middlewares) - 1; i >= 0; i-- {
|
||||
next = middlewares[i](next)
|
||||
}
|
||||
|
||||
return errorHandler(next)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user