mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04: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:
28
internal/api/scim/schemas/string.go
Normal file
28
internal/api/scim/schemas/string.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package schemas
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// WriteOnlyString a write only string is not serializable to json.
|
||||
// in the SCIM RFC it has a mutability of writeOnly.
|
||||
// This increases security to really ensure this is never sent to a client.
|
||||
type WriteOnlyString string
|
||||
|
||||
func NewWriteOnlyString(s string) *WriteOnlyString {
|
||||
wos := WriteOnlyString(s)
|
||||
return &wos
|
||||
}
|
||||
|
||||
func (s *WriteOnlyString) MarshalJSON() ([]byte, error) {
|
||||
return []byte("null"), nil
|
||||
}
|
||||
|
||||
func (s *WriteOnlyString) UnmarshalJSON(bytes []byte) error {
|
||||
var str string
|
||||
err := json.Unmarshal(bytes, &str)
|
||||
*s = WriteOnlyString(str)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *WriteOnlyString) String() string {
|
||||
return string(*s)
|
||||
}
|
Reference in New Issue
Block a user