Ionite
1 year ago
committed by
GitHub
11 changed files with 80 additions and 21 deletions
@ -1,16 +0,0 @@
|
||||
using System; |
||||
using System.Text.Json.Serialization; |
||||
|
||||
namespace StabilityMatrix.Models; |
||||
|
||||
public class UpdateInfo |
||||
{ |
||||
[JsonPropertyName("version")] |
||||
public Version Version { get; set; } |
||||
|
||||
[JsonPropertyName("url")] |
||||
public string DownloadUrl { get; set; } |
||||
|
||||
[JsonPropertyName("changelog")] |
||||
public string ChangelogUrl { get; set; } |
||||
} |
@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization; |
||||
using StabilityMatrix.Converters.Json; |
||||
|
||||
namespace StabilityMatrix.Updater; |
||||
|
||||
[JsonConverter(typeof(DefaultUnknownEnumConverter<UpdateChannel>))] |
||||
public enum UpdateChannel |
||||
{ |
||||
Unknown, |
||||
Stable, |
||||
Preview, |
||||
Development |
||||
} |
@ -0,0 +1,34 @@
|
||||
using System; |
||||
using System.Text.Json.Serialization; |
||||
|
||||
namespace StabilityMatrix.Updater; |
||||
|
||||
public record UpdateInfo( |
||||
[property: JsonPropertyName("version")] |
||||
Version Version, |
||||
|
||||
[property: JsonPropertyName("releaseDate")] |
||||
DateTimeOffset ReleaseDate, |
||||
|
||||
[property: JsonPropertyName("channel")] |
||||
UpdateChannel Channel, |
||||
|
||||
[property: JsonPropertyName("type")] |
||||
UpdateType Type, |
||||
|
||||
[property: JsonPropertyName("url")] |
||||
string DownloadUrl, |
||||
|
||||
[property: JsonPropertyName("changelog")] |
||||
string ChangelogUrl, |
||||
|
||||
// Blake3 hash of the file |
||||
[property: JsonPropertyName("hash_blake3")] |
||||
string HashBlake3, |
||||
|
||||
// ED25519 signature of the semicolon seperated string: |
||||
// "version + releaseDate + channel + type + url + changelog + hash_blake3" |
||||
// verifiable using our stored public key |
||||
[property: JsonPropertyName("signature")] |
||||
string Signature |
||||
); |
@ -0,0 +1,11 @@
|
||||
using System; |
||||
|
||||
namespace StabilityMatrix.Updater; |
||||
|
||||
[Flags] |
||||
public enum UpdateType |
||||
{ |
||||
Normal = 1 << 0, |
||||
Critical = 1 << 1, |
||||
Mandatory = 1 << 2, |
||||
} |
Loading…
Reference in new issue