Add AppSettings
capability
#13
Labels
Area: Web
Relates to the `AspNetCore` or other web-related functionality.
Priority: 3
Status 0: Discussion
Needs further evaluation of requirements and prioritization.
Type: Feature
Introduces a major area of functionality.
Create an OnTopic
AppSettings
configuration store that can be used to store global settings such as (non-secret) API keys or site-wide preferences.Current Approach
Today, customers store application settings in a variety of places:
config
files (such asweb.config
orappsettings.config
)secrets.json
files (in development) and Azure App Service Settings (in production)Topic
classes, if it's not a secret (see below)Startup
, if it's not a secretSome sites even use a combination of each of these.
Topic-Based Approach
Given the nature of OnTopic as a semi-structured data source, it makes sense for OnTopic sites to be configured via
Topic
s. Today, this is done on a perTopic
basic, typically as a subclass ofPage
. That's fine for one-off pages, such as a/Search
page storing an API key, but it's impractical for values that need to be shared across multiple pages, as configuration settings are only available in that context.Ideal Approach
Ideally, we'll instead approach this through something like the following:
ContentTypeDescriptor
:AppSettings
(LookupList
)TopicList
:Settings
ofAppSettingsItem
(LookupListItem
)AllowedContentTypes
:AppSettings
(thus allowing namespacing)Root:Configuration:AppSettings
as root storeTopicAppSettings
(IConfiguration
) class for storing, retrieving settingsTopicConfiguration
class for mappingTopicAppSettings
to a value object and passing it to e.g.AddTopicSupport()
.This way, any custom application setting can easily be added to OnTopic without needing to create a custom
ContentTypeDescriptor
, and those application settings can easily be namespaced in case a particular context (such as/Search
) has multiple settings.The text was updated successfully, but these errors were encountered: