3 * Copyright 2016 RIFT.IO Inc
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 * constants module. Provides constants for use within the skyquake instance
21 * @module api_utils/constants
26 constants
.FOREVER_ON
= true;
27 constants
.HTTP_HEADERS
= {
30 'Accept': 'application/vnd.yang.data+json'
33 'Accept': 'application/vnd.yang.collection+json'
38 'Content-Type': 'application/vnd.yang.data+json'
41 'Content-Type': 'application/vnd.yang.collection+json'
46 // (Incomplete) set of expected HTTP response codes
47 constants
.HTTP_RESPONSE_CODES
= {
53 MOVED_PERMANENTLY
: 301,
61 METHOD_NOT_ALLOWED
: 405,
64 INTERNAL_SERVER_ERROR
: 500,
67 SERVICE_UNAVAILABLE
: 504,
68 HTTP_VERSION_UNSUPPORTED
: 505
72 constants
.SOCKET_BASE_PORT
= 3500;
73 constants
.SOCKET_POOL_LENGTH
= 20;
74 constants
.SERVER_PORT
= process
.env
.SERVER_PORT
|| 8000;
75 constants
.SECURE_SERVER_PORT
= process
.env
.SECURE_SERVER_PORT
|| 8443;
76 constants
.REJECT_UNAUTHORIZED
= false;
78 constants
.BASE_PACKAGE_UPLOAD_DESTINATION
= 'upload';
79 constants
.PACKAGE_MANAGER_SERVER_PORT
= 4567;
80 constants
.PACKAGE_FILE_DELETE_DELAY_MILLISECONDS
= 3 * 1000 * 60; //5 minutes
81 constants
.PACKAGE_FILE_ONBOARD_TRANSACTION_STATUS_CHECK_DELAY_MILLISECONDS
= 2 * 1000; //2 seconds
83 constants
.REFRESH_WINDOW
= 10; //Time in seconds to perform a token refresh before it expires
84 constants
.LAUNCHPAD_ADDRESS
= 'localhost';
85 constants
.LAUNCHPAD_PORT
= 8008;
86 constants
.IDP_SERVER_PROTOCOL
= 'https';
87 constants
.IDP_PORT_NUMBER
= 8009;
88 constants
.CALLBACK_SERVER_PROTOCOL
= 'https';
89 constants
.CALLBACK_PORT_NUMBER
= 8443;
90 constants
.CALLBACK_ADDRESS
= 'localhost';
91 constants
.END_SESSION_PATH
= 'end_session';
93 module
.exports
= constants
;