mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-11 17:03:40 +00:00
e621224ab2
# 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
29 lines
673 B
Go
29 lines
673 B
Go
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)
|
|
}
|