root/trunk/grails-app/conf/Config.groovy @ 983

Revision 983, 7.6 KB (checked in by robert@…, 3 years ago)

New type of authentication and authorization added to the rest controller. See ticket 118

  • Property svn:keywords set to Author Date Rev
Line 
1/**
2 * Application Configuration
3 *
4 * @author  Jeroen Wesbeek
5 * @since       20100520
6 *
7 * Revision information:
8 * $Rev$
9 * $Author$
10 * $Date$
11 */
12
13// locations to search for config files that get merged into the main config
14// config files can either be Java properties files or ConfigSlurper scripts
15
16// grails.config.locations = [ "classpath:${appName}-config.properties",
17//                             "classpath:${appName}-config.groovy",
18//                             "file:${userHome}/.grails/${appName}-config.properties",
19//                             "file:${userHome}/.grails/${appName}-config.groovy"]
20
21// if(System.properties["${appName}.config.location"]) {
22//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
23// }
24grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
25grails.mime.use.accept.header = false
26grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
27                      xml: ['text/xml', 'application/xml'],
28                      text: 'text/plain',
29                      js: 'text/javascript',
30                      rss: 'application/rss+xml',
31                      atom: 'application/atom+xml',
32                      css: 'text/css',
33                      csv: 'text/csv',
34                      all: '*/*',
35                      json: ['application/json','text/json'],
36                      form: 'application/x-www-form-urlencoded',
37                      multipartForm: 'multipart/form-data'
38                    ]
39// The default codec used to encode data with ${}
40grails.views.default.codec="none" // none, html, base64
41grails.views.gsp.encoding="UTF-8"
42grails.converters.encoding="UTF-8"
43
44// enabled native2ascii conversion of i18n properties files
45grails.enable.native2ascii = true
46
47// set per-environment serverURL stem for creating absolute links
48environments {
49    production {
50        grails.serverURL = "http://gscf.nmcdsp.org"
51    }
52    development {
53        grails.serverURL = "http://localhost:8080/${appName}"
54    }
55    test {
56        grails.serverURL = "http://localhost:8080/${appName}"
57    }
58
59}
60
61// log4j configuration
62log4j = {
63    // Example of changing the log pattern for the default console
64    // appender:
65    //
66    //appenders {
67    //    console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
68    //}
69
70    error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
71               'org.codehaus.groovy.grails.web.pages', //  GSP
72               'org.codehaus.groovy.grails.web.sitemesh', //  layouts
73               'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
74               'org.codehaus.groovy.grails.web.mapping', // URL mapping
75               'org.codehaus.groovy.grails.commons', // core / classloading
76               'org.codehaus.groovy.grails.plugins', // plugins
77               'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
78               'org.springframework',
79               'org.hibernate'
80
81    warn   'org.mortbay.log'
82}
83
84graphviz {
85    // graphviz installation path is dependent on OS
86    // (requirement for class diagram plugin)
87        switch (System.properties["os.name"]) {
88            case "Mac OS X":
89                // define mac path to Graphviz dot executable
90                // (install using macports: sudo port install graphviz)
91                dot.executable = "/opt/local/bin/dot"
92                break
93            default:
94                // assume the linux default path
95                dot.executable = "/usr/bin/dot"
96        }
97}
98
99// cryptography settings
100// @see WizardTaglib.groovy (encrypt)
101// @see TemplateEditorController.groovy (decrypt)
102crypto {
103        shared.secret = "U73reG*mE^\$t@7s!e%"
104}
105
106// GSCF specific configuration
107gscf {
108        domain = [
109                // importable entities
110                // use: grailsApplication.config.gscf.domain.entities
111                entities: [
112                        // dbnp.data
113                        'dbnp.data.FeatureBase',
114                        'dbnp.data.FeatureType',
115                        'dbnp.data.Ontology',
116                        'dbnp.data.Term',
117
118                        // dbnp.studycapturing
119                        'dbnp.studycapturing.Assay',
120                        'dbnp.studycapturing.AssayModule',
121                        'dbnp.studycapturing.AssayType',
122                        'dbnp.studycapturing.Compound',
123                        'dbnp.studycapturing.Event',
124                        'dbnp.studycapturing.EventGroup',
125                        'dbnp.studycapturing.Person',
126                        'dbnp.studycapturing.PersonAffilitation',
127                        'dbnp.studycapturing.PersonRole',
128                        'dbnp.studycapturing.Publication',
129                        'dbnp.studycapturing.Sample',
130                        'dbnp.studycapturing.SamplingEvent',
131                        'dbnp.studycapturing.Study',
132                        'dbnp.studycapturing.StudyPerson',
133                        'dbnp.studycapturing.Subject',
134                        'dbnp.studycapturing.Template',
135                        'dbnp.studycapturing.TemplateEntity',
136                        'dbnp.studycapturing.TemplateField',
137                        'dbnp.studycapturing.TemplateFieldListItem',
138                        'dbnp.studycapturing.TemplateFieldType'
139                ],
140
141                // importable entities
142                // use: grailsApplication.config.gscf.domain.importableEntities
143                // @see ImporterController
144                importableEntities: [                   
145                        event   : [name: 'Event', entity:'dbnp.studycapturing.Event'],                 
146                        sample  : [name: 'Sample', entity: 'dbnp.studycapturing.Sample'],
147                        study   : [name: 'Study', entity: 'dbnp.studycapturing.Study'],
148                        subject : [name: 'Subject', entity: 'dbnp.studycapturing.Subject'],
149                        samplingevent : [name: 'SamplingEvent', entity: 'dbnp.studycapturing.SamplingEvent']
150
151                ]
152        ]
153}
154
155// jquery plugin
156grails.views.javascript.library="jquery"
157
158// Needed for the Spring Security Core plugin:
159grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser'
160grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole'
161grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole'
162grails.plugins.springsecurity.password.algorithm = 'SHA-256'
163grails.plugins.springsecurity.password.encodeHashAsBase64 = true
164grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption
165grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation
166grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect'
167
168// Make sure the different controllers provided by springsecurity.ui are only accessible by administrators
169// NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone
170grails.plugins.springsecurity.controllerAnnotations.staticRules = [
171    '/user/**': ['ROLE_ADMIN'],
172    '/role/**': ['ROLE_ADMIN'],
173    '/aclclass/**': ['ROLE_ADMIN'],
174    '/aclentry/**': ['ROLE_ADMIN'],
175    '/aclobjectidentity/**': ['ROLE_ADMIN'],
176    '/aclsid/**': ['ROLE_ADMIN'],
177    '/persistentlogin/**': ['ROLE_ADMIN'],
178    '/registrationcode/**': ['ROLE_ADMIN'],
179    '/requestmap/**': ['ROLE_ADMIN'],
180    '/securityinfo/**': ['ROLE_ADMIN']
181]
182
183
184// Needed for sending emails
185grails {
186    mail {
187        host = "smtp.gmail.com"
188        port = 465
189        username = "gscfproject@gmail.com"
190        password = "gscf2010"
191        props = [
192            "mail.smtp.auth":"true",
193            "mail.smtp.socketFactory.port": '465',
194            "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
195            "mail.smtp.socketFactory.fallback": "false"
196        ]
197    }
198}
199
200// The OAuth consumer key and secret variables are currently replaced by Jeroen's Continuous Integration script.
201// These keys were requested by me (Tjeerd) from myExperiment.
202oauth {
203        myExperiment {
204                requestTokenUrl = 'http://www.myexperiment.org/oauth/request_token'
205                accessTokenUrl = 'http://www.myexperiment.org/oauth/access_token'
206                authUrl = 'http://www.myexperiment.org/oauth/authorize'
207                scope = 'http://example.com/oauth/feed/api/' // Optional - currently required by the Google GData APIs
208                consumer.key = '$oauthkey$'
209                consumer.secret = '$oauthsecret$'
210        }
211}
212
Note: See TracBrowser for help on using the browser.