Introduction

Gordon Service is an ASP.NET WebAPI and therefore uses the .NET configuration framework. You therefore configure it basically by modifying the appsettings.json file that you find the root folder of the Gordon Service installation.

The following settings are currently supported:

  • URL / Port settings: These settings are the default settings for the .NET Kestrel WebServer and can be used to configure the port and address at which Gordon Service listens. You can find more details on the official documentation. By default, Gordon Service will listen at port 9462 on any address.

  • MaxClientSaturationLevel: Due to a memory leak introduced in BC24 with the use of PowerShell 7 modules, after a a while the powershell instance will run out of TCP connections and subsequent calls will fail. In order to mitigate this, a maximum saturation level has been introduced. This means that each BC-service connection can sustain this maximum number of powershell cmdlet calls. After that, the connection from Gordon Service to the BC service will be killed and re-established. This is only required for BC24.

  • ServiceClientMapPath: Gordon Service uses the target BC service to decide which PowerShell module to load. With the advent of BC24, now there is also support for PowerShell 7. This setting points to a configuration file that lets you configure which version of PowerShell is used for which version of BC. You will most probably never need to modify this.

  • ApiKeys: This allows you to configure which BC services are accessibly by which API key to Gordon. See the section below for more details.

API Keys

Gordon Service supports the use of API keys to limit and control the access uses have to business central services. This setting is found in the appsettings.json file unter the ApiKeys section.

You can specify one or more API keys in this section. If there is no API key specified, every service is accessible with or without an API key.

Each API key is defined like this:

{
	"Key": "<insert-your-key-here>",
	"Enabled": true,
	"EnabledServiceRegex": [
		"...",
		"..."
	]
}
  • Key: This is the API key that needs to be provided to the calls made to Gordon Service. You can insert whatever you like. Keep in mind that it needs to be a secure string
  • Enabled: Specifies whether the API key is active. An inactive API key is as if it would not exist. This is a boolean and can either be true or false.
  • EnabledServiceRegex: specifies a list of regex-expressions that determine if the API is valid for a given service. The use of this API key allows access to any BC service where the Service instance name matches at least one of the specified regex-expressions. If no expression matches, a HTTP 401 Unauthorized response will be generated. If this value is not specified or an empty array is specified, the API key is valid for any service.

EOS Labs -