Revert "BUG-410 -- update RIFT platform"
[osm/UI.git] / skyquake / framework / core / api_utils / constants.js
1 /*
2 *
3 * Copyright 2016 RIFT.IO Inc
4 *
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
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
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.
16 *
17 */
18
19 /**
20 * constants module. Provides constants for use within the skyquake instance
21 * @module api_utils/constants
22 */
23
24 var constants = {};
25
26 constants.FOREVER_ON = true;
27 constants.HTTP_HEADERS = {
28 accept: {
29 data: {
30 'Accept': 'application/vnd.yang.data+json'
31 },
32 collection: {
33 'Accept': 'application/vnd.yang.collection+json'
34 }
35 },
36 content_type: {
37 data: {
38 'Content-Type': 'application/vnd.yang.data+json'
39 },
40 collection: {
41 'Content-Type': 'application/vnd.yang.collection+json'
42 }
43 }
44 };
45
46 // (Incomplete) set of expected HTTP response codes
47 constants.HTTP_RESPONSE_CODES = {
48 SUCCESS: {
49 OK: 200,
50 CREATED: 201,
51 ACCEPTED: 202,
52 NO_CONTENT: 204,
53 MOVED_PERMANENTLY: 301,
54 NOT_MODIFIED: 304
55 },
56 ERROR: {
57 BAD_REQUEST: 400,
58 UNAUTHORIZED: 401,
59 FORBIDDEN: 403,
60 NOT_FOUND: 404,
61 METHOD_NOT_ALLOWED: 405,
62 NOT_ACCEPTABLE: 406,
63 CONFLICT: 409,
64 INTERNAL_SERVER_ERROR: 500,
65 NOT_IMPLEMENTED: 501,
66 BAD_GATEWAY: 502,
67 SERVICE_UNAVAILABLE: 504,
68 HTTP_VERSION_UNSUPPORTED: 505
69
70 }
71 }
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;
77
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
82
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';
92
93 module.exports = constants;