domain/updates/feed
Classes
Section titled “Classes”FeedError
Section titled “FeedError”Defined in: app/src/domain/updates/feed.ts:58
A feed that cannot be trusted or used. Nothing is installed after such an error.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FeedError(
code,message):FeedError
Defined in: app/src/domain/updates/feed.ts:67
Parameters
Section titled “Parameters”Why the feed was rejected.
message
Section titled “message”string
Details for logs and diagnostics.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:FeedErrorCode
Defined in: app/src/domain/updates/feed.ts:61
Why the feed was rejected.
readonlyname:"FeedError"='FeedError'
Defined in: app/src/domain/updates/feed.ts:59
Overrides
Section titled “Overrides”Error.name
SignedFeed
Section titled “SignedFeed”Defined in: app/src/domain/updates/feed.ts:143
The signed update feed. Every file is verified before it is parsed, and the index must be fresh and must not go back in sequence.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SignedFeed(
fetcher,verifier,state,now):SignedFeed
Defined in: app/src/domain/updates/feed.ts:155
Parameters
Section titled “Parameters”fetcher
Section titled “fetcher”Loads feed files.
verifier
Section titled “verifier”Checks signatures.
Highest sequence seen so far.
() => number
Current wall time in milliseconds since the epoch.
Returns
Section titled “Returns”Methods
Section titled “Methods”findUpdate()
Section titled “findUpdate()”findUpdate(
query):Promise<AvailableUpdate|undefined>
Defined in: app/src/domain/updates/feed.ts:174
Looks for an update.
Parameters
Section titled “Parameters”What to look for.
Returns
Section titled “Returns”Promise<AvailableUpdate | undefined>
The release and its file for this platform, or undefined when the browser
is up to date.
Throws
Section titled “Throws”When the feed cannot be trusted or has no file for this platform.
manifest()
Section titled “manifest()”manifest(
version):Promise<{artifacts: {[key:string]:object; };downloadBase:string;releaseDate:string;schemaVersion:1;version:string; }>
Defined in: app/src/domain/updates/feed.ts:200
Loads and verifies the manifest of one version, such as the running one, whose package the boot guard keeps for a rollback.
Parameters
Section titled “Parameters”version
Section titled “version”string
The version.
Returns
Section titled “Returns”Promise<{ artifacts: {[key: string]: object; }; downloadBase: string; releaseDate: string; schemaVersion: 1; version: string; }>
Throws
Section titled “Throws”When the manifest cannot be trusted.
Interfaces
Section titled “Interfaces”AvailableUpdate
Section titled “AvailableUpdate”Defined in: app/src/domain/updates/feed.ts:117
A verified release that is newer than the running version.
Properties
Section titled “Properties”artifact
Section titled “artifact”
readonlyartifact:object
Defined in: app/src/domain/updates/feed.ts:119
blockMapSize?
Section titled “blockMapSize?”
optionalblockMapSize?:number
file:
string=fileName
sha512
Section titled “sha512”sha512:
string
size:
number
manifest
Section titled “manifest”
readonlymanifest:object
Defined in: app/src/domain/updates/feed.ts:118
artifacts
Section titled “artifacts”artifacts:
object
Index Signature
Section titled “Index Signature”[key: string]: object
downloadBase
Section titled “downloadBase”downloadBase:
string
releaseDate
Section titled “releaseDate”releaseDate:
string=timestamp
schemaVersion
Section titled “schemaVersion”schemaVersion:
1
version
Section titled “version”version:
string=versionSchema
FeedFetcher
Section titled “FeedFetcher”Defined in: app/src/domain/updates/feed.ts:84
Loads feed files from GitHub Pages or a mirror.
Methods
Section titled “Methods”fetch()
Section titled “fetch()”fetch(
path):Promise<string|undefined>
Defined in: app/src/domain/updates/feed.ts:89
Parameters
Section titled “Parameters”string
Path relative to the feed root, such as updates/v1/index.json.
Returns
Section titled “Returns”Promise<string | undefined>
The file as UTF-8 text, or undefined when the file does not exist.
FeedStateStore
Section titled “FeedStateStore”Defined in: app/src/domain/updates/feed.ts:93
Remembers the highest index sequence seen, to detect rollback attacks.
Methods
Section titled “Methods”readSequence()
Section titled “readSequence()”readSequence():
number
Defined in: app/src/domain/updates/feed.ts:95
Returns the highest sequence seen so far, or 0.
Returns
Section titled “Returns”number
writeSequence()
Section titled “writeSequence()”writeSequence(
sequence):void
Defined in: app/src/domain/updates/feed.ts:100
Stores a higher sequence.
Parameters
Section titled “Parameters”sequence
Section titled “sequence”number
Sequence of a verified index.
Returns
Section titled “Returns”void
ReleaseQuery
Section titled “ReleaseQuery”Defined in: app/src/domain/updates/feed.ts:104
What the browser asks the feed for.
Properties
Section titled “Properties”artifactKey
Section titled “artifactKey”
readonlyartifactKey:string
Defined in: app/src/domain/updates/feed.ts:111
Platform, architecture and package format, such as linux-x64-appimage.
blocked?
Section titled “blocked?”
readonlyoptionalblocked?: readonlystring[]
Defined in: app/src/domain/updates/feed.ts:113
Versions that failed to start here and are never installed again.
channel
Section titled “channel”
readonlychannel:"stable"|"beta"
Defined in: app/src/domain/updates/feed.ts:105
currentVersion
Section titled “currentVersion”
readonlycurrentVersion:string
Defined in: app/src/domain/updates/feed.ts:109
The running version.
versionPrefix?
Section titled “versionPrefix?”
readonlyoptionalversionPrefix?:string
Defined in: app/src/domain/updates/feed.ts:107
Only versions with this prefix, from the TargetVersionPrefix policy.
SignatureVerifier
Section titled “SignatureVerifier”Defined in: app/src/domain/updates/feed.ts:74
Checks detached Ed25519 signatures against the public keys built into the browser.
Methods
Section titled “Methods”verify()
Section titled “verify()”verify(
data,signature):boolean
Defined in: app/src/domain/updates/feed.ts:80
Parameters
Section titled “Parameters”string
The signed text; its UTF-8 bytes are what was signed.
signature
Section titled “signature”string
The detached signature, Base64-encoded.
Returns
Section titled “Returns”boolean
Whether any trusted key made the signature.
Type Aliases
Section titled “Type Aliases”FeedErrorCode
Section titled “FeedErrorCode”FeedErrorCode =
"unavailable"|"signature"|"invalid"|"rollback"|"expired"|"mismatch"|"no-artifact"
Defined in: app/src/domain/updates/feed.ts:54
Why a feed was rejected.
FeedIndex
Section titled “FeedIndex”FeedIndex =
v.InferOutput<typeofFeedIndexSchema>
Defined in: app/src/domain/updates/feed.ts:24
The signed index of the feed.
ReleaseArtifact
Section titled “ReleaseArtifact”ReleaseArtifact =
v.InferOutput<typeofReleaseArtifactSchema>
Defined in: app/src/domain/updates/feed.ts:37
One downloadable file of a release.
ReleaseManifest
Section titled “ReleaseManifest”ReleaseManifest =
v.InferOutput<typeofReleaseManifestSchema>
Defined in: app/src/domain/updates/feed.ts:51
The signed manifest of one release.
Variables
Section titled “Variables”FeedIndexSchema
Section titled “FeedIndexSchema”
constFeedIndexSchema:ObjectSchema<{expiresAt:SchemaWithPipe<readonly [StringSchema<undefined>,IsoTimestampAction<string,undefined>]>;issuedAt:SchemaWithPipe<readonly [StringSchema<undefined>,IsoTimestampAction<string,undefined>]>;releases:ArraySchema<ObjectSchema<{channel:PicklistSchema<["stable","beta"],undefined>;version:SchemaWithPipe<readonly [StringSchema<undefined>,CheckAction<string,"Must be a semantic version">]>; },undefined>,undefined>;schemaVersion:LiteralSchema<1,undefined>;sequence:SchemaWithPipe<readonly [NumberSchema<undefined>,IntegerAction<number,undefined>,MinValueAction<number,0,undefined>]>; },undefined>
Defined in: app/src/domain/updates/feed.ts:14
updates/v1/index.json: the releases per channel and the freshness fields.
ReleaseArtifactSchema
Section titled “ReleaseArtifactSchema”
constReleaseArtifactSchema:ObjectSchema<{blockMapSize:OptionalSchema<SchemaWithPipe<readonly [NumberSchema<undefined>,IntegerAction<number,undefined>,MinValueAction<number,0,undefined>]>,undefined>;file:SchemaWithPipe<readonly [StringSchema<undefined>,RegexAction<string,"Must be a plain file name">]>;sha512:SchemaWithPipe<readonly [StringSchema<undefined>,RegexAction<string,"Must be Base64">]>;size:SchemaWithPipe<readonly [NumberSchema<undefined>,IntegerAction<number,undefined>,MinValueAction<number,0,undefined>]>; },undefined>
Defined in: app/src/domain/updates/feed.ts:27
One downloadable file of a release.
ReleaseManifestSchema
Section titled “ReleaseManifestSchema”
constReleaseManifestSchema:ObjectSchema<{artifacts:RecordSchema<StringSchema<undefined>,ObjectSchema<{blockMapSize:OptionalSchema<SchemaWithPipe<readonly [NumberSchema<undefined>,IntegerAction<number,undefined>,MinValueAction<number,0,undefined>]>,undefined>;file:SchemaWithPipe<readonly [StringSchema<undefined>,RegexAction<string,"Must be a plain file name">]>;sha512:SchemaWithPipe<readonly [StringSchema<undefined>,RegexAction<string,"Must be Base64">]>;size:SchemaWithPipe<readonly [NumberSchema<undefined>,IntegerAction<number,undefined>,MinValueAction<number,0,undefined>]>; },undefined>,undefined>;downloadBase:StringSchema<undefined>;releaseDate:SchemaWithPipe<readonly [StringSchema<undefined>,IsoTimestampAction<string,undefined>]>;schemaVersion:LiteralSchema<1,undefined>;version:SchemaWithPipe<readonly [StringSchema<undefined>,CheckAction<string,"Must be a semantic version">]>; },undefined>
Defined in: app/src/domain/updates/feed.ts:40
updates/v1/releases/<version>.json: the files of one release.
Functions
Section titled “Functions”selectRelease()
Section titled “selectRelease()”selectRelease(
index,query):string|undefined
Defined in: app/src/domain/updates/feed.ts:128
Picks the release to update to: the highest version of the channel that matches the prefix and is newer than the running one. Downgrades are never selected.
Parameters
Section titled “Parameters”The verified index.
expiresAt
Section titled “expiresAt”string = timestamp
issuedAt
Section titled “issuedAt”string = timestamp
releases
Section titled “releases”object[] = ...
schemaVersion
Section titled “schemaVersion”1 = ...
sequence
Section titled “sequence”number = ...
Channel, prefix and running version.
Returns
Section titled “Returns”string | undefined
References
Section titled “References”UpdateChannel
Section titled “UpdateChannel”Re-exports UpdateChannel
UpdateChannelSchema
Section titled “UpdateChannelSchema”Re-exports UpdateChannelSchema