Data Staging API configuration
The appsettings-data.json
file contains the configuration for the Data Staging API. It contains the configuration for the database, logging, and other services. The file is located in the app directory of the HEAppE Middleware.
The file is in JSON format and contains the following configuration blocks:
ConnectionStrings
This configuration block contains the connection strings for the database and logging services. The connection strings are used to connect to the database and logging services. The connection strings are stored in the appsettings-data.json file and are used by the HEAppE Middleware DataStaging to connect to the database and logging services.
Following connection string can be used, but <mssql_password>
needs to be replaced the with the password. Password must meet the password policy of the Microsoft SQL Server.
"ConnectionStrings": {
"MiddlewareContext": "Server=mssql;Database=heappe;User=SA;Password=<mssql_password>;TrustServerCertificate=true;",
"Logging": ""
}
IpRateLimiting
- This configuration block contains the configuration for the IP rate limiting. The IP rate limiting is used to limit the number of requests that can be made to the Data Staging API from a single IP address. The configuration block contains the following settings:
EnableEndpointRateLimiting - Enable or disable the IP rate limiting.
StackBlockedRequests - Stack blocked requests.
RealIpHeader - The header that contains the real IP address of the client.
ClientIdHeader - The header that contains the client ID.
HttpStatusCode - The HTTP status code to return when the rate limit is exceeded.
EndpointWhitelist - A list of endpoints that are not subject to rate limiting.
ClientWhitelist - A list of client IP addresses that are not subject to rate limiting.
DisableRateLimitHeaders - Disable rate limit headers.
GeneralRules - A list of general rules that define the rate limit for specific endpoints.
"IpRateLimiting": {
"EnableEndpointRateLimiting": true,
"StackBlockedRequests": false,
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"HttpStatusCode": 429,
"EndpointWhitelist": [ "get:/swagger/*" ],
"ClientWhitelist": [ "127.0.0.1" ],
"DisableRateLimitHeaders": false,
"GeneralRules": [
{
"Endpoint": "*:/api/DataStaging/*",
"Period": "1h",
"Limit": 2000
}
]
}
IpRateLimitPolicies
- This configuration block contains the configuration for the IP rate limiting policies. The IP rate limiting policies are used to define the rate limit for specific IP addresses. The configuration block contains the following settings:
IpRules - A list of IP rules that define the rate limit for specific IP addresses.
Ip - The IP address.
Rules - A list of rules that define the rate limit for specific endpoints.
"IpRateLimitPolicies": {
"IpRules": [
{
"Ip": "127.0.0.1",
"Rules": [
{
"Endpoint": "*:/api/DataStaging/*",
"Period": "1h",
"Limit": 5000
}
]
}
]
}
ApplicationAPIConfiguration
- This configuration block contains the configuration for the Data Staging API. The configuration block contains the following settings:
AllowedHosts - A list of allowed hosts.
AuthenticationParamHeaderName - The header name for the authentication token.
AuthenticationToken - The authentication token.
DeploymentConfiguration - The deployment configuration.
Name - The name of the deployment.
Description - The description of the deployment.
Version - The version of the deployment.
DeployedIPAddress - The IP address of the deployment.
SwaggerConfiguration - The Swagger configuration.
Version - The version of the Swagger configuration.
Title - The title of the Swagger configuration.
Description - The description of the Swagger configuration.
Host - The host of the Swagger configuration.
HostPostfix - The host postfix of the Swagger configuration.
PrefixDocPath - The prefix doc path of the Swagger configuration.
TermOfUsageUrl - The term of usage URL of the Swagger configuration.
License - The license of the Swagger configuration.
LicenseUrl - The license URL of the Swagger configuration.
ContactName - The contact name of the Swagger configuration.
ContactEmail - The contact email of the Swagger configuration.
ContactUrl - The contact URL of the Swagger configuration.
"ApplicationAPIConfiguration": {
"AllowedHosts": [ "http://localhost:5001" ],
"AuthenticationParamHeaderName": "AuthKey",
"AuthenticationToken": "<TOKEN>",
"DeploymentConfiguration": {
"Name": "Local instance",
"Description": "Local testing instance",
"Version": "v4.2.0",
"DeployedIPAddress": "127.0.0.1"
},
"SwaggerConfiguration": {
"Version": "v1.0.0",
"Title": "Data-Staging API",
"Description": "Data-Staging API",
"Host": "http://localhost:5001",
"HostPostfix": "",
"PrefixDocPath": "swagger",
"TermOfUsageUrl": "https://twitter.com/it4innovations",
"License": "GNU General Public License v3.0",
"LicenseUrl": "https://www.gnu.org/licenses/gpl-3.0.html",
"ContactName": "IT4Innovations",
"ContactEmail": "support.heappe@it4i.cz",
"ContactUrl": "https://twitter.com/it4innovations"
}
}