Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 48198b7

Browse files
author
stas
committed
address PR comments
1 parent 8fba892 commit 48198b7

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

src/ApiService/ApiService/OneFuzzTypes/Model.cs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,18 +257,35 @@ public InstanceConfig(string instanceName) : this(
257257
{ }
258258

259259

260-
/// <summary>
261-
/// Check if instance config is valid
262-
/// </summary>
263-
/// <returns>true, [] if instance config is valid;
264-
/// otherwise false, with a list of errors</returns>
265-
public (bool, List<string>) CheckInstanceConfig()
260+
public List<Guid>? CheckAdmins(List<Guid>? value)
261+
{
262+
if (value is not null && value.Count == 0)
263+
{
264+
throw new ArgumentException("admins must be null or contain at least one UUID");
265+
}
266+
else
267+
{
268+
return value;
269+
}
270+
}
271+
272+
273+
//# At the moment, this only checks allowed_aad_tenants, however adding
274+
//# support for 3rd party JWT validation is anticipated in a future release.
275+
public ResultOk<List<string>> CheckInstanceConfig()
266276
{
267277
List<string> errors = new();
268278
if (AllowedAadTenants.Length == 0)
269279
{
270280
errors.Add("allowed_aad_tenants must not be empty");
271281
}
272-
return (errors.Count == 0, errors);
282+
if (errors.Count == 0)
283+
{
284+
return ResultOk<List<string>>.Ok();
285+
}
286+
else
287+
{
288+
return ResultOk<List<string>>.Error(errors);
289+
}
273290
}
274291
}

0 commit comments

Comments
 (0)