@@ -46,7 +46,7 @@ type (
|
||||
OrganizationName string `db:"organization_name"`
|
||||
UserName *string `db:"user_name"`
|
||||
ExternalID *string `db:"external_id"`
|
||||
NickName *string `db:"nick_name"`
|
||||
Nickname *string `db:"nickname"`
|
||||
Locale *string `db:"locale"`
|
||||
Timezone *string `db:"timezone"`
|
||||
ProfileUrl *string `db:"profile_url"`
|
||||
@@ -128,7 +128,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -205,7 +205,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -285,7 +285,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -358,7 +358,7 @@ WITH profiles AS (
|
||||
p.contract_end_date,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -401,7 +401,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
user_name,
|
||||
external_id,
|
||||
nick_name,
|
||||
nickname,
|
||||
locale,
|
||||
timezone,
|
||||
profile_url,
|
||||
@@ -471,7 +471,7 @@ WITH profiles AS (
|
||||
p.contract_end_date,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -513,7 +513,7 @@ SELECT
|
||||
o.name AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -582,7 +582,7 @@ WITH profiles AS (
|
||||
mp.contract_end_date,
|
||||
mp.user_name,
|
||||
mp.external_id,
|
||||
mp.nick_name,
|
||||
mp.nickname,
|
||||
mp.locale,
|
||||
mp.timezone,
|
||||
mp.profile_url,
|
||||
@@ -628,7 +628,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -726,7 +726,7 @@ WITH profiles AS (
|
||||
mp.contract_end_date,
|
||||
mp.user_name,
|
||||
mp.external_id,
|
||||
mp.nick_name,
|
||||
mp.nickname,
|
||||
mp.locale,
|
||||
mp.timezone,
|
||||
mp.profile_url,
|
||||
@@ -772,7 +772,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -871,7 +871,7 @@ WITH attendees AS (
|
||||
p.contract_end_date,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -916,7 +916,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
user_name,
|
||||
external_id,
|
||||
nick_name,
|
||||
nickname,
|
||||
locale,
|
||||
timezone,
|
||||
profile_url,
|
||||
@@ -996,7 +996,7 @@ SELECT
|
||||
'' AS organization_name,
|
||||
p.user_name,
|
||||
p.external_id,
|
||||
p.nick_name,
|
||||
p.nickname,
|
||||
p.locale,
|
||||
p.timezone,
|
||||
p.profile_url,
|
||||
@@ -1168,7 +1168,7 @@ INSERT INTO
|
||||
contract_end_date,
|
||||
user_name,
|
||||
external_id,
|
||||
nick_name,
|
||||
nickname,
|
||||
locale,
|
||||
timezone,
|
||||
profile_url,
|
||||
@@ -1203,7 +1203,7 @@ VALUES (
|
||||
@contract_end_date,
|
||||
@user_name,
|
||||
@external_id,
|
||||
@nick_name,
|
||||
@nickname,
|
||||
@locale,
|
||||
@timezone,
|
||||
@profile_url,
|
||||
@@ -1240,7 +1240,7 @@ VALUES (
|
||||
"contract_end_date": p.ContractEndDate,
|
||||
"user_name": p.UserName,
|
||||
"external_id": p.ExternalID,
|
||||
"nick_name": p.NickName,
|
||||
"nickname": p.Nickname,
|
||||
"locale": p.Locale,
|
||||
"timezone": p.Timezone,
|
||||
"profile_url": p.ProfileUrl,
|
||||
@@ -1293,7 +1293,7 @@ SET
|
||||
contract_end_date = @contract_end_date,
|
||||
user_name = @user_name,
|
||||
external_id = @external_id,
|
||||
nick_name = @nick_name,
|
||||
nickname = @nickname,
|
||||
locale = @locale,
|
||||
timezone = @timezone,
|
||||
profile_url = @profile_url,
|
||||
@@ -1330,7 +1330,7 @@ WHERE
|
||||
"contract_end_date": p.ContractEndDate,
|
||||
"user_name": p.UserName,
|
||||
"external_id": p.ExternalID,
|
||||
"nick_name": p.NickName,
|
||||
"nickname": p.Nickname,
|
||||
"locale": p.Locale,
|
||||
"timezone": p.Timezone,
|
||||
"profile_url": p.ProfileUrl,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
ALTER TABLE iam_membership_profiles
|
||||
ALTER COLUMN kind TYPE TEXT USING kind::TEXT,
|
||||
ADD COLUMN nick_name TEXT,
|
||||
ADD COLUMN nickname TEXT,
|
||||
ADD COLUMN locale TEXT,
|
||||
ADD COLUMN timezone TEXT,
|
||||
ADD COLUMN profile_url TEXT;
|
||||
|
||||
@@ -203,7 +203,7 @@ func (s *Service) CreateUser(
|
||||
Position: &attrs.Title,
|
||||
UserName: &attrs.UserName,
|
||||
ExternalID: externalIdPtr,
|
||||
NickName: ref.RefOrNil(attrs.NickName),
|
||||
Nickname: ref.RefOrNil(attrs.Nickname),
|
||||
Locale: ref.RefOrNil(attrs.Locale),
|
||||
Timezone: ref.RefOrNil(attrs.Timezone),
|
||||
ProfileUrl: ref.RefOrNil(attrs.ProfileUrl),
|
||||
@@ -250,7 +250,7 @@ func (s *Service) CreateUser(
|
||||
profile.Position = &attrs.Title
|
||||
profile.UserName = &attrs.UserName
|
||||
profile.ExternalID = externalIdPtr
|
||||
profile.NickName = ref.RefOrNil(attrs.NickName)
|
||||
profile.Nickname = ref.RefOrNil(attrs.Nickname)
|
||||
profile.Locale = ref.RefOrNil(attrs.Locale)
|
||||
profile.Timezone = ref.RefOrNil(attrs.Timezone)
|
||||
profile.ProfileUrl = ref.RefOrNil(attrs.ProfileUrl)
|
||||
@@ -532,11 +532,11 @@ func (s *Service) updateUser(
|
||||
profile.UpdatedAt = now
|
||||
}
|
||||
|
||||
if attrs.NickName != nil {
|
||||
if *attrs.NickName == "" {
|
||||
profile.NickName = nil
|
||||
if attrs.Nickname != nil {
|
||||
if *attrs.Nickname == "" {
|
||||
profile.Nickname = nil
|
||||
} else {
|
||||
profile.NickName = attrs.NickName
|
||||
profile.Nickname = attrs.Nickname
|
||||
}
|
||||
profile.UpdatedAt = now
|
||||
}
|
||||
@@ -874,7 +874,7 @@ type scimUserAttributes struct {
|
||||
Title string
|
||||
ExternalID string
|
||||
UserType string
|
||||
NickName string
|
||||
Nickname string
|
||||
Locale string
|
||||
Timezone string
|
||||
ProfileUrl string
|
||||
@@ -953,7 +953,7 @@ func ParseUserFromAttributes(attributes scim.ResourceAttributes) scimUserAttribu
|
||||
|
||||
attrs.Title, _ = attributes["title"].(string)
|
||||
attrs.UserType, _ = attributes["userType"].(string)
|
||||
attrs.NickName, _ = attributes["nickName"].(string)
|
||||
attrs.Nickname, _ = attributes["nickName"].(string)
|
||||
attrs.Locale, _ = attributes["locale"].(string)
|
||||
attrs.Timezone, _ = attributes["timezone"].(string)
|
||||
attrs.ProfileUrl, _ = attributes["profileUrl"].(string)
|
||||
@@ -980,7 +980,7 @@ type scimReplaceAttributes struct {
|
||||
UserName *string
|
||||
ExternalID *string
|
||||
UserType *string
|
||||
NickName *string
|
||||
Nickname *string
|
||||
Locale *string
|
||||
Timezone *string
|
||||
ProfileUrl *string
|
||||
@@ -1049,7 +1049,7 @@ func ParseUserFromReplaceAttributes(attributes scim.ResourceAttributes) scimRepl
|
||||
attrs.UserType = &ut
|
||||
}
|
||||
if nn, ok := attributes["nickName"].(string); ok {
|
||||
attrs.NickName = &nn
|
||||
attrs.Nickname = &nn
|
||||
}
|
||||
if l, ok := attributes["locale"].(string); ok {
|
||||
attrs.Locale = &l
|
||||
@@ -1108,7 +1108,7 @@ func ParseUserFromPatchOperations(operations []scim.PatchOperation) scimReplaceA
|
||||
case "usertype":
|
||||
attrs.UserType = &empty
|
||||
case "nickname":
|
||||
attrs.NickName = &empty
|
||||
attrs.Nickname = &empty
|
||||
case "locale":
|
||||
attrs.Locale = &empty
|
||||
case "timezone":
|
||||
@@ -1209,7 +1209,7 @@ func ParseUserFromPatchOperations(operations []scim.PatchOperation) scimReplaceA
|
||||
attrs.UserType = &ut
|
||||
}
|
||||
if nn, ok := valueMap["nickName"].(string); ok {
|
||||
attrs.NickName = &nn
|
||||
attrs.Nickname = &nn
|
||||
}
|
||||
if l, ok := valueMap["locale"].(string); ok {
|
||||
attrs.Locale = &l
|
||||
@@ -1380,7 +1380,7 @@ func ParseUserFromPatchOperations(operations []scim.PatchOperation) scimReplaceA
|
||||
}
|
||||
case "nickname":
|
||||
if nn, ok := op.Value.(string); ok {
|
||||
attrs.NickName = &nn
|
||||
attrs.Nickname = &nn
|
||||
}
|
||||
case "locale":
|
||||
if l, ok := op.Value.(string); ok {
|
||||
@@ -1519,7 +1519,7 @@ func userToResource(p *coredata.MembershipProfile) scim.Resource {
|
||||
},
|
||||
"title": p.Position,
|
||||
"userType": string(ref.UnrefOrZero(p.Kind)),
|
||||
"nickName": ref.UnrefOrZero(p.NickName),
|
||||
"nickName": ref.UnrefOrZero(p.Nickname),
|
||||
"locale": ref.UnrefOrZero(p.Locale),
|
||||
"timezone": ref.UnrefOrZero(p.Timezone),
|
||||
"profileUrl": ref.UnrefOrZero(p.ProfileUrl),
|
||||
|
||||
Reference in New Issue
Block a user