feat(settings): hub bearer-token panel + auto-attach on every RPC
Some checks failed
Security / Security check (push) Failing after 1s
Some checks failed
Security / Security check (push) Failing after 1s
Studio gains a new "HUB AUTHENTICATION" panel in Settings
mirroring the existing registry-credentials panel:
- `lib/data/hub_auth_token.dart` — `~/.fai/hub-auth-token`
helper (read / write / clear, mode 0600 on Unix). Sister
of `RegistryToken` with the same on-disk hygiene.
- `HubService.loadPersistedEndpoint` now reads the token at
startup and reconnects with it. `reconnect()` grew an
`authToken:` parameter with a sentinel that distinguishes
"keep current" from "drop". `reloadAuthToken()` is the
one-liner Settings calls after save / clear.
- `_HubAuthTokenPanel` in `fai_settings_dialog.dart` — paste
with show/hide toggle, save button, clear button, status
pill ("Configured (40 chars)" / "Not set (anonymous)"),
storage-location hint. Trimmed token length only — the
secret never round-trips back into the UI after save.
- EN + DE ARB entries (`hubAuthToken*`) + regenerated
`app_localizations.dart` keep the bilingual surface
consistent.
The hub side (auth.tokens config + tower middleware) shipped
on the platform side 2026-05-28 (43a54a2). Until now an
operator had no GUI path to consume it: they had to find the
file in their home dir, paste the token by hand, and bounce
Studio. This panel closes that loop.
Bumped pubspec to 0.47.0. dart analyze clean (No issues
found!); flutter test green (11 tests pass).
Block E item 1 of 4 done. Capability-picker badges,
default_scope editor, multi-version uninstall picker follow.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
3237c4415a
commit
c5a96bc8d4
9 changed files with 538 additions and 12 deletions
|
|
@ -2174,6 +2174,78 @@ abstract class AppLocalizations {
|
|||
/// **'Could not save: {error}'**
|
||||
String registryTokenSaveFailedToast(String error);
|
||||
|
||||
/// No description provided for @hubAuthTokenHeader.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'HUB AUTHENTICATION'**
|
||||
String get hubAuthTokenHeader;
|
||||
|
||||
/// No description provided for @hubAuthTokenBlurb.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Bearer token used to authenticate Studio against a hub that has auth.tokens: configured (RBAC Level 2). Stored at ~/.fai/hub-auth-token, mode 0600. Studio sends it as Authorization: Bearer on every gRPC call.'**
|
||||
String get hubAuthTokenBlurb;
|
||||
|
||||
/// No description provided for @hubAuthTokenStatusConfigured.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Configured ({chars} chars)'**
|
||||
String hubAuthTokenStatusConfigured(int chars);
|
||||
|
||||
/// No description provided for @hubAuthTokenStatusNotSet.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Not set (anonymous)'**
|
||||
String get hubAuthTokenStatusNotSet;
|
||||
|
||||
/// No description provided for @hubAuthTokenFieldLabel.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Token'**
|
||||
String get hubAuthTokenFieldLabel;
|
||||
|
||||
/// No description provided for @hubAuthTokenFieldHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Paste a token from the hub operator\'s auth.tokens entry'**
|
||||
String get hubAuthTokenFieldHint;
|
||||
|
||||
/// No description provided for @hubAuthTokenSaveButton.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Save'**
|
||||
String get hubAuthTokenSaveButton;
|
||||
|
||||
/// No description provided for @hubAuthTokenClearButton.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Clear'**
|
||||
String get hubAuthTokenClearButton;
|
||||
|
||||
/// No description provided for @hubAuthTokenStorageHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Saved locally to ~/.fai/hub-auth-token. Studio reconnects after save so the new token takes effect immediately.'**
|
||||
String get hubAuthTokenStorageHint;
|
||||
|
||||
/// No description provided for @hubAuthTokenSavedToast.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Hub auth token saved.'**
|
||||
String get hubAuthTokenSavedToast;
|
||||
|
||||
/// No description provided for @hubAuthTokenClearedToast.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Hub auth token cleared.'**
|
||||
String get hubAuthTokenClearedToast;
|
||||
|
||||
/// No description provided for @hubAuthTokenSaveFailedToast.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Could not save: {error}'**
|
||||
String hubAuthTokenSaveFailedToast(String error);
|
||||
|
||||
/// No description provided for @maintenanceHeader.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue