feat(robust): shared avatar emails and safe delete user console command (#266)
* feat(portal): allow multiple avatar registrations with the same contact email * feat(email): sign offline IM reply with explicit avatar identity for shared email addresses * feat(email): identify intended avatar in offline IM signed reply token * fix(email): resolve offline IM reply avatar from signed UUID, never ambiguous email * test/docs(email): verify reusable contact addresses and avatar-bound offline IM replies * test/docs(email): verify reusable contact addresses and avatar-bound offline IM replies * test/docs(email): verify reusable contact addresses and avatar-bound offline IM replies * test/docs(email): verify reusable contact addresses and avatar-bound offline IM replies * feat(robust): add fail-closed delete user dry-run and confirmed core avatar purge * fix(delete): use actual PostgreSQL migration identifier casing for account purge SQL * fix(mail): accept only identity-bound r2 relay addresses for multi-avatar email replies * docs(robust): operator-safe delete user workflow with explicit scope and safeguards * fix(delete): revalidate avatar before transactional purge; don't hold locks while confirming * test(robust): verify explicit confirmation and transaction contract for delete user
This commit is contained in:
1 parent
192b40b0c2
commit
0d99e9308a
10 files changed
+431
-32
No files matched your search
@@ -188,37 +188,38 @@ namespace NexVerse.Server.Api
|
||||
}
|
||||
|
||||
string senderEmail = OfflineImMailRelayToken.NormalizeEmail(sender.Address);
|
||||
UserAccount replyingAccount = m_UserAccounts.GetUserAccount(UUID.Zero, senderEmail);
|
||||
|
||||
if (replyingAccount == null ||
|
||||
!replyingAccount.LocalToGrid ||
|
||||
!replyingAccount.Active ||
|
||||
replyingAccount.PrincipalID.IsZero())
|
||||
{
|
||||
m_Log.InfoFormat(
|
||||
"[NEX-IM-MAIL-RELAY]: Ignored catch-all mail from non-NexVerse sender: {0}.",
|
||||
senderEmail);
|
||||
return RelayDisposition.Consumed;
|
||||
}
|
||||
|
||||
if (!TryFindReplyLocalPart(message, out string replyLocalPart))
|
||||
{
|
||||
m_Log.Warn("[NEX-IM-MAIL-RELAY]: Rejected catch-all mail without a NexVerse reply token.");
|
||||
return RelayDisposition.Consumed;
|
||||
}
|
||||
|
||||
if (!OfflineImMailRelayToken.TryValidate(
|
||||
// A mailbox can belong to several avatars. The signed token must
|
||||
// name the avatar that received this particular offline message.
|
||||
// Never choose the first user account matching the From address.
|
||||
if (!OfflineImMailRelayToken.TryValidateReply(
|
||||
replyLocalPart,
|
||||
senderEmail,
|
||||
m_SigningKey,
|
||||
DateTimeOffset.UtcNow,
|
||||
m_MaximumTokenLifetime,
|
||||
out UUID targetAgentId,
|
||||
out _))
|
||||
out UUID replyingAgentId))
|
||||
{
|
||||
m_Log.WarnFormat(
|
||||
"[NEX-IM-MAIL-RELAY]: Rejected invalid or expired reply token from account {0}.",
|
||||
replyingAccount.PrincipalID);
|
||||
m_Log.Warn("[NEX-IM-MAIL-RELAY]: Rejected invalid, legacy or expired identity-bound reply token.");
|
||||
return RelayDisposition.Consumed;
|
||||
}
|
||||
|
||||
UserAccount replyingAccount = m_UserAccounts.GetUserAccount(UUID.Zero, replyingAgentId);
|
||||
if (replyingAccount == null ||
|
||||
!replyingAccount.LocalToGrid ||
|
||||
!replyingAccount.Active ||
|
||||
replyingAccount.PrincipalID.IsZero() ||
|
||||
!string.Equals(
|
||||
OfflineImMailRelayToken.NormalizeEmail(replyingAccount.Email),
|
||||
senderEmail, StringComparison.Ordinal))
|
||||
{
|
||||
m_Log.Info("[NEX-IM-MAIL-RELAY]: Rejected reply with absent, inactive or mismatched avatar identity.");
|
||||
return RelayDisposition.Consumed;
|
||||
}
|
||||
|
||||
@@ -333,7 +334,7 @@ namespace NexVerse.Server.Api
|
||||
return false;
|
||||
|
||||
string candidate = address.Substring(0, at);
|
||||
if (!candidate.StartsWith("r-", StringComparison.Ordinal))
|
||||
if (!candidate.StartsWith("r2-", StringComparison.Ordinal))
|
||||
return false;
|
||||
|
||||
localPart = candidate;
|
||||
|
||||
@@ -319,12 +319,9 @@ namespace NexVerse.Server.Api
|
||||
"Dieser Avatarname ist bereits vergeben.");
|
||||
return;
|
||||
}
|
||||
if (m_Accounts.GetUserAccount(UUID.Zero, email) != null)
|
||||
{
|
||||
Reply(response, HttpStatusCode.Conflict, "email_registered",
|
||||
"Die E-Mail-Adresse ist bereits registriert.");
|
||||
return;
|
||||
}
|
||||
// Email is a contact method, not a unique avatar identity.
|
||||
// Multiple avatars may share it, but avatar names must remain unique.
|
||||
// Keep validation and machine-key authorization unchanged.
|
||||
|
||||
if (!TryReadHomeRegion(root, out string homeRegionId,
|
||||
out string homeRegionName, out Vector3 homePosition))
|
||||
|
||||
@@ -473,6 +473,7 @@ namespace OpenSim.OfflineIM
|
||||
{
|
||||
string replyLocalPart = OfflineImMailRelayToken.Create(
|
||||
senderID,
|
||||
recipientID,
|
||||
recipientAddress.Address,
|
||||
DateTimeOffset.UtcNow.AddDays(m_EmailReplyLifetimeDays),
|
||||
m_EmailRelaySigningKey);
|
||||
|
||||
@@ -30,6 +30,80 @@ namespace OpenSim.Framework
|
||||
return string.Join("-", Prefix, target, expiry, nonce, signature);
|
||||
}
|
||||
|
||||
// Identity-bound reply tokens: a shared contact mailbox must not
|
||||
// cause a reply to be attributed to an arbitrary first account.
|
||||
public static string Create(
|
||||
UUID targetAgentId,
|
||||
UUID replyingAgentId,
|
||||
string authorizedEmail,
|
||||
DateTimeOffset expiresAt,
|
||||
string signingKey)
|
||||
{
|
||||
ValidateSigningKey(signingKey);
|
||||
if (targetAgentId.IsZero() || replyingAgentId.IsZero())
|
||||
throw new ArgumentException("Reply token identities must not be zero.");
|
||||
|
||||
string target = Base64Url(targetAgentId.Guid.ToByteArray());
|
||||
string replying = Base64Url(replyingAgentId.Guid.ToByteArray());
|
||||
string expiry = ToBase36(expiresAt.ToUnixTimeSeconds());
|
||||
string nonce = Base64Url(RandomNumberGenerator.GetBytes(NonceBytes));
|
||||
string signature = Sign(
|
||||
"r2|" + target + "|" + replying, expiry, nonce,
|
||||
NormalizeEmail(authorizedEmail), signingKey);
|
||||
return string.Join("-", "r2", target, replying, expiry, nonce, signature);
|
||||
}
|
||||
|
||||
// Deliberately refuses legacy unbound r1 tokens. Their sender identity
|
||||
// cannot be uniquely determined once more than one avatar uses an email.
|
||||
public static bool TryValidateReply(
|
||||
string localPart,
|
||||
string authorizedEmail,
|
||||
string signingKey,
|
||||
DateTimeOffset now,
|
||||
TimeSpan maximumFutureLifetime,
|
||||
out UUID targetAgentId,
|
||||
out UUID replyingAgentId)
|
||||
{
|
||||
targetAgentId = UUID.Zero;
|
||||
replyingAgentId = UUID.Zero;
|
||||
if (string.IsNullOrWhiteSpace(localPart) ||
|
||||
string.IsNullOrWhiteSpace(authorizedEmail) ||
|
||||
string.IsNullOrWhiteSpace(signingKey))
|
||||
return false;
|
||||
|
||||
string[] parts = localPart.Split('-');
|
||||
if (parts.Length != 6 || parts[0] != "r2" ||
|
||||
!TryBase64UrlDecode(parts[1], out byte[] targetBytes) ||
|
||||
!TryBase64UrlDecode(parts[2], out byte[] replyingBytes) ||
|
||||
targetBytes.Length != 16 || replyingBytes.Length != 16 ||
|
||||
!TryFromBase36(parts[3], out long expiryUnix))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
DateTimeOffset expiry = DateTimeOffset.FromUnixTimeSeconds(expiryUnix);
|
||||
if (expiry <= now || expiry > now.Add(maximumFutureLifetime))
|
||||
return false;
|
||||
string expected = Sign(
|
||||
"r2|" + parts[1] + "|" + parts[2], parts[3], parts[4],
|
||||
NormalizeEmail(authorizedEmail), signingKey);
|
||||
if (!FixedTimeEquals(parts[5], expected))
|
||||
return false;
|
||||
|
||||
targetAgentId = new UUID(new Guid(targetBytes));
|
||||
replyingAgentId = new UUID(new Guid(replyingBytes));
|
||||
return !targetAgentId.IsZero() && !replyingAgentId.IsZero();
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool TryValidate(
|
||||
string localPart,
|
||||
string authorizedEmail,
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Data.Common;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -45,6 +46,7 @@ namespace OpenSim.Services.UserAccountService
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static UserAccountService m_RootInstance;
|
||||
private readonly IConfigSource m_DeletionConfig;
|
||||
|
||||
/// <summary>
|
||||
/// Should we create default entries (minimum body parts/clothing, avatar wearable entries) for a new avatar?
|
||||
@@ -66,6 +68,7 @@ namespace OpenSim.Services.UserAccountService
|
||||
public UserAccountService(IConfigSource config)
|
||||
: base(config)
|
||||
{
|
||||
m_DeletionConfig = config;
|
||||
IConfig userConfig = config.Configs["UserAccountService"];
|
||||
if (userConfig == null)
|
||||
throw new Exception("No UserAccountService configuration");
|
||||
@@ -135,6 +138,12 @@ namespace OpenSim.Services.UserAccountService
|
||||
"create user [<first> [<last> [<pass> [<email> [<user id> [<model>]]]]]]",
|
||||
"Create a new user", HandleCreateUser);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("Users", false,
|
||||
"delete user",
|
||||
"delete user <first> <last> <avatar-uuid> [--confirm]",
|
||||
"Preview deletion of an offline avatar or irreversibly purge core local account data with --confirm",
|
||||
HandleDeleteUser);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("Users", false,
|
||||
"reset user password",
|
||||
"reset user password [<first> [<last> [<password>]]]",
|
||||
@@ -492,6 +501,228 @@ namespace OpenSim.Services.UserAccountService
|
||||
CreateUser(UUID.Zero, principalId, firstName, lastName, password, email, model);
|
||||
}
|
||||
|
||||
// Deletes the standard OpenSim local avatar identity from a single
|
||||
// authoritative DB, inside one transaction. Do not claim that this
|
||||
// deletes third-party economy, groups, estates, inworld objects or
|
||||
// shared asset blobs: operators must audit those integrations first.
|
||||
// If any required store is on another database, refuse the action.
|
||||
protected void HandleDeleteUser(string module, string[] cmdparams)
|
||||
{
|
||||
if (cmdparams.Length != 5 && cmdparams.Length != 6)
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: delete user <first> <last> <avatar-uuid> [--confirm]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cmdparams.Length == 6 && cmdparams[5] != "--confirm")
|
||||
{
|
||||
MainConsole.Instance.Output("Only --confirm is supported for permanent deletion.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UUID.TryParse(cmdparams[4], out UUID userId) || userId.IsZero())
|
||||
{
|
||||
MainConsole.Instance.Output("Specify the exact non-zero avatar UUID from 'show account'.");
|
||||
return;
|
||||
}
|
||||
|
||||
UserAccount account = GetUserAccount(UUID.Zero, cmdparams[2], cmdparams[3]);
|
||||
if (account == null || account.PrincipalID != userId || !account.LocalToGrid)
|
||||
{
|
||||
MainConsole.Instance.Output("Deletion refused: avatar name/UUID mismatch or non-local account.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (userId == Constants.servicesGodAgentID || account.UserLevel >= 200)
|
||||
{
|
||||
MainConsole.Instance.Output("Deletion refused: protected grid service or administrator account.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_GridUserService == null)
|
||||
{
|
||||
MainConsole.Instance.Output("Deletion refused: authoritative GridUserService unavailable.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
GridUserInfo loginState = m_GridUserService.GetGridUserInfo(userId.ToString());
|
||||
if (loginState != null && loginState.Online)
|
||||
{
|
||||
MainConsole.Instance.Output("Deletion refused: avatar is currently online. Log out and retry.");
|
||||
return;
|
||||
}
|
||||
|
||||
string provider = DeletionStorageSetting("UserAccountService", "StorageProvider");
|
||||
string connectionString = DeletionStorageSetting("UserAccountService", "ConnectionString");
|
||||
if (string.IsNullOrWhiteSpace(provider) || string.IsNullOrWhiteSpace(connectionString))
|
||||
throw new InvalidOperationException("No authoritative UserAccountService database configured.");
|
||||
|
||||
foreach (string service in new[] {
|
||||
"AuthenticationService", "GridUserService", "InventoryService",
|
||||
"AvatarService", "PresenceService", "FriendsService" })
|
||||
{
|
||||
if (!string.Equals(provider, DeletionStorageSetting(service, "StorageProvider"),
|
||||
StringComparison.OrdinalIgnoreCase) ||
|
||||
!string.Equals(connectionString, DeletionStorageSetting(service, "ConnectionString"),
|
||||
StringComparison.Ordinal))
|
||||
throw new InvalidOperationException(service + " uses a different data store. Cross-database purge is unsafe.");
|
||||
}
|
||||
|
||||
// Only well-known migration realms are supported. No table or
|
||||
// column names are ever supplied by a console argument.
|
||||
foreach (string[] realm in new[] {
|
||||
new[] { "UserAccountService", "UserAccounts" },
|
||||
new[] { "AuthenticationService", "auth" },
|
||||
new[] { "GridUserService", "GridUser" },
|
||||
new[] { "AvatarService", "Avatars" },
|
||||
new[] { "FriendsService", "Friends" },
|
||||
new[] { "PresenceService", "Presence" } })
|
||||
{
|
||||
IConfig section = m_DeletionConfig.Configs[realm[0]];
|
||||
string configuredRealm = section?.GetString("Realm", string.Empty);
|
||||
if (!string.IsNullOrWhiteSpace(configuredRealm) &&
|
||||
!string.Equals(configuredRealm, realm[1], StringComparison.Ordinal))
|
||||
throw new InvalidOperationException("Custom realm for " + realm[0] + " requires manual deletion audit.");
|
||||
}
|
||||
|
||||
bool postgres = provider.IndexOf("PGSQL", StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
string providerType = provider.IndexOf("MySQL", StringComparison.OrdinalIgnoreCase) >= 0
|
||||
? "MySql.Data.MySqlClient.MySqlConnection, MySql.Data"
|
||||
: postgres ? "Npgsql.NpgsqlConnection, Npgsql"
|
||||
: provider.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) >= 0
|
||||
? "Mono.Data.Sqlite.SqliteConnection, Mono.Data.Sqlite" : null;
|
||||
if (providerType == null)
|
||||
throw new InvalidOperationException("Unsupported database backend for console deletion: " + provider);
|
||||
|
||||
Type type = Type.GetType(providerType, throwOnError: false);
|
||||
if (type == null || !typeof(DbConnection).IsAssignableFrom(type))
|
||||
throw new InvalidOperationException("Database driver unavailable: " + providerType);
|
||||
|
||||
using DbConnection connection = (DbConnection)Activator.CreateInstance(type, connectionString);
|
||||
connection.Open();
|
||||
using DbTransaction transaction = connection.BeginTransaction();
|
||||
|
||||
// PostgreSQL uses UUID-typed columns for these four records;
|
||||
// MySQL and SQLite store GUIDs as text.
|
||||
string[][] rows = new string[][] {
|
||||
new[] { "tokens", "UUID", "uuid" },
|
||||
new[] { "auth", "UUID", "uuid" },
|
||||
new[] { "inventoryitems", "avatarID", "text" },
|
||||
new[] { "inventoryfolders", "agentID", "text" },
|
||||
new[] { "Avatars", "PrincipalID", "uuid" },
|
||||
new[] { "GridUser", "UserID", "text" },
|
||||
new[] { "Presence", "UserID", "text" },
|
||||
new[] { "Friends", "PrincipalID", "text" },
|
||||
new[] { "UserAccounts", "PrincipalID", "uuid" }
|
||||
};
|
||||
string quote = postgres || provider.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) >= 0 ? "\"" : "`";
|
||||
string Quote(string name) => quote + name + quote;
|
||||
// PostgreSQL migration table identifiers are unquoted (folded
|
||||
// to lowercase). Column names are generally case-preserving,
|
||||
// except auth/tokens where uuid is an unquoted column.
|
||||
string TableName(string name) => postgres ? name : Quote(name);
|
||||
string ColumnName(string table, string column) =>
|
||||
postgres && (table == "auth" || table == "tokens") && column == "UUID"
|
||||
? "uuid" : Quote(column);
|
||||
|
||||
// Preflight all required tables before mutating anything.
|
||||
int[] counts = new int[rows.Length];
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
string[] row = rows[i];
|
||||
string sql = "SELECT COUNT(*) FROM " + TableName(row[0]) + " WHERE " + ColumnName(row[0], row[1]) + " = @userId";
|
||||
counts[i] = DeletionSql(connection, transaction, sql, userId, postgres && row[2] == "uuid", false);
|
||||
MainConsole.Instance.Output(" {0}: {1} rows", row[0], counts[i]);
|
||||
}
|
||||
|
||||
int reverseFriends = DeletionSql(connection, transaction,
|
||||
"SELECT COUNT(*) FROM " + TableName("Friends") + " WHERE " + ColumnName("Friends", "Friend") + " LIKE @userId",
|
||||
userId, false, false, true);
|
||||
MainConsole.Instance.Output(" Friends (reverse): {0} rows", reverseFriends);
|
||||
|
||||
if (counts[8] != 1 || counts[6] != 0)
|
||||
throw new InvalidOperationException("Account no longer unique or an active Presence session still exists. Nothing deleted.");
|
||||
|
||||
// Release read locks before prompting an administrator.
|
||||
transaction.Commit();
|
||||
|
||||
if (cmdparams.Length == 5)
|
||||
{
|
||||
MainConsole.Instance.Output("Dry run only. To purge core avatar records: delete user {0} {1} {2} --confirm",
|
||||
cmdparams[2], cmdparams[3], userId);
|
||||
MainConsole.Instance.Output("WARNING: Land, rezzed objects, groups, NV$ and external addon/portal data are NOT covered.");
|
||||
return;
|
||||
}
|
||||
|
||||
string phrase = "DELETE " + userId;
|
||||
string confirmation = MainConsole.Instance.Prompt("Enter exactly '" + phrase + "' to irreversibly purge core avatar records", "CANCEL");
|
||||
if (!string.Equals(confirmation, phrase, StringComparison.Ordinal))
|
||||
{
|
||||
MainConsole.Instance.Output("Deletion cancelled, no records changed.");
|
||||
return;
|
||||
}
|
||||
|
||||
using DbTransaction deletionTransaction = connection.BeginTransaction();
|
||||
if (DeletionSql(connection, deletionTransaction,
|
||||
"SELECT COUNT(*) FROM " + TableName("UserAccounts") + " WHERE " +
|
||||
ColumnName("UserAccounts", "PrincipalID") + " = @userId",
|
||||
userId, postgres, false) != 1 ||
|
||||
DeletionSql(connection, deletionTransaction,
|
||||
"SELECT COUNT(*) FROM " + TableName("Presence") + " WHERE " +
|
||||
ColumnName("Presence", "UserID") + " = @userId",
|
||||
userId, false, false) != 0)
|
||||
throw new InvalidOperationException("Account or login state changed during confirmation.");
|
||||
|
||||
GridUserInfo currentState = m_GridUserService.GetGridUserInfo(userId.ToString());
|
||||
if (currentState != null && currentState.Online)
|
||||
throw new InvalidOperationException("Avatar became online during confirmation.");
|
||||
|
||||
DeletionSql(connection, deletionTransaction,
|
||||
"DELETE FROM " + TableName("Friends") + " WHERE " + ColumnName("Friends", "Friend") + " LIKE @userId",
|
||||
userId, false, true, true);
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
string[] row = rows[i];
|
||||
DeletionSql(connection, deletionTransaction,
|
||||
"DELETE FROM " + TableName(row[0]) + " WHERE " + ColumnName(row[0], row[1]) + " = @userId",
|
||||
userId, postgres && row[2] == "uuid", true);
|
||||
}
|
||||
|
||||
deletionTransaction.Commit();
|
||||
m_log.WarnFormat("[USER ACCOUNT]: Administrative core avatar purge committed for {0} ({1})", account.Name, userId);
|
||||
MainConsole.Instance.Output("Core avatar identity permanently deleted: {0} ({1})", account.Name, userId);
|
||||
MainConsole.Instance.Output("External groups, parcels, rezzed objects, economy, profile and portal data need a separate audit.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.ErrorFormat("[USER ACCOUNT]: delete user failed for {0}: {1}", userId, ex.Message);
|
||||
MainConsole.Instance.Output("Deletion aborted / rolled back where supported: {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private string DeletionStorageSetting(string sectionName, string name)
|
||||
{
|
||||
string fallback = m_DeletionConfig.Configs["DatabaseService"]?.GetString(name, string.Empty) ?? string.Empty;
|
||||
string sectionValue = m_DeletionConfig.Configs[sectionName]?.GetString(name, string.Empty);
|
||||
return string.IsNullOrWhiteSpace(sectionValue) ? fallback : sectionValue;
|
||||
}
|
||||
|
||||
private static int DeletionSql(DbConnection connection, DbTransaction transaction,
|
||||
string sql, UUID userId, bool guidValue, bool mutate, bool prefix = false)
|
||||
{
|
||||
using DbCommand command = connection.CreateCommand();
|
||||
command.Transaction = transaction;
|
||||
command.CommandText = sql;
|
||||
DbParameter parameter = command.CreateParameter();
|
||||
parameter.ParameterName = "@userId";
|
||||
parameter.Value = prefix ? userId.ToString() + "%" :
|
||||
guidValue ? (object)userId.Guid : userId.ToString();
|
||||
command.Parameters.Add(parameter);
|
||||
return mutate ? command.ExecuteNonQuery() : Convert.ToInt32(command.ExecuteScalar());
|
||||
}
|
||||
|
||||
protected void HandleShowAccount(string module, string[] cmdparams)
|
||||
{
|
||||
if (cmdparams.Length != 4)
|
||||
|
||||
@@ -80,3 +80,17 @@ Change `IMAPHost` if the KeyHelp server uses another mail hostname.
|
||||
5. Robust polls `relay@im.stadt-nexverse.de`.
|
||||
6. If A is online, A receives the response immediately as an Inworld-IM.
|
||||
7. If A is offline, the Gatekeeper stores the reply as an offline IM for the next login.
|
||||
|
||||
|
||||
## Gemeinsame E-Mail-Adressen mehrerer Avatare
|
||||
|
||||
Seit dem Mehrfachavatar-Registrierungsupdate darf dieselbe E-Mail-Adresse
|
||||
mehreren eigenstaendigen Avataren zugeordnet sein. Die bisherige Zuordnung
|
||||
`GetUserAccount(scope, senderEmail)` ist deshalb nicht mehr eindeutig.
|
||||
Neue Offline-IM-Antworten benutzen einen signierten `r2`-Reply-Token mit
|
||||
Empfaenger-/Antwortavatar-UUID. ROBUST loest die antwortende Identitaet
|
||||
anhand der signierten UUID auf und kontrolliert, dass die Absenderadresse
|
||||
noch dem aktiven Avatar gehoert. Alte, nicht identitaetsgebundene
|
||||
`r`-Tokens werden im aktualisierten Relay aus Sicherheitsgruenden
|
||||
abgewiesen. Fuer den Schnittstellenwechsel muessen Simulator (Sender)
|
||||
und ROBUST (Empfaenger) gemeinsam aktualisiert werden.
|
||||
@@ -45,8 +45,8 @@ X-NexVerse-Api-Key: <SERVER_ONLY_KEY>
|
||||
- Nur gültige Avatarnamen (2–31 Zeichen; Unicode-Buchstaben,
|
||||
Ziffern, Unterstrich, Bindestrich), E-Mail und Passwörter
|
||||
zwischen 12 und 128 Zeichen werden akzeptiert.
|
||||
- Doppelter Avatarname ⇒ `409 avatar_name_taken`; registrierte
|
||||
E-Mail ⇒ `409 email_registered`. Nicht vorbereitete Startervorlage
|
||||
- Doppelter Avatarname ⇒ `409 avatar_name_taken`; dieselbe
|
||||
E-Mail darf mehreren Avataren zugeordnet werden. Nicht vorbereitete Startervorlage
|
||||
⇒ `422 registration_failed`.
|
||||
|
||||
### KeyHelp-Reverse-Proxy, HTTP-Backend und Startposition
|
||||
@@ -152,8 +152,7 @@ bedeutet fehlende Freigabe oder einen nicht verfügbaren
|
||||
erfordert Prüfung von Modell-Freigabe und Home-/Last-
|
||||
Initialisierung im ROBUST-Log. `401 unauthorized_portal`
|
||||
deutet auf fehlenden/falschen Key oder Scope hin.
|
||||
`409 avatar_name_taken`/ `email_registered` bedeutet,
|
||||
dass ein Name beziehungsweise die E-Mail bereits existiert.
|
||||
`409 avatar_name_taken` bedeutet, dass der Avatarname bereits existiert.\nDie E-Mail-Adresse darf mehrfach verwendet werden; das E-Mail-Pflichtfeld\nbleibt bestehen.
|
||||
Bei einem Netzwerkausfall nach dem POST vor erneuter
|
||||
Registrierung nachsehen, ob der Avatar bereits angelegt wurde.
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# ROBUST: Avatar sicher entfernen (delete user)
|
||||
|
||||
Stand: 21.10.2026. Gilt fuer den lokalen OpenGenesisLINK-Benutzerkontendienst
|
||||
auf dem zentralen ROBUST.
|
||||
|
||||
## Konsole
|
||||
|
||||
```text
|
||||
R.O.B.U.S.T.# show account Vorname Nachname
|
||||
R.O.B.U.S.T.# delete user Vorname Nachname <UUID>
|
||||
R.O.B.U.S.T.# delete user Vorname Nachname <UUID> --confirm
|
||||
```
|
||||
|
||||
Der Befehl **ohne `--confirm` ist eine reine Vorschau**: Name und
|
||||
UUID muessen genau zusammenpassen. Bei `--confirm` verlangt ROBUST
|
||||
zusaetzlich die vollstaendige Zeichenfolge `DELETE <UUID>`.
|
||||
Bei einer fehlerhaften Eingabe wird nichts entfernt.
|
||||
|
||||
## Voraussetzungen und Schutz
|
||||
|
||||
- Vor einer dauerhaften Loeschung eine getestete Sicherung der ROBUST-DB
|
||||
und eine kontrollierte Betriebspause vorsehen. Aktive Avatar-Sessions
|
||||
und aktuelle `Presence`-Eintraege blockieren die Loeschung.
|
||||
- Loeschung des System-/GRID-SERVICES-Kontos und von UserLevel >= 200
|
||||
wird verweigert. Fremde Hypergrid-Identitaeten werden nicht entfernt.
|
||||
- Alle lokalen Kernspeicher muessen denselben Provider und dieselbe
|
||||
Verbindungszeichenfolge verwenden. Bei getrennten Datenbanken,
|
||||
unueblichen Tabellen-Realms oder fehlenden Tabellen verweigert
|
||||
ROBUST die automatische Loeschung.
|
||||
- Provider: MariaDB/MySQL, PostgreSQL und SQLite. Der Befehl benutzt
|
||||
parameterisierte SQL-Anweisungen mit einer Transaktion.
|
||||
- Der Vorgang entfernt **nur** zentrale Avatar-Daten:
|
||||
`tokens`, `auth`, `inventoryitems`, `inventoryfolders`,
|
||||
`Avatars`, `GridUser`, `Presence`, die eigenen und
|
||||
gegenseitigen `Friends`-Eintraege sowie `UserAccounts`.
|
||||
Fremde Benutzerkonten mit derselben E-Mail-Adresse bleiben bestehen.
|
||||
|
||||
## Wichtige Grenze: kein vollstaendiger Grid-Cascade-Delete
|
||||
|
||||
Dieser Befehl loescht **noch nicht** automatisch von externen Diensten
|
||||
und Addons verwaltete Daten: Gruppen, NV$-Guthaben und Buchungen, World API
|
||||
oder Stadtportal, UserProfiles, IM-Archive, Experiences, Marketplace,
|
||||
Regionsinventar, Land/Parzellen, gerezzte Objekte oder Hypergrid-Caches.
|
||||
Insbesondere Asset-Dateien duerfen nicht blind geloescht werden, da
|
||||
sie von anderen Avataren weiterverwendet werden koennen.
|
||||
|
||||
**Vor dem irreversiblen Schritt** Eigentuemerwechsel oder manuelle
|
||||
Bereinigung dieser Komponenten einplanen. Der Dienst meldet nur
|
||||
die Loeschung der zentralen Avataridentitaet als erfolgreich, nicht
|
||||
eine vollstaendige End-to-End-Datenbereinigung. Fuer eine
|
||||
datenschutzrechtlich vollstaendige Loeschung sind die unabhaengigen
|
||||
Systeme getrennt zu pruefen und zu bereinigen.
|
||||
|
||||
Die benutzten Zugangsdaten der Datenbank bleiben in den jeweiligen
|
||||
INI-/Environment-Einstellungen; keine SQL-Passwoerter in Logdateien
|
||||
oder im Loeschbefehl angeben.
|
||||
@@ -10,6 +10,8 @@ for needle in (
|
||||
"CryptographicOperations.FixedTimeEquals",
|
||||
"RandomNumberGenerator.GetBytes",
|
||||
"TryValidate(",
|
||||
"TryValidateReply(",
|
||||
"replyingAgentId",
|
||||
"maximumFutureLifetime",
|
||||
):
|
||||
assert needle in token, f"relay token helper missing {needle}"
|
||||
@@ -32,13 +34,14 @@ for needle in (
|
||||
"ImapClient",
|
||||
"SearchQuery.NotSeen",
|
||||
"relay@im.stadt-nexverse.de",
|
||||
"OfflineImMailRelayToken.TryValidate(",
|
||||
"GetUserAccount(UUID.Zero, senderEmail)",
|
||||
"OfflineImMailRelayToken.TryValidateReply(",
|
||||
"GetUserAccount(UUID.Zero, replyingAgentId)",
|
||||
"OfflineImMailRelayToken.NormalizeEmail(replyingAccount.Email)",
|
||||
"replyingAccount.LocalToGrid",
|
||||
"IncomingInstantMessage(im)",
|
||||
"MessageFlags.Seen",
|
||||
"MaximumReplyCharacters",
|
||||
"Ignored catch-all mail from non-NexVerse sender",
|
||||
"Rejected reply with absent, inactive or mismatched avatar identity",
|
||||
):
|
||||
assert needle in relay, f"Robust IM mail relay missing {needle}"
|
||||
|
||||
|
||||
@@ -41,6 +41,29 @@ for marker in (
|
||||
assert marker in api, "Live name availability API security/contract missing: " + marker
|
||||
assert api.count("if (!AuthorizePortal(request, response))") == 2, "Both routes must share identical security checks."
|
||||
assert api.count("m_Accounts.GetUserAccount(UUID.Zero, first, last)") >= 2, "Live lookup must match final POST lookup."
|
||||
assert '"email_registered"' not in api, "Email contact address is reusable for multiple avatars"
|
||||
assert "m_Accounts.GetUserAccount(UUID.Zero, email)" not in api, "Do not treat shared email as unique avatar identity"
|
||||
assert "if (!IsValidEmail(email))" in api, "Contact email remains mandatory and syntactically validated"
|
||||
account_deletion = Path("OpenSim/Services/UserAccountService/UserAccountService.cs").read_text()
|
||||
for marker in (
|
||||
'"delete user"',
|
||||
'HandleDeleteUser',
|
||||
'"--confirm"',
|
||||
'"DELETE " + userId',
|
||||
'GetGridUserInfo(userId.ToString())',
|
||||
'connection.BeginTransaction()',
|
||||
'deletionTransaction.Commit()',
|
||||
'"UserAccounts", "PrincipalID"',
|
||||
'"inventoryitems", "avatarID"',
|
||||
'"inventoryfolders", "agentID"',
|
||||
'"auth", "UUID"',
|
||||
'"tokens", "UUID"',
|
||||
'"Avatars", "PrincipalID"',
|
||||
'"GridUser", "UserID"',
|
||||
'"Friends", "PrincipalID"',
|
||||
):
|
||||
assert marker in account_deletion, "Missing safe ROBUST avatar deletion boundary: " + marker
|
||||
|
||||
assert api.index("NexScopes.UsersRegister") < api.index("public void HandleNameAvailability(")
|
||||
assert api.index("public void HandleNameAvailability(") < api.index("public void Handle(")
|
||||
assert "X-NexVerse-Api-Key" in api and "HttpStatusCode.Created" in api
|
||||
|
||||
Reference in new issue
Block a user