Public Access
Merge branch 'main' into the desktop updater, and give way on two numbers
Main landed a realtime push feature while this branch was building the updater, and the two collided in three places. Every one of them resolves the same way: main got there first, so this branch moves. **Two ADRs were both numbered 0012.** Main's is realtime push; this one is now [ADR 0013](docs/adr/0013-desktop-distribution-and-updates.md). Git did not call this a conflict — the filenames differ — so it would have merged quietly and left the directory with two 0012s and every cross-reference ambiguous. Renumbered here along with the nine places that point at it. **Two manual-check phases were both numbered 15**, and that one git did catch. Main's "Changes that arrive without a timer" keeps 15; installing and updating the desktop client becomes Phase 16, with its checks and every reference to them renumbered. The file's own rule is that a number is for life, which is exactly why the one that had not been pushed is the one that gives way. **The merge rewrote several files with CRLF**, and `.editorconfig` asks for LF on everything except `*.ps1`. That is not cosmetic here: IDE0055 is an error and `EnforceCodeStyleInBuild` is on, so it failed the build on three lines of App.axaml.cs whose only change in this branch was an ADR number in a comment. Forty-six files normalised back to LF; the release script keeps CRLF, which is what `.gitattributes` and `.editorconfig` both already say for a PowerShell file. Nothing else conflicted. The updater does not touch the sync loop or the event stream, and the one file both sides edited heavily — MainWindowViewModel — merged without a hunk in common. Verified after merging: the solution restores locked and builds clean, and 304 shell, 100 layout, 54 session, 28 client-api and 25 contracts tests pass. The first two counts are higher than before the merge because main's own tests came with it and pass alongside these.
This commit is contained in:
@@ -150,6 +150,17 @@ public interface IVaultServer : IDisposable
|
||||
/// <summary>Vault key grants: who can open a vault, and who let them.</summary>
|
||||
IVaultGrantApi Grants { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Notices that something changed, so a synchronisation need not wait for the timer.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Always present, never null: a server that does not offer the feature — or a test standing in
|
||||
/// for one — supplies <see cref="IdleVaultEventStream"/>, which simply never delivers. That keeps
|
||||
/// every caller on one shape, because the correct behaviour without a socket is the behaviour
|
||||
/// with a silent one: synchronise on the timer. See ADR 0012.
|
||||
/// </remarks>
|
||||
IVaultEventStream Events { get; }
|
||||
|
||||
/// <summary>Obtains the identity provider's signature over a key statement.</summary>
|
||||
IKeyBindingAuthorizer KeyBinding { get; }
|
||||
|
||||
@@ -197,7 +208,8 @@ public sealed class ServerConnection : IVaultServer
|
||||
MetaResponse meta,
|
||||
OidcClient oidc,
|
||||
RefreshingAccessTokenProvider tokens,
|
||||
DodoSshApiClient api)
|
||||
DodoSshApiClient api,
|
||||
TimeProvider clock)
|
||||
{
|
||||
ServerUrl = serverUrl;
|
||||
this.http = http;
|
||||
@@ -206,6 +218,14 @@ public sealed class ServerConnection : IVaultServer
|
||||
Oidc = oidc;
|
||||
this.tokens = tokens;
|
||||
Api = api;
|
||||
|
||||
// Decided from what this server said it supports rather than attempted and allowed to fail,
|
||||
// which is the same capability negotiation SyncOptions below does — see ADR 0002. A client
|
||||
// that dialled anyway would reconnect against a 404 for the whole session, and would look
|
||||
// from the outside exactly like one whose network was eating WebSockets.
|
||||
Events = meta.Features.Contains(VaultEvents.Feature, StringComparer.Ordinal)
|
||||
? new VaultEventStream(serverUrl, tokens, clock)
|
||||
: IdleVaultEventStream.Instance;
|
||||
}
|
||||
|
||||
/// <summary>The server this is connected to.</summary>
|
||||
@@ -238,6 +258,9 @@ public sealed class ServerConnection : IVaultServer
|
||||
/// <inheritdoc />
|
||||
public IVaultGrantApi Grants => Api;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IVaultEventStream Events { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IKeyBindingAuthorizer KeyBinding => Oidc;
|
||||
|
||||
@@ -311,7 +334,8 @@ public sealed class ServerConnection : IVaultServer
|
||||
meta,
|
||||
oidc,
|
||||
refreshing,
|
||||
new DodoSshApiClient(transport, refreshing));
|
||||
new DodoSshApiClient(transport, refreshing),
|
||||
clock);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -382,7 +406,8 @@ public sealed class ServerConnection : IVaultServer
|
||||
meta,
|
||||
oidc,
|
||||
refreshing,
|
||||
new DodoSshApiClient(transport, refreshing));
|
||||
new DodoSshApiClient(transport, refreshing),
|
||||
clock);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -400,6 +425,12 @@ public sealed class ServerConnection : IVaultServer
|
||||
}
|
||||
|
||||
disposed = true;
|
||||
|
||||
// First, and without waiting: the socket's own loops read the token provider and the transport
|
||||
// below, so tearing either down while it is still dialling would surface as a fault on a
|
||||
// background thread at the moment a user signed out.
|
||||
Events.Dispose();
|
||||
|
||||
tokens.Dispose();
|
||||
http.Dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user