Added a check for the characters of ERI usernames, tokens, and passwords (#1228)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-24 18:47:44 +01:00
1 parent e5a7f5423f
commit 9b4d07552d
16 files changed
+988 -21

No files matched your search

@@ -91,10 +91,11 @@ public sealed class DataSourceValidation
if(string.IsNullOrWhiteSpace(username))
return TB("The username must not be empty.");
return null;
// The username goes to the ERI server in an HTTP header, which carries nothing but ASCII:
return ERICredentialValidation.ValidateUsername(username);
}
public string? ValidatingSecret(string secret)
{
var authMethod = this.GetAuthMethod();
@@ -113,8 +114,9 @@ public sealed class DataSourceValidation
_ => TA("Please enter the secret necessary for authentication.")
};
return null;
// Like the username, the password or the token goes to the ERI server in an HTTP header:
return ERICredentialValidation.ValidateSecret(authMethod, secret);
}
public string? ValidateRetrievalProcess(RetrievalInfo retrievalInfo)