Skip to content

Commit 0481ddf

Browse files
committed
CR comments; matching K8S repo behavior
1 parent 910372d commit 0481ddf

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/WebJobs.Script.WebHost/Security/KeyManagement/ContainerAppsSecretsRepository.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public async Task<ScriptSecrets> ReadAsync(ScriptSecretsType type, string functi
4949
throw new ArgumentNullException(nameof(functionName), $"{nameof(functionName)} cannot be null or empty with {nameof(type)} = {nameof(ScriptSecretsType.Function)}");
5050
}
5151

52-
return type == ScriptSecretsType.Host ? await ReadHostSecretsAsync() : await ReadFunctionSecretsAsync(functionName?.ToLowerInvariant());
52+
return type == ScriptSecretsType.Host ? await ReadHostSecretsAsync() : await ReadFunctionSecretsAsync(functionName.ToLowerInvariant());
5353
}
5454

5555
public Task WriteAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets)
@@ -122,14 +122,23 @@ private async Task<IDictionary<string, string>> GetFromFilesAsync(string path)
122122
return secrets;
123123
}
124124

125-
public Task WriteSnapshotAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets)
126-
=> throw new NotImplementedException();
125+
/// <summary>
126+
/// no-op - allow stale secrets to remain.
127+
/// </summary>
128+
public async Task PurgeOldSecretsAsync(IList<string> currentFunctions, ILogger logger)
129+
=> await Task.Yield();
127130

128-
public Task PurgeOldSecretsAsync(IList<string> currentFunctions, ILogger logger)
129-
=> throw new NotImplementedException();
131+
/// <summary>
132+
/// Runtime is not responsible for encryption so this code will never be executed.
133+
/// </summary>
134+
public Task WriteSnapshotAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets)
135+
=> throw new NotSupportedException();
130136

137+
/// <summary>
138+
/// Runtime is not responsible for encryption so this code will never be executed.
139+
/// </summary>
131140
public Task<string[]> GetSecretSnapshots(ScriptSecretsType type, string functionName)
132-
=> throw new NotImplementedException();
141+
=> throw new NotSupportedException();
133142

134143
private static Key ParseKeyWithPrefix(string prefix, string key, string value)
135144
=> new(key.Substring(prefix.Length), value);

0 commit comments

Comments
 (0)