mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
Extend use of validated string types (#2357)
In the Python code there were more validated string types that haven't been properly ported for use in the C# code (such as Region). Add that type back in and improve some others: - Use `Region` type to represent regions (implicitly convertible to/from the `AzureLocation` SDK type) - Improve validation of `Container` type to match Azure specs and use it in more places - Restore/fix validation of `PoolName` type which was previously removed (#2080) due to being too strict: now allows 1-64 ASCII alphanumeric/hyphen/dash - We want to restrict pool names so that we can use them as disambiguating prefixes for scaleset names (see #2189). Note that underscore is not actually permitted in scaleset names so we will probably end up mapping it to hyphen. Note that once C#7 lands we will be able to simplify the usage of `ValidatedString` a lot (using static abstract methods). ---- Open questions: For deserializing from "known-good" places such as table storage or from Azure SDK APIs, should we have an `T.UnsafeAssumeValid(string input)` method which does no validation, to protect us from breakage?
This commit is contained in:
@ -72,7 +72,8 @@ public abstract class DownloadTestBase : FunctionTestBase {
|
||||
[Fact]
|
||||
public async Async.Task Download_RedirectsToResult_WithLocationHeader() {
|
||||
// set up a file to download
|
||||
var container = GetContainerClient("xxx");
|
||||
var containerName = Container.Parse("xxx");
|
||||
var container = GetContainerClient(containerName);
|
||||
await container.CreateAsync();
|
||||
await container.UploadBlobAsync("yyy", new BinaryData("content"));
|
||||
|
||||
|
Reference in New Issue
Block a user