forked from baron/baron-sso
feat(user): support fixed UUID registration and enhance bulk import results
- Added support for fixed UUIDs during bulk registration (Search-first + ExternalID mapping) - Implemented idempotency and visibility restoration for soft-deleted users - Enhanced bulk upload UI to show 'New/Updated/Unchanged' status and modified fields - Added logic to reclaim identifiers (login_id) from colliding records - Added frontend E2E and backend unit tests for UUID integrity and conflict handling - Fixed i18n, formatting, and mock tests to satisfy code-check - Applied 'go fix' for 'omitzero' tags and general Go standards
This commit is contained in:
@@ -104,11 +104,11 @@ func SanitizeClientLogMessage(message string) string {
|
||||
return sanitized
|
||||
}
|
||||
|
||||
func SanitizeClientLogData(data map[string]interface{}) map[string]interface{} {
|
||||
func SanitizeClientLogData(data map[string]any) map[string]any {
|
||||
if len(data) == 0 {
|
||||
return data
|
||||
}
|
||||
out := make(map[string]interface{}, len(data))
|
||||
out := make(map[string]any, len(data))
|
||||
for k, v := range data {
|
||||
if isSensitiveClientLogKey(k) {
|
||||
out[k] = "*****"
|
||||
@@ -119,12 +119,12 @@ func SanitizeClientLogData(data map[string]interface{}) map[string]interface{} {
|
||||
return out
|
||||
}
|
||||
|
||||
func sanitizeClientLogValue(v interface{}) interface{} {
|
||||
func sanitizeClientLogValue(v any) any {
|
||||
switch val := v.(type) {
|
||||
case map[string]interface{}:
|
||||
case map[string]any:
|
||||
return SanitizeClientLogData(val)
|
||||
case []interface{}:
|
||||
next := make([]interface{}, len(val))
|
||||
case []any:
|
||||
next := make([]any, len(val))
|
||||
for i := range val {
|
||||
next[i] = sanitizeClientLogValue(val[i])
|
||||
}
|
||||
|
||||
@@ -57,15 +57,15 @@ func TestShouldFilterNoisyClientInfo(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSanitizeClientLogData(t *testing.T) {
|
||||
input := map[string]interface{}{
|
||||
input := map[string]any{
|
||||
"token": "raw-token",
|
||||
"safe": "ok",
|
||||
"nested": map[string]interface{}{
|
||||
"nested": map[string]any{
|
||||
"new_password": "secret-1",
|
||||
"path": "/ko/profile",
|
||||
},
|
||||
"arr": []interface{}{
|
||||
map[string]interface{}{"authorization": "Bearer abc"},
|
||||
"arr": []any{
|
||||
map[string]any{"authorization": "Bearer abc"},
|
||||
"token=abc123",
|
||||
},
|
||||
}
|
||||
@@ -75,12 +75,12 @@ func TestSanitizeClientLogData(t *testing.T) {
|
||||
assert.Equal(t, "*****", result["token"])
|
||||
assert.Equal(t, "ok", result["safe"])
|
||||
|
||||
nested := result["nested"].(map[string]interface{})
|
||||
nested := result["nested"].(map[string]any)
|
||||
assert.Equal(t, "*****", nested["new_password"])
|
||||
assert.Equal(t, "/ko/profile", nested["path"])
|
||||
|
||||
arr := result["arr"].([]interface{})
|
||||
first := arr[0].(map[string]interface{})
|
||||
arr := result["arr"].([]any)
|
||||
first := arr[0].(map[string]any)
|
||||
assert.Equal(t, "*****", first["authorization"])
|
||||
assert.Equal(t, "token=*****", arr[1])
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ func TestResolveBackendLogLevel_DefaultsByAppEnv(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user