1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-22 22:16:13 -04:00

New: Don't return API Keys and Passwords via the API

This commit is contained in:
Mark McDowall
2022-05-23 20:41:50 -07:00
parent b154b00c61
commit 570be88215
10 changed files with 51 additions and 29 deletions
@@ -48,7 +48,11 @@ namespace Sonarr.Api.V3.CustomFormats
private static ICustomFormatSpecification MapSpecification(CustomFormatSpecificationSchema resource, List<ICustomFormatSpecification> specifications)
{
var type = specifications.SingleOrDefault(x => x.GetType().Name == resource.Implementation).GetType();
var spec = (ICustomFormatSpecification)SchemaBuilder.ReadFromSchema(resource.Fields, type);
// Finding the exact current specification isn't possible given the dynamic nature of them and the possibility that multiple
// of the same type exist within the same format. Passing in null is safe as long as there never exists a specification that
// relies on additional privacy.
var spec = (ICustomFormatSpecification)SchemaBuilder.ReadFromSchema(resource.Fields, type, null);
spec.Name = resource.Name;
spec.Negate = resource.Negate;
spec.Required = resource.Required;