Middleware Configuration

Overview

The N2PTF API is configured in through the API Jarvis configuration file:

File or Directory Description
/etc/jarvis/n2ptf.xml This is the main configuration file for N2PTF’s API middleware layer. It governs access and permissions as well as how N2PTF connects to various N2SVCD environments.

For a general breakdown of the n2ptf.xml file, see the Jarvis Configuration Guide.

The following sections are specific configuration for the N2PTF Middleware layer.

Environments

N2PTF supports multiple backend N2SVCD environments. These may consist of Production, Pre-Production, Test, Dev or any other logical separation as required.

Each environment defines the required properties for the N2PTF Middleware layer to connect to a remote N2SVCD instance. Environments can be queried via a provided REST endpoint and are automatically parsed and utilized/suggested by both the IDE extension and CI/CD tooling.

The <environments> configuration is part of the generic Jarvis <config> block and can define one to many <environment> records.

The following example defines two environments; one Production endpoint which is secured and protected from general access and one Developer endpoint which is open to anyone with login permission to N2PTF.

 <config>
	<environments>
		<!-- Production Environment - Restricted to users with n2ptf-production group only. -->
		<environment
			name="production"
			description="Production Service Node." 
			host="n2ptf-production"
			port="9010"
			method="https"
			group_list="n2ptf-production"
		/>
	
         <!-- Dev Environment. -->
         <environment 
			name="dev" 
			description="Development Service Node." 
			host="n2ptf-dev" 
			port="9010"
			method="http"
		/>
	</environments>
</config>

Each <environment> supports the following configuration:

Option Type Default Description
name String [Required] The name mapping or ID of the environment that will be used when selecting the execution environment to use when setting the environment API argument against the Middleware API.
host String [Required] The hostname of the remote N2SVCD node.
port Integer 9010 The port of the RestTestApp on the remote N2SVCD node.
method http https http
description String None Description to associate with the environment. This is useful when querying the environments provided by the Middleware API for display in CI/CD tools, an IDE extension or other API consumer.
group_list String None A comma delimited string of groups that may utilize the endpoint for executing tests. If no groups list is specified then no group checking is performed for users accessing the N2PTF API.
self_signed_cert String None Path to self signed CA file.
For deployments that utilize self signed certificates for HTTPS these often result in connections being terminated due to unknown CA’s.
This may be overcome by trusting the CA that has signed the HTTPS certificate. If provided the associated file will be loaded and trusted when performing User Agent requests against the remote N2SVCD instance.
Note: The associated path must be to a file. The file must be readable by Jarvis and contain a valid CA file.
ssl_opts String None If provided a | delimited string of key=value pairs of additional SSL options to set when performing User Agent requests against the remote N2SVCD instance.