Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a desktop left running past a day keeps its local backend credential #16257

Closedjuliusmarmingewants to merge 1 commit intomain fromt3/desktop-bootstrap-no-expiryopened View on GitHub

Showing 2 changed files with 16 additions and 28 deletions.

x
0 of 2 viewed, 2 left
6 additions and 11 deletionsapps/server/src/auth/PairingGrantStore.test.tsModified
View file
@@ -168,21 +168,16 @@
​
- it.effect("reports seeded desktop bootstrap credentials as expired after their ttl", () =>
+ it.effect("keeps the seeded desktop bootstrap credential valid for the life of the server", () =>
Effect.gen(function* () {
const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore;
​
- // The desktop-bootstrap grant lives for 24h. Within that window
- // it stays reusable.
- yield* TestClock.adjust(Duration.hours(12));
- const stillValid = yield* bootstrapCredentials.consume("desktop-bootstrap-token");
- expect(stillValid.method).toBe("desktop-bootstrap");
+ // A desktop left running for days keeps the token it was launched
+ // with, and the renderer re-exchanges it on every topology poll.
+ yield* TestClock.adjust(Duration.days(30));
+ const grant = yield* bootstrapCredentials.consume("desktop-bootstrap-token");
​
- yield* TestClock.adjust(Duration.hours(13));
- const expired = yield* Effect.flip(bootstrapCredentials.consume("desktop-bootstrap-token"));
-​
- expect(expired._tag).toBe("ExpiredBootstrapCredentialError");
- expect(expired.message).toContain("Bootstrap credential expired");
+ expect(grant.method).toBe("desktop-bootstrap");
}).pipe(
Effect.provide(
Layer.merge(