mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +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:
@@ -5,6 +5,8 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -14,6 +16,7 @@ const (
|
||||
CacheControl = "cache-control"
|
||||
ContentType = "content-type"
|
||||
ContentLength = "content-length"
|
||||
ContentLocation = "content-location"
|
||||
Expires = "expires"
|
||||
Location = "location"
|
||||
Origin = "origin"
|
||||
@@ -42,6 +45,9 @@ const (
|
||||
PermissionsPolicy = "permissions-policy"
|
||||
|
||||
ZitadelOrgID = "x-zitadel-orgid"
|
||||
|
||||
OrgIdInPathVariableName = "orgId"
|
||||
OrgIdInPathVariable = "{" + OrgIdInPathVariableName + "}"
|
||||
)
|
||||
|
||||
type key int
|
||||
@@ -104,6 +110,12 @@ func GetAuthorization(r *http.Request) string {
|
||||
}
|
||||
|
||||
func GetOrgID(r *http.Request) string {
|
||||
// path variable takes precedence over header
|
||||
orgID, ok := mux.Vars(r)[OrgIdInPathVariableName]
|
||||
if ok {
|
||||
return orgID
|
||||
}
|
||||
|
||||
return r.Header.Get(ZitadelOrgID)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user