diff --git a/Sources/Ingestion/Models/AuthInput.swift b/Sources/Ingestion/Models/AuthInput.swift index 761af7d5..e05104c7 100644 --- a/Sources/Ingestion/Models/AuthInput.swift +++ b/Sources/Ingestion/Models/AuthInput.swift @@ -13,6 +13,7 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable { case authAPIKey(AuthAPIKey) case authAlgolia(AuthAlgolia) case authAlgoliaInsights(AuthAlgoliaInsights) + case dictionaryOfStringToString([String: String]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() @@ -29,6 +30,8 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable { try container.encode(value) case let .authAlgoliaInsights(value): try container.encode(value) + case let .dictionaryOfStringToString(value): + try container.encode(value) } } @@ -46,6 +49,8 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable { self = .authAlgolia(value) } else if let value = try? container.decode(AuthAlgoliaInsights.self) { self = .authAlgoliaInsights(value) + } else if let value = try? container.decode([String: String].self) { + self = .dictionaryOfStringToString(value) } else { throw DecodingError.typeMismatch( Self.Type.self, @@ -68,6 +73,8 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable { value as AuthAlgolia case let .authAlgoliaInsights(value): value as AuthAlgoliaInsights + case let .dictionaryOfStringToString(value): + value as [String: String] } } } diff --git a/Sources/Ingestion/Models/AuthenticationType.swift b/Sources/Ingestion/Models/AuthenticationType.swift index 7a014fe8..ef3353f6 100644 --- a/Sources/Ingestion/Models/AuthenticationType.swift +++ b/Sources/Ingestion/Models/AuthenticationType.swift @@ -14,6 +14,7 @@ public enum AuthenticationType: String, Codable, CaseIterable { case oauth case algolia case algoliaInsights + case secrets } extension AuthenticationType: Hashable {}