-
Notifications
You must be signed in to change notification settings - Fork 0
API Test Configuration
Robert Polak edited this page Jul 30, 2019
·
19 revisions
Home / API Test / Configuration
The Server API Test Solution need contain libraries references listed as below:
test\API.Test\packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EnyimMemcached" version="2.16.0" targetFramework="net472" />
<package id="FluentValidation" version="8.4.0" targetFramework="net472" />
<package id="HtmlAgilityPack" version="1.11.7" targetFramework="net472" />
<package id="log4net" version="2.0.8" targetFramework="net472" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net472" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net472" />
<package id="System.ComponentModel.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>
Each Deployment environment have specific test\API.Test\Web.config
file:
-
test\API.Test\Web.config
- Development environment (Debug) -
test\API.Test\Web.Live.config
- Production environment (Live) -
test\API.Test\Web.Test.config
- Test environment (Test) -
test\API.Test\Web.UATconfig
- UAT environment (UAT)
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<!-- executionTimeout (Seconds), maxRequestLength (KB) = APP_PX_MAX_SIZE_BYTE + 1MB -->
<httpRuntime executionTimeout="3600" maxRequestLength="11264" targetFramework="4.7.2" />
</system.web>
...
</configuration>
<configuration>
...
<system.webServer>
<security>
<requestFiltering>
<!-- maxAllowedContentLength (B) APP_PX_MAX_SIZE_BYTE + 1MB -->
<requestLimits maxAllowedContentLength="11534336" />
</requestFiltering>
</security>
<handlers>
<!-- Add the handler to instruct IIS to serve the JSON RPC webservice requests -->
<add verb="POST,GET" path="api.jsonrpc" name="API" type="API.JSONRPC" />
</handlers>
...
</system.webServer>
...
</configuration>
<configuration>
...
<system.webServer>
<httpProtocol>
<customHeaders>
<!-- Local CORS -->
<add name="Access-Control-Allow-Origin" value="http://localhost" />
<add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
<add name="Access-Control-Allow-Credentials" value="true" />
</customHeaders>
</httpProtocol>
<rewrite>
<outboundRules>
<!-- Private CORS - Default -->
<rule name="Access-Control-Allow-Origin" enabled="true" patternSyntax="Wildcard">
<match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern="*" />
<conditions trackAllCaptures="false"></conditions>
<action type="Rewrite" value="{HTTP_ORIGIN}" />
</rule>
<!-- Private CORS - DNS filter -->
<!--
<rule name="WWW-Authenticate" enabled="true" patternSyntax="Wildcard">
<match serverVariable="RESPONSE_WWW-Authenticate" pattern="*" />
<conditions>
<add input="{HTTP_ORIGIN}" pattern="https://domain" negate="true" />
</conditions>
<action type="Rewrite" value="Anonymous" />
</rule>
-->
<!-- Private CORS - IP filter -->
<!--
<rule name="WWW-Authenticate" enabled="true" patternSyntax="Wildcard">
<match serverVariable="RESPONSE_WWW-Authenticate" pattern="*" />
<conditions>
<add input="{REMOTE_ADDR}" pattern="x.y.z.j" negate="true" />
</conditions>
<action type="Rewrite" value="Anonymous" />
</rule>
-->
</outboundRules>
</rewrite>
</system.webServer>
...
</configuration>
More details about API Library JSONRPC at API Library JSONRPC
<configuration>
...
<appSettings>
<!-- JSONRPC - Success response (case sensitive) -->
<add key="API_JSONRPC_SUCCESS" value="success" />
<!-- JSONRPC - Windows Authentication [ANONYMOUS, WINDOWS, ANY] -->
<add key="API_JSONRPC_AUTHENTICATION_TYPE" value="ANY" />
</appSettings>
...
</configuration>
More details about API Library Active Directory at API Library Active Directory
<configuration>
...
<appSettings>
<!-- Active Directory - Domain -->
<add key="API_AD_DOMAIN" value="CSOCORK" />
<!-- Active Directory - Path -->
<add key="API_AD_PATH" value="" />
<!-- Active Directory - Username -->
<add key="API_AD_USERNAME" value="" />
<!-- Active Directory - Password -->
<add key="API_AD_PASSWORD" value="" />
<!-- Active Directory - Attribute for Username -->
<add key="API_AD_ATTRIBUTE_USERNAME" value="cn" />
<!-- Active Directory - Attribute for Email -->
<add key="API_AD_ATTRIBUTE_EMAIL" value="mail" />
<!-- Active Directory - Attribute for First Name -->
<add key="API_AD_ATTRIBUTE_FIRSTNAME" value="givenName" />
<!-- Active Directory - Attribute for Last Name -->
<add key="API_AD_ATTRIBUTE_LASTNAME" value="sn" />
</appSettings>
...
</configuration>
More details about API Library ReCAPTCHA at API Library ReCAPTCHA
<configuration>
...
<appSettings>
<!-- ReCAPTCHA - Switch on [TRUE] or off [FALSE] the ReCaptcha -->
<add key="API_RECAPTCHA_ENABLED" value="FALSE" />
<!-- ReCAPTCHA - URL -->
<add key="API_RECAPTCHA_URL" value="https://www.google.com/recaptcha/api/siteverify?secret={0}&response={1}" />
<!-- ReCAPTCHA - Private Key -->
<add key="API_RECAPTCHA_PRIVATE_KEY" value="" />
</appSettings>
...
</configuration>
More details about API Library eMail at API Library eMail
<configuration>
...
<appSettings>
<!-- EMAIL - MAIL - Sender (it covers From and ReplyTo as well) -->
<add key="API_EMAIL_MAIL_SENDER" value="" />
<!-- EMAIL - SMTP - Server IP address -->
<add key="API_EMAIL_SMTP_SERVER" value="" />
<!-- EMAIL - SMTP - Port number -->
<add key="API_EMAIL_SMTP_PORT" value="" />
<!-- EMAIL - SMTP - Switch on [TRUE] or off [FALSE] the authentication -->
<add key="API_EMAIL_SMTP_AUTHENTICATION" value="FALSE" />
<!-- EMAIL - SMTP - Set the Username if authentication is required -->
<add key="API_EMAIL_SMTP_USERNAME" value="" />
<!-- EMAIL - SMTP - Set the Password if authentication is required -->
<add key="API_EMAIL_SMTP_PASSWORD" value="" />
<!-- EMAIL - SMTP - Switch on [TRUE] or off [FALSE] the SSL -->
<add key="API_EMAIL_SMTP_SSL" value="FALSE" />
<!-- EMAIL - TEMPLATE - Title -->
<add key="API_EMAIL_TEMPLATE_TITLE" value="PxStat" />
<!-- EMAIL - TEMPLATE - Sub Title -->
<add key="API_EMAIL_TEMPLATE_SUBTITLE" value="localhost/data.cso.ie" />
<!-- EMAIL - TEMPLATE - Website Name -->
<add key="API_EMAIL_TEMPLATE_WEBSITE_NAME" value="CSO.ie" />
<!-- EMAIL - TEMPLATE - Website URL -->
<add key="API_EMAIL_TEMPLATE_WEBSITE_URL" value="https://www.cso.ie" />
</appSettings>
...
</configuration>
More details about API Library ADO at API Library ADO
<configuration>
...
<appSettings>
<!-- ADO - Default Connection Name -->
<add key="API_ADO_DEFAULT_CONNECTION" value="defaultConnection" />
<!-- ADO - Execution timeout in seconds -->
<add key="API_ADO_EXECUTION_TIMEOUT" value="600" />
<!-- ADO - Bulk Copy timeout in seconds -->
<add key="API_ADO_BULKCOPY_TIMEOUT" value="600" />
<!-- ADO - Bulk Copy BatchSize in number of rows (below 5000) -->
<add key="API_ADO_BULKCOPY_BATCHSIZE" value="4999" />
</appSettings>
...
</configuration>
More details about API Library MemCacheD at API Library MemCacheD
<configuration>
...
<appSettings>
<!-- MemCacheD - Switch on [TRUE] or off [FALSE] the MemCacheD -->
<add key="API_MEMCACHED_ENABLED" value="TRUE" />
<!-- MemCacheD - Maximum validity in number of seconds that MemCacheD can handle (30 days = 2592000) -->
<add key="API_MEMCACHED_MAX_VALIDITY" value="2592000" />
<!-- MemCacheD - Salsa code to isolate the cache records form other applications or environments -->
<add key="API_MEMCACHED_SALSA" value="test-incubator.cso.ie/ws.cso.ie/td10" />
</appSettings>
...
</configuration>
<configuration>
...
<connectionStrings>
<add name="defaultConnection" connectionString="Server=X.X.X.XX;Initial Catalog=pxstat.XX;User ID=XXX;Password=XXX;Persist Security Info=False;Column Encryption Setting=enabled;" />
<add name="msdbConnection" connectionString="Server=X.X.X.XX;Initial Catalog=msdb;User ID=XXX;Password=XXX;Persist Security Info=False;Column Encryption Setting=enabled;" />
</connectionStrings>
...
</configuration>
More details about API Library MemCacheD at API Library MemCacheD
<configuration>
...
<enyim.com>
<memcached protocol="Binary">
<servers>
<!-- N.B. Make sure you use the same ordering of nodes in every configuration you have -->
<add address="X.X.X.XX" port="XXXXX" />
</servers>
<socketPool minPoolSize="10" maxPoolSize="20" connectionTimeout="00:00:10" deadTimeout="00:00:10" />
</memcached>
</enyim.com>
...
</configuration>