minor improvements
This commit is contained in:
parent
a0b834a505
commit
0dc0267dbd
12 changed files with 327 additions and 108 deletions
|
|
@ -2,38 +2,40 @@
|
|||
// DocsView.swift
|
||||
// Splits
|
||||
//
|
||||
// Created by Isaac Greene on 6/3/22.
|
||||
// Created by Isaac Greene on 2022-06-03.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import LocalAuthentication
|
||||
import CryptoKit
|
||||
|
||||
/// The system username SHA256 hash for the app
|
||||
/// - Note: This is not a secure way to do it
|
||||
/// or in any way good practice
|
||||
/// but this is mainly to test out `SecureField`
|
||||
/// The system username SHA512 hash for the app
|
||||
let username = "c7ad44cbad762a5da0a452f9e854fdc1e0e7a52a38015f23f3eab1d80b931dd472634dfac71cd34ebc35d16ab7fb8a90c81f975113d6c7538dc69dd8de9077ec".utf8
|
||||
|
||||
/// The system password associated with ``username``
|
||||
///
|
||||
/// I'm thinking about hashing them, but that would take work.
|
||||
///
|
||||
/// It would be more secure though.
|
||||
/// - Note: Just as with `username` you should not define
|
||||
/// these unencrypted like they are right now.
|
||||
/// The system password SHA512 hash associated with ``username``
|
||||
let password = "3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2".utf8
|
||||
|
||||
/// Holds the views and login for the Docs tab in-app
|
||||
/// Holds the views and login for the Docs
|
||||
///
|
||||
/// Mostly just a long list of sections and calling views
|
||||
/// - Note: New views are best called in this `struct`
|
||||
/// and added to their respective categories
|
||||
struct DocsView: View {
|
||||
enum Field: Hashable {
|
||||
case username
|
||||
case password
|
||||
}
|
||||
|
||||
/// Makes a SHA512 hash of any `String` passed as input
|
||||
///
|
||||
/// Specifically, this function is suited towards checking if
|
||||
/// the username and password provided by the user
|
||||
/// match the hashes of the correct ``username`` and ``password``
|
||||
///
|
||||
/// - Note: The results of this hash are not seen by the user, so they shouldn't even know
|
||||
/// this is taking place
|
||||
///
|
||||
/// - Returns: A `String` of the computed SHA512 hash
|
||||
func hashSHA512(login: String) -> String {
|
||||
let loginAsData = Data(login.utf8)
|
||||
let loginHashHex = SHA512.hash(data: loginAsData)
|
||||
|
|
@ -51,6 +53,7 @@ struct DocsView: View {
|
|||
List {
|
||||
NavigationLink("Help", destination: HelpView())
|
||||
NavigationLink("Change Log", destination: ChangeLog())
|
||||
NavigationLink("Software Licenses", destination: LicenseView())
|
||||
|
||||
Section(header: Text("Features")) {
|
||||
NavigationLink("New", destination: NewFeatures())
|
||||
|
|
@ -64,9 +67,8 @@ struct DocsView: View {
|
|||
NavigationLink("Low Priority", destination: LowPriority())
|
||||
}
|
||||
Section(header: Text("App Information")) {
|
||||
NavigationLink("Software License", destination: LicenseView())
|
||||
Text("Version: Prerelease Build LVSXT10a.4")
|
||||
Text("Release date: 2022-07-06")
|
||||
Text("Version: 1.0.0")
|
||||
Text("Release date: 2022-07-19")
|
||||
Text("Start date: 2022-03-25")
|
||||
Link("Built with SwiftUI \(Image(systemName: "swift"))", destination: URL(string: "https://developer.apple.com/xcode/swiftui")!)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue