Skip to content

Commit

Permalink
Update appsettings schema with common .NET configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Dec 14, 2020
1 parent 1419cc3 commit 7d6b98e
Showing 1 changed file with 307 additions and 13 deletions.
320 changes: 307 additions & 13 deletions src/schemas/json/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"title": "JSON schema ASP.NET Core's appsettings.json file",
"$schema": "http://json-schema.org/draft-04/schema#",

"type": "object",

"definitions": {
"webOptimizer": {
"type": "object",
"description": "Settings for WebOptimizer.Core",

"properties": {
"enableCaching": {
"description": "Determines if the \"cache-control\" HTTP headers should be set and if conditional GET (304) requests should be supported. This could be helpful to disable while in development mode.",
Expand All @@ -24,7 +21,6 @@
"cdn": {
"type": "object",
"description": "Definitions for WebEssentials.AspNetCore.CdnTagHelpers",

"properties": {
"url": {
"description": "An absolute URL used as a prefix for static resources",
Expand Down Expand Up @@ -67,7 +63,12 @@
},
"strategy": {
"description": "Selects one of the predefined service worker types.",
"enum": [ "cacheFirst", "cacheFirstSafe", "minimal", "networkFirst" ],
"enum": [
"cacheFirst",
"cacheFirstSafe",
"minimal",
"networkFirst"
],
"default": "cacheFirstSafe"
}
}
Expand All @@ -90,16 +91,309 @@
"pattern": "^[0-9a-f]{32}$"
}
},
"required": ["ApiKey", "LogId"]
"required": [
"ApiKey",
"LogId"
]
},
"protocols": {
"description": "The protocols enabled on the endpoint.",
"type": "string",
"enum": [
"None",
"Http1",
"Http2",
"Http1AndHttp2",
"Http3",
"Http1AndHttp2AndHttp3"
]
},
"certificate": {
"description": "Certificate configuration.",
"type": "object",
"properties": {
"Path": {
"description": "The certificate file path. If a file path is specified then the certificate will be loaded from the file system.",
"type": "string"
},
"KeyPath": {
"description": "The certificate key file path. Available in .NET 5 and later.",
"type": "string"
},
"Password": {
"description": "The certificate password used to access the private key.",
"type": "string"
},
"Subject": {
"description": "The certificate subject. If a subject is specified then the certificate will be loaded from the certificate store.",
"type": "string"
},
"Store": {
"description": "The certificate store name. Defaults to 'My'.",
"type": "string",
"default": "My"
},
"Location": {
"description": "The certificate store location. Defaults to 'CurrentUser'.",
"type": "string",
"enum": [
"LocalMachine",
"CurrentUser"
],
"default": "CurrentUser"
},
"AllowInvalid": {
"description": "A value indicating whether or not to load certificates that are considered invalid. Defaults to false.",
"type": "boolean",
"default": false
}
}
},
"sslProtocols": {
"description": "Specifies allowable SSL protocols. Defaults to 'None' which allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this default. Available in .NET 5 and later.",
"type": "array",
"items": {
"type": "string",
"enum": [
"None",
"Tls",
"Tls11",
"Tls12",
"Tls13"
],
"default": "None"
}
},
"clientCertificateMode": {
"description": "Specifies the client certificate requirements for a HTTPS connection. Defaults to 'NoCertificate'. Available in .NET 5 and later.",
"type": "string",
"enum": [
"NoCertificate",
"AllowCertificate",
"RequireCertificate"
],
"default": "NoCertificate"
},
"kestrel": {
"type": "object",
"description": "ASP.NET Core Kestrel server configuration.",
"properties": {
"Endpoints": {
"description": "Endpoints that Kestrel listens to for network requests. Each endpoint has a name specified by its JSON property name.",
"type": "object",
"additionalProperties": {
"description": "Kestrel endpoint configuration.",
"type": "object",
"properties": {
"Url": {
"description": "The scheme, host name, and port the endpoint will listen on. A Url is required.",
"type": "string",
"format": "uri"
},
"Protocols": {
"$ref": "#/definitions/protocols"
},
"SslProtocols": {
"$ref": "#/definitions/sslProtocols"
},
"Certificate": {
"$ref": "#/definitions/certificate"
},
"ClientCertificateMode": {
"$ref": "#/definitions/clientCertificateMode"
},
"Sni": {
"description": "Server Name Indication (SNI) configuration. This enables the mapping of client requested host names to certificates and other TLS settings. Wildcard names prefixed with '*.', as well as a top level '*' are supported. Available in .NET 5 and later.",
"type": "object",
"additionalProperties": {
"description": "Endpoint SNI configuration.",
"type": "object",
"properties": {
"Protocols": {
"$ref": "#/definitions/protocols"
},
"SslProtocols": {
"$ref": "#/definitions/sslProtocols"
},
"Certificate": {
"$ref": "#/definitions/certificate"
},
"ClientCertificateMode": {
"$ref": "#/definitions/clientCertificateMode"
}
}
}
}
},
"required": [
"Url"
]
}
},
"EndpointDefaults": {
"description": "Default configuration applied to all endpoints. Named endpoint specific configuration overrides defaults.",
"type": "object",
"properties": {
"Protocols": {
"$ref": "#/definitions/protocols"
},
"SslProtocols": {
"$ref": "#/definitions/sslProtocols"
},
"ClientCertificateMode": {
"$ref": "#/definitions/clientCertificateMode"
}
}
},
"Certificates": {
"description": "Certificates that Kestrel uses with HTTPS endpoints. Each certificate has a name specified by its JSON property name. The 'Default' certificate is used by HTTPS endpoints that haven't specified a certificate.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/certificate"
}
}
}
},
"logLevelThreshold": {
"description": "Log level threshold.",
"type": "string",
"enum": [
"Trace",
"Debug",
"Information",
"Warning",
"Error",
"Critical",
"None"
]
},
"logLevel": {
"description": "Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/logLevelThreshold"
}
},
"logging": {
"type": "object",
"description": "Configuration for Microsoft.Extensions.Logging.",
"properties": {
"LogLevel": {
"$ref": "#/definitions/logLevel"
},
"Console": {
"properties": {
"LogLevel": {
"$ref": "#/definitions/logLevel"
},
"FormatterName": {
"description": "Name of the log message formatter to use. Defaults to 'simple'.",
"type": "string",
"default": "simple"
},
"FormatterOptions": {
"description": "Options for the console formatter. The formatter is selected by FormatterName. Additional properties are available depending on the selected formatter.",
"type": "object",
"properties": {
"IncludeScopes": {
"description": "Include scopes when true. Defaults to false.",
"type": "boolean",
"default": false
},
"TimestampFormat": {
"description": "Format string used to format timestamp in logging messages. Defaults to null.",
"type": "string"
},
"UseUtcTimestamp": {
"description": "Indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.",
"type": "boolean",
"default": false
}
}
},
"LogToStandardErrorThreshold": {
"description": "The minimum level of messages are written to Console.Error.",
"$ref": "#/definitions/logLevelThreshold"
}
}
},
"EventSource": {
"properties": {
"LogLevel": {
"$ref": "#/definitions/logLevel"
}
}
},
"Debug": {
"properties": {
"LogLevel": {
"$ref": "#/definitions/logLevel"
}
}
},
"EventLog": {
"properties": {
"LogLevel": {
"$ref": "#/definitions/logLevel"
}
}
}
},
"additionalProperties": {
"type": "object",
"description": "Logging configuration for a provider. The provider name must match the configuration's JSON property property name.",
"properties": {
"LogLevel": {
"$ref": "#/definitions/logLevel"
}
}
}
},
"allowedHosts": {
"description": "ASP.NET Core host filtering middleware configuration. Allowed hosts is a semicolon-delimited list of host names without port numbers. Requests without a matching host name will be refused. Host names may be prefixed with a '*.' wildcard, or use '*' to allow all hosts.",
"type": "string"
},
"connectionStrings": {
"description": "Connection string configuration. Get connection strings with the IConfiguration.GetConnectionString(string) extension method.",
"type": "object",
"additionalProperties": {
"description": "Connection string configuration. Each connection string has a name specified by its JSON property name.",
"type": "string"
}
}
},
"properties": {
"Kestrel": {
"$ref": "#/definitions/kestrel"
},
"Logging": {
"$ref": "#/definitions/logging"
},
"AllowedHosts": {
"$ref": "#/definitions/allowedHosts"
},
"ConnectionStrings": {
"$ref": "#/definitions/connectionStrings"
}
},

"patternProperties": {
"^WebOptimizer$": { "$ref": "#/definitions/webOptimizer" },
"^webOptimizer$": { "$ref": "#/definitions/webOptimizer" },
"^weboptimizer$": { "$ref": "#/definitions/webOptimizer" },
"^(cdn|Cdn)$": { "$ref": "#/definitions/cdn" },
"^(pwa|PWA|Pwa)$": { "$ref": "#/definitions/pwa" },
"^(ElmahIo|Elmahio|elmahIo|elmahio)$": { "$ref": "#/definitions/ElmahIo" }
"^WebOptimizer$": {
"$ref": "#/definitions/webOptimizer"
},
"^webOptimizer$": {
"$ref": "#/definitions/webOptimizer"
},
"^weboptimizer$": {
"$ref": "#/definitions/webOptimizer"
},
"^(cdn|Cdn)$": {
"$ref": "#/definitions/cdn"
},
"^(pwa|PWA|Pwa)$": {
"$ref": "#/definitions/pwa"
},
"^(ElmahIo|Elmahio|elmahIo|elmahio)$": {
"$ref": "#/definitions/ElmahIo"
}
}
}

0 comments on commit 7d6b98e

Please sign in to comment.