mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-25 02:13:48 +00:00
Added a check for the characters of ERI usernames, tokens, and passwords (#1228)
This commit is contained in:
1 parent
e5a7f5423f
commit
9b4d07552d
16 files changed
+988
-21
No files matched your search
@@ -198,7 +198,7 @@ public partial class DataSourceERI_V1Dialog : MSGComponentBase, ISecretId
|
||||
Name = this.dataName,
|
||||
Hostname = cleanedHostname.EndsWith('/') ? cleanedHostname[..^1] : cleanedHostname,
|
||||
AuthMethod = this.dataAuthMethod,
|
||||
Username = this.dataUsername,
|
||||
Username = ERICredentialValidation.Normalize(this.dataUsername),
|
||||
UsernamePasswordMode = DataSourceERIUsernamePasswordMode.USER_MANAGED,
|
||||
Type = DataSourceType.ERI_V1,
|
||||
SecurityPolicy = this.dataSecurityPolicy,
|
||||
@@ -389,8 +389,11 @@ public partial class DataSourceERI_V1Dialog : MSGComponentBase, ISecretId
|
||||
var addedDataSource = this.CreateDataSource();
|
||||
if (!string.IsNullOrWhiteSpace(this.dataSecret))
|
||||
{
|
||||
// Store the secret in the OS secure storage:
|
||||
var storeResponse = await this.RustService.SetSecret(this, this.dataSecret, SecretStoreType.DATA_SOURCE);
|
||||
//
|
||||
// Store the secret in the OS secure storage, without the whitespace around it: it goes
|
||||
// to the ERI server in an HTTP header, which drops that whitespace anyway:
|
||||
//
|
||||
var storeResponse = await this.RustService.SetSecret(this, ERICredentialValidation.Normalize(this.dataSecret), SecretStoreType.DATA_SOURCE);
|
||||
if (!storeResponse.Success)
|
||||
{
|
||||
this.dataSecretStorageIssue = string.Format(TA("Failed to store the auth. secret in the operating system. The message was: {0}. Please try again."), storeResponse.Issue);
|
||||
|
||||
Reference in new issue
Block a user