feat(m0): complete scaffold, logging and signature checks (T0.2-T0.6)
Add os.Logger categories, OSSignposter wrapper and shortHash helper; enforce exact Debug/Release/install signatures; lint tests; update M0 docs and progress.
This commit is contained in:
1 parent
374085ec2f
commit
7ca5c710ec
17 files changed
+331
-9
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import CryptoKit
|
||||
import Foundation
|
||||
|
||||
/// Privacy-safe helpers for log values (SP-2).
|
||||
public enum LogRedaction {
|
||||
/// Returns the first 12 lowercase hex characters of the SHA-256 digest of `value`.
|
||||
///
|
||||
/// Use this for identifiers that must be correlatable across log lines without revealing
|
||||
/// the original text. Always log the result with `privacy: .private`; SECURITY_PRIVACY
|
||||
/// §Logging requires the private qualifier for correlation hashes as well.
|
||||
public static func shortHash(_ value: String) -> String {
|
||||
let digest = SHA256.hash(data: Data(value.utf8))
|
||||
return digest.prefix(6).map { String(format: "%02x", $0) }.joined()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user