-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
166 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// ServerPack.swift | ||
// feather | ||
// | ||
// Created by samara on 23.01.2025. | ||
// | ||
|
||
// we should prompt the user to download these when finishing the onboarding, and make the exact same way of downloading the files in the server options | ||
struct ServerPack: Decodable { | ||
var cert: String | ||
var ca: String | ||
var key: String | ||
var info: ServerPackInfo | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case cert, ca, key1, key2, info | ||
} | ||
|
||
init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
cert = try container.decode(String.self, forKey: .cert) | ||
ca = try container.decode(String.self, forKey: .ca) | ||
let key1 = try container.decode(String.self, forKey: .key1) | ||
let key2 = try container.decode(String.self, forKey: .key2) | ||
key = key1 + key2 | ||
info = try container.decode(ServerPackInfo.self, forKey: .info) | ||
} | ||
} | ||
|
||
struct ServerPackInfo: Decodable { | ||
var issuer: Issuer | ||
var domains: Domains | ||
} | ||
|
||
struct Issuer: Decodable { | ||
var commonName: String | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case commonName = "commonName" | ||
} | ||
} | ||
|
||
struct Domains: Decodable { | ||
var commonName: String | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case commonName = "commonName" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.