Skip to content

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

Merged
SommerEngineering merged 8 commits into
MindWorkAI:mainfrom
SommerEngineering:eri-credential-character-check
Nov 24, 2026
Merged

SommerEngineering merged 8 commits into
MindWorkAI:mainfrom
SommerEngineering:eri-credential-character-check

Conversation

@SommerEngineering

Copy link
Copy Markdown
Member

Summary

ERI v1 sends the username, the password, and the access token of a data source in HTTP headers, which carry nothing but ASCII. Until now, an umlaut in a password or an invisible character in a token failed only while signing in, with messages such as "Request headers must contain only ASCII characters.", which users cannot act on. No input checked more than whether a value was empty. #1227 introduced the central check for API keys and left ERI to this pull request, since tokens and passwords need texts of their own, and a password may contain spaces.

What changes:

  • The check: APIKeyValidation.Check gets an overload which allows plain spaces inside a value. The new ERICredentialValidation in Tools/Validation/ checks an access token exactly like an API key, and a password or a username with spaces allowed inside. Spaces and line breaks around a value go, since HTTP drops them anyway. A message about a password never names the character, since the field hides the password. Messages about stored values name no character at all, since the callers of the ERI client write them to the log.
  • The dialog: The dialog of an ERI data source shows the issue below the username and the secret field and refuses to save. It stores the username and the secret trimmed.
  • Configuration plugins: A username, token, or password with a character which the ERI server cannot receive leaves out the data source, as a secret which cannot be decrypted does, with a warning in the log which names the kind of character but not the value. A dry run writes the warning as well. Spaces and line breaks around a token or password are trimmed.
  • Signing in: The ERI client checks the username, the password, or the token before sending, also a username read from the operating system, and answers with a clear message which names the data source. The access token now goes into a typed Authorization header, which .NET does not parse, so that no message of the client repeats a value of the request. A guard test keeps the ERI client from parsing an Authorization header again.
  • Changelog entries and the German translation. The export of an ERI data source now says "Zugangstoken", as the dialog does.

Related proposal or issue

None. Follow-up to #1227, found while reviewing #1224.

How did you test it?

  • Ran dotnet run -- verify: 7,392 .NET tests, the trim smoke test, 379 Rust tests, Clippy, and the model sources.
  • New unit tests check:
    • the check of tokens, passwords, and usernames, with characters of several scripts, invisible characters, and decomposed umlauts, and that a message about a password depends on no character and contains no part of the password;
    • the validation in the dialog of an ERI data source;
    • that the ERI client sends no unusable username, password, or token, and still sends a password with spaces;
    • with a small ERI server on the loopback address, that a session token with a line break appears in no message;
    • a guard over the source code: no ERI client parses an Authorization header.

Wiki

Users, page "Troubleshooting" (German: "Fehlerbehebung"), section "Data sources": a new entry for the messages about a username, access token, or password with a character "which the ERI server cannot receive" or "which an access token cannot contain". Enter the value again under "Settings" → "Configure Data Sources" → "Edit". Spaces inside a password or username are fine, and AI Studio removes spaces and line breaks around it. An umlaut or a typographic quotation mark cannot reach the ERI server; then the IT department helps. Requires AI Studio v26.11.2 or newer.

IT departments, page "Confidence and Data Security", section "Rolling out data sources on ERI servers": usernames, tokens, and passwords travel in HTTP headers and may contain ASCII only. Spaces inside a username or password are fine, and AI Studio removes spaces and line breaks around them. A data source with any other character is left out, and the log names the kind of character, but not the value. Requires AI Studio v26.11.2 or newer.

Both are prepared for the release.

Required statements

  • Review: I have reviewed every change in this pull request and can explain it when asked.
  • License: I license my contribution in this pull request, including all commits I add to it later, under the MIT License, and I agree that it is distributed as part of MindWork AI Studio under the project license or under the MIT License.
  • Right to contribute: The contribution is my own work, or I have permission to submit it, including the consent of my employer or client where needed. To the best of my knowledge, it does not infringe the rights of others, and AI-generated parts do not reproduce third-party code under incompatible terms.
  • Changes by maintainers: I understand that the maintainers will change this pull request to fit the product, and that they may close it.

Credits (optional)

  • Credit me with my GitHub username only.
  • Do not credit me.

@SommerEngineering SommerEngineering self-assigned this Nov 24, 2026
@SommerEngineering
SommerEngineering marked this pull request as ready for review November 24, 2026 17:47
@SommerEngineering
SommerEngineering requested a review from a team as a code owner November 24, 2026 17:47
@SommerEngineering
SommerEngineering merged commit 9b4d075 into MindWorkAI:main Nov 24, 2026
11 checks passed
@SommerEngineering
SommerEngineering deleted the eri-credential-character-check branch November 24, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant