All files / universal.klown/gpii/node_modules/gpii-oauth2/gpii-oauth2-utilities/src OAuth2Const.js

100% Statements 6/6
100% Branches 2/2
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50                            7x   7x 7x         7x             7x     7x                                  
/*!
Copyright 2017 OCAD university
 
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
 
The research leading to these results has received funding from the European Union's
Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016.
 
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
 
var fluid = fluid || require("infusion");
 
var gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.oauth2");
 
// All doc types used for saving different documents into CouchDB/PouchDB
// See [the documentation of Authorization Server](../../../../../documentation/AuthServer.md)
// regarding accepted fields for each document type.
gpii.oauth2.docTypes = fluid.freezeRecursive({
    gpiiAppInstallationClient: "gpiiAppInstallationClient",
    gpiiToken: "gpiiToken",
    gpiiAppInstallationAuthorization: "gpiiAppInstallationAuthorization"
});
 
// The default value of the number of seconds that access tokens become invalid.
gpii.oauth2.defaultTokenLifeTimeInSeconds = 3600;
 
// All error details that the gpii-oauth2 module reports.
gpii.oauth2.errors = fluid.freezeRecursive({
    missingInput: {
        message: "The input field \"%fieldName\" is undefined",
        statusCode: 400,
        isError: true
    },
    missingDoc: {
        message: "The record of %docName is not found",
        statusCode: 400,
        isError: true
    },
    unauthorized: {
        message: "Unauthorized",
        statusCode: 401,
        isError: true
    }
});