-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.js
More file actions
112 lines (95 loc) · 2.67 KB
/
config.js
File metadata and controls
112 lines (95 loc) · 2.67 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
'use strict'
// This is the default configuration for the server. For a description of
// each parameter see the "Configuration.md" document in the `/docs`
// directory.
const path = require('path')
const isDebug = require('isdebug')
const nixconfig = require('nixconfig')
const fastifyCaching = require('fastify-caching')
const maxAge = 1800000 // 30 minutes in milliseconds
const cookieOptions = {
domain: '.cas.example.com',
path: '/',
expires: maxAge,
secure: true,
// If testing with localhost sites and Chrome, use 'lax'
sameSite: true,
httpOnly: true
}
const initialConfig = {
logger: {
name: 'jscas-server',
prettyPrint: isDebug,
level: (isDebug) ? 'debug' : 'info'
},
server: {
address: '127.0.0.1',
port: 9000
},
caching: {
// This should always be NOCACHE.
privacy: fastifyCaching.privacy.NOCACHE,
cacheSegment: 'jscas',
cache: {
driver: {
name: undefined,
options: {}
}
}
},
helmet: {},
dataSources: undefined,
// dataSources: {
// mongodb: {},
// postgres: {},
// redis: {}
// }
// Options for fastify-cookie.
cookie: cookieOptions,
session: {
secretKey: 'some-secret-password-at-least-32-characters-long',
sessionMaxAge: maxAge,
cookie: cookieOptions
},
tickets: {
serviceTicket: {
ttl: 10000
},
ticketGrantingTicket: {
cookieName: 'jscas-tgt',
ttl: maxAge
}
},
// Set to `true` to return user attributes via the `/serviceValidate` endpoint.
v3overv2: false,
// Set to `true` to include a "UDC_IDENTIFIER" attribute with every
// `/samlValidate` request. The attribute value will be set to the same
// value as the standard CAS "user" value, i.e. the username. This is to
// enable compliance with the SIS product Banner 9. Note: this value gets
// mapped to a value in Banner's `general.gobumap` table.
saml11Banner9Hack: false,
// Given a string name the server will attempt to `require` the module.
// If the string begins with `~/`, it indicates that the "module" is within
// the server's `lib/plugins/` directory, i.e. is one of the shipped demo
// plugins.
//
// Otherwise, you may specify already required instances.
plugins: {
theme: '~/basicTheme',
attributesResolver: '~/jsAttributesResolver',
serviceRegistry: '~/jsServiceRegistry',
ticketRegistry: '~/jsTicketRegistry',
auth: [
'~/jsIdP'
],
misc: []
},
pluginsConf: {}
}
const config = nixconfig({
initialConfig,
parentName: 'jscas',
parentPath: path.resolve(path.join(__dirname, '..')),
loaders: Object.assign({}, require('nixconfig-yaml'), require('nixconfig-toml'))
})
module.exports = config