public IEnumerable <ConfigSecret> GetSecrets(ConfigDocument confDoc) { foreach (var secret in confDoc.GetSecrets()) { yield return(new ConfigSecret { FieldPath = secret.Path, SecretKey = secret.Key, Resolved = _resolvedKeys.Contains(secret.Key) }); } }
public static void ApplySecrets(this ConfigDocument doc, ISecretsProvider secretsProvider) { if (doc == null) { throw new ArgumentNullException(nameof(doc)); } if (secretsProvider == null) { throw new ArgumentNullException(nameof(secretsProvider)); } var secretMap = secretsProvider.Provide(); foreach (var secret in doc.GetSecrets()) { if (secretMap.TryGetValue(secret.Key, out var secretVal)) { secret.Resolve(secretVal); } } }