mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 12:06:58 +01:00
Add SecretKey.swift.gyb to Secrets module.
This commit is contained in:
parent
6c9f9e2889
commit
7d40924509
@ -16,6 +16,7 @@ let package = Package(
|
||||
.target(
|
||||
name: "Secrets",
|
||||
dependencies: [],
|
||||
exclude: ["SecretKey.swift.gyb"],
|
||||
swiftSettings: [
|
||||
.enableExperimentalFeature("StrictConcurrency")
|
||||
]
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Generated by Secrets.swift.gyb
|
||||
// Generated by SecretKey.swift.gyb
|
||||
%{
|
||||
import os
|
||||
|
||||
@ -19,12 +19,12 @@ def snake_to_camel(snake_str):
|
||||
|
||||
salt = [byte for byte in os.urandom(64)]
|
||||
}%
|
||||
import Secrets
|
||||
import Foundation
|
||||
|
||||
public final class Secrets: SecretsProvider, Sendable {
|
||||
public struct SecretKey {
|
||||
% for secret in secrets:
|
||||
|
||||
public let ${snake_to_camel(secret)}: String = {
|
||||
public static let ${snake_to_camel(secret)}: String = {
|
||||
let encoded: [UInt8] = [
|
||||
% for chunk in chunks(encode(os.environ.get(secret) or "", salt), 8):
|
||||
${"".join(["0x%02x, " % byte for byte in chunk])}
|
Loading…
x
Reference in New Issue
Block a user