From a962685f7d2bd551a3f773e6dc8d2f6747db9695 Mon Sep 17 00:00:00 2001 From: Nathan Breit Date: Tue, 14 Feb 2017 12:36:38 -0500 Subject: [PATCH] Update meteor and replace account template package --- .meteor/.finished-upgraders | 8 + .meteor/cordova-plugins | 1 - .meteor/packages | 14 +- .meteor/release | 2 +- .meteor/versions | 187 +++++++++++++----------- client/0views/dash.jade | 6 +- client/config/accounts_config.coffee | 14 +- client/controllers/search_eidr.coffee | 2 - client/controllers/search_girder.coffee | 2 - client/stylesheets/misc.import.styl | 1 + routes/client.coffee | 11 +- server/accounts_config.coffee | 37 ++++- 12 files changed, 177 insertions(+), 108 deletions(-) diff --git a/.meteor/.finished-upgraders b/.meteor/.finished-upgraders index 68df3d8..aa60704 100644 --- a/.meteor/.finished-upgraders +++ b/.meteor/.finished-upgraders @@ -5,3 +5,11 @@ notices-for-0.9.0 notices-for-0.9.1 0.9.4-platform-file +notices-for-facebook-graph-api-2 +1.2.0-standard-minifiers-package +1.2.0-meteor-platform-split +1.2.0-cordova-changes +1.2.0-breaking-changes +1.3.0-split-minifiers-package +1.4.0-remove-old-dev-bundle-link +1.4.1-add-shell-server-package diff --git a/.meteor/cordova-plugins b/.meteor/cordova-plugins index 8b13789..e69de29 100644 --- a/.meteor/cordova-plugins +++ b/.meteor/cordova-plugins @@ -1 +0,0 @@ - diff --git a/.meteor/packages b/.meteor/packages index a4d4692..419fc8c 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -7,7 +7,7 @@ standard-app-packages coffeescript mquandalle:stylus http -email +email@1.1.18 tangelo mquandalle:jade twbs:bootstrap @@ -19,9 +19,15 @@ mrt:dbproxy mizzao:autocomplete chuangbo:marked iron:router -joshowens:accounts-entry -reactive-var -underscore +reactive-var@1.0.11 +underscore@1.0.10 bevanhunt:leaflet miktam:api-password new3rs:html2canvas +random@1.0.10 +shell-server +accounts-base +accounts-ui +accounts-password +useraccounts:bootstrap +useraccounts:iron-routing diff --git a/.meteor/release b/.meteor/release index f1b6255..b7694ea 100644 --- a/.meteor/release +++ b/.meteor/release @@ -1 +1 @@ -METEOR@1.0.1 +METEOR@1.4.2.6 diff --git a/.meteor/versions b/.meteor/versions index 04f6da8..4d4285a 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,92 +1,111 @@ -accounts-base@1.1.2 -accounts-password@1.0.4 +accounts-base@1.2.14 +accounts-password@1.3.4 +accounts-ui@1.1.9 +accounts-ui-unstyled@1.1.12 +allow-deny@1.0.5 anti:i18n@0.4.3 -application-configuration@1.0.3 -aslagle:reactive-table@0.5.9 -autoupdate@1.1.3 -base64@1.0.1 -bevanhunt:leaflet@1.2.1 -binary-heap@1.0.1 -blaze-tools@1.0.1 -blaze@2.0.3 -boilerplate-generator@1.0.1 -callback-hook@1.0.1 -check@1.0.2 -chuangbo:marked@0.3.5 -coffeescript@1.0.4 -ctl-helper@1.0.4 -ctl@1.0.2 -d3js:d3@3.4.13 -dandv:caret-position@2.1.0-3 -ddp@1.0.12 -deps@1.0.5 -ejson@1.0.4 -email@1.0.4 -fastclick@1.0.1 -follower-livedata@1.0.2 -fortawesome:fontawesome@4.6.3 +aslagle:reactive-table@0.8.39 +autoupdate@1.3.12 +babel-compiler@6.14.1 +babel-runtime@1.0.1 +base64@1.0.10 +bevanhunt:leaflet@1.3.1 +binary-heap@1.0.10 +blaze@2.3.0 +blaze-tools@1.0.10 +boilerplate-generator@1.0.11 +caching-compiler@1.1.9 +caching-html-compiler@1.1.0 +callback-hook@1.0.10 +check@1.2.4 +chuangbo:marked@0.3.5_1 +coffeescript@1.12.0_1 +d3js:d3@3.5.8 +dandv:caret-position@2.1.1 +ddp@1.2.5 +ddp-client@1.3.3 +ddp-common@1.2.8 +ddp-rate-limiter@1.0.6 +ddp-server@1.3.13 +deps@1.0.12 +diff-sequence@1.0.7 +ecmascript@0.6.3 +ecmascript-runtime@0.3.15 +ejson@1.0.13 +email@1.1.18 +fastclick@1.0.13 +fortawesome:fontawesome@4.7.0 geojs@0.0.0 -geojson-utils@1.0.1 -handlebars@1.0.1 -html-tools@1.0.2 -htmljs@1.0.2 -http@1.0.8 -id-map@1.0.1 -iron:controller@1.0.3 +geojson-utils@1.0.10 +html-tools@1.0.11 +htmljs@1.0.11 +http@1.2.11 +id-map@1.0.9 +iron:controller@1.0.12 iron:core@1.0.11 -iron:dynamic-template@1.0.3 -iron:layout@1.0.3 +iron:dynamic-template@1.0.12 +iron:layout@1.0.12 iron:location@1.0.11 -iron:middleware-stack@1.0.3 -iron:router@1.0.3 -iron:url@1.0.11 -joshowens:accounts-entry@1.0.3 -joshowens:simple-form@0.2.2 -jquery@1.0.1 -json@1.0.1 -launch-screen@1.0.0 -less@1.0.11 -livedata@1.0.11 -localstorage@1.0.1 -logging@1.0.5 -meteor-platform@1.2.0 -meteor@1.1.3 -miktam:api-password@1.0.0 -minifiers@1.1.2 -minimongo@1.0.5 -mizzao:autocomplete@0.4.10 -mobile-status-bar@1.0.1 -mongo@1.0.9 -mquandalle:jade@0.4.1 +iron:middleware-stack@1.1.0 +iron:router@1.1.2 +iron:url@1.1.0 +jquery@1.11.10 +launch-screen@1.1.1 +less@2.6.5 +livedata@1.0.18 +localstorage@1.0.12 +logging@1.1.17 +meteor@1.6.1 +meteor-platform@1.2.6 +miktam:api-password@1.0.1 +minifier-js@1.2.17 +minifiers@1.1.7 +minimongo@1.0.20 +mizzao:autocomplete@0.5.1 +mobile-status-bar@1.0.14 +modules@0.7.9 +modules-runtime@0.7.9 +mongo@1.1.15 +mongo-id@1.0.6 +mquandalle:jade@0.4.9 +mquandalle:jade-compiler@0.4.5 mquandalle:stylus@1.1.1 -mrt:dbproxy@0.0.4 -mrt:underscore-string-latest@2.3.3 +mrt:dbproxy@0.0.6 new3rs:html2canvas@0.0.5 -npm-bcrypt@0.7.7 -observe-sequence@1.0.3 -ordered-dict@1.0.1 -random@1.0.1 -reactive-dict@1.0.4 -reactive-var@1.0.3 -reload@1.1.1 -retry@1.0.1 -routepolicy@1.0.2 -sacha:spin@2.0.4 -schnie:uploader@2.0.3 -service-configuration@1.0.2 -session@1.0.4 -sha@1.0.1 -softwarerero:accounts-t9n@1.0.3 -spacebars-compiler@1.0.3 -spacebars@1.0.3 -srp@1.0.1 -standard-app-packages@1.0.3 +npm-bcrypt@0.9.2 +npm-mongo@2.2.16_1 +observe-sequence@1.0.15 +ordered-dict@1.0.9 +promise@0.8.8 +random@1.0.10 +rate-limit@1.0.6 +reactive-dict@1.1.8 +reactive-var@1.0.11 +reload@1.1.11 +retry@1.0.9 +routepolicy@1.0.12 +sacha:spin@2.3.1 +service-configuration@1.0.11 +session@1.1.7 +sha@1.0.9 +shell-server@0.2.2 +softwarerero:accounts-t9n@1.3.8 +spacebars@1.0.13 +spacebars-compiler@1.1.0 +srp@1.0.10 +standard-app-packages@1.0.9 tangelo@0.0.0 -templating@1.0.9 -tracker@1.0.3 +templating@1.3.0 +templating-compiler@1.3.0 +templating-runtime@1.3.0 +templating-tools@1.1.0 +tracker@1.1.2 twbs:bootstrap@3.3.6 -ui@1.0.4 -underscore@1.0.1 -url@1.0.2 -webapp-hashing@1.0.1 -webapp@1.1.4 +ui@1.0.12 +underscore@1.0.10 +url@1.1.0 +useraccounts:bootstrap@1.14.2 +useraccounts:core@1.14.2 +useraccounts:iron-routing@1.14.2 +webapp@1.3.13 +webapp-hashing@1.0.9 diff --git a/client/0views/dash.jade b/client/0views/dash.jade index 610ffe0..817d23f 100644 --- a/client/0views/dash.jade +++ b/client/0views/dash.jade @@ -20,7 +20,7 @@ template(name="dash") span=label .left-panel.diagnosis(class="{{#unless sideBarOpen}} closed {{/unless}}") +reactiveTable collection=diseases settings=tableSettings - if signedIn + if currentUser .btn-group.btn-group-justified.btn-group-sm if prevDiagnosisId unless prevDiagnosisError @@ -30,7 +30,7 @@ template(name="dash") else a.btn.btn-default.rediagnose Rediagnose .secondary-actions - if signedIn + if currentUser a.open-feedback(data-toggle="modal" data-target="#feedback-modal") i.fa.fa-comment( data-toggle="tooltip" @@ -173,5 +173,5 @@ template(name="dash") a.clear-annotations Clear Annotations //- Feedback Modal - if signedIn + if currentUser +feedback diff --git a/client/config/accounts_config.coffee b/client/config/accounts_config.coffee index a07e0d7..8b4be51 100644 --- a/client/config/accounts_config.coffee +++ b/client/config/accounts_config.coffee @@ -1,5 +1,9 @@ -Meteor.startup -> - AccountsEntry.config - homeRoute: '/' - dashboardRoute: '/' - passwordSignupFields: 'EMAIL_ONLY' +AccountsTemplates.configureRoute 'signIn', + layoutTemplate: 'layout', + redirect: -> + if window.location.pathname == '/sign-in' + Router.go '/' + +AccountsTemplates.configure + #hideSignUpLink: true + showForgotPasswordLink: true diff --git a/client/controllers/search_eidr.coffee b/client/controllers/search_eidr.coffee index 9747392..d1ce2ca 100644 --- a/client/controllers/search_eidr.coffee +++ b/client/controllers/search_eidr.coffee @@ -76,8 +76,6 @@ Router.route("searchEidr", where: "client" path: "/searchEidr" template: "search" - onBeforeAction: () -> - AccountsEntry.signInRequired(@) waitOn: () -> if Meteor.userId() [ diff --git a/client/controllers/search_girder.coffee b/client/controllers/search_girder.coffee index 4856c24..64e8542 100644 --- a/client/controllers/search_girder.coffee +++ b/client/controllers/search_girder.coffee @@ -146,8 +146,6 @@ Router.route("searchGirder", where: "client" path: "/searchGirder" template: "search" - onBeforeAction: () -> - AccountsEntry.signInRequired(@) waitOn: () -> if Meteor.userId() [ diff --git a/client/stylesheets/misc.import.styl b/client/stylesheets/misc.import.styl index 72421fd..a972cda 100644 --- a/client/stylesheets/misc.import.styl +++ b/client/stylesheets/misc.import.styl @@ -8,6 +8,7 @@ margin auto .symptom-table .info + clear both width 50% min-width 400px max-width 600px diff --git a/routes/client.coffee b/routes/client.coffee index d232cbd..c69efcf 100644 --- a/routes/client.coffee +++ b/routes/client.coffee @@ -1,9 +1,14 @@ Results = @grits.Results +redirectIfNotSignedIn = (router) -> + if Meteor.userId() + router.next() + else + router.redirect '/sign-in' + Router.configure layoutTemplate: "layout" - Router.map () -> @route("splash", @@ -20,7 +25,7 @@ Router.map () -> path: '/profile/:_id?' where: 'client' onBeforeAction: () -> - AccountsEntry.signInRequired(@) + redirectIfNotSignedIn(@) waitOn: () -> if Meteor.userId() [ @@ -115,7 +120,7 @@ Router.map () -> where: 'client' template: 'authenticateSubmission' onBeforeAction: () -> - AccountsEntry.signInRequired(@) + redirectIfNotSignedIn(@) onAfterAction: () -> submissionId = @params._id Meteor.call('submitFromQuarantine', submissionId, (error, resultId) -> diff --git a/server/accounts_config.coffee b/server/accounts_config.coffee index d306ee4..ffb3170 100644 --- a/server/accounts_config.coffee +++ b/server/accounts_config.coffee @@ -1,3 +1,34 @@ -Meteor.startup -> - Accounts.emailTemplates.siteName = "GRITS" - Accounts.emailTemplates.from = "GRITS " +Meteor.methods( + ### + # Create or update a meteor account for a BSVE user with the given auth info. + # @param authInfo.authTicket - The BSVE authTicket used to verify the account + # with the BSVE. + # @param authInfo.user - The BSVE user's username. The meteor username + # is the BSVE username with bsve- prepended. + ### + setPasswordViaBSVEAuthTicket: (authInfo)-> + # The api path chosen here is aribitrary, the call is only to verify that + # the auth ticket works. + response = HTTP.get("https://api.bsvecosystem.net/data/v2/sources/PON", { + headers: + "harbinger-auth-ticket": authInfo.authTicket + }) + if Meteor.settings.private?.disableBSVEAuthentication + throw new Meteor.Error("BSVEAuthFailure", "BSVE Authentication is disabled.") + if response.data.status != 1 + throw new Meteor.Error("BSVEAuthFailure", response.data.message) + meteorUser = Meteor.users.findOne(username: "bsve-" + authInfo.user) + if not meteorUser + console.log "Creating user" + {firstName, lastName} = authInfo.userData + userId = Accounts.createUser( + username: "bsve-" + authInfo.user + profile: + name: firstName + " " + lastName + ) + else + userId = meteorUser._id + password = Random.secret() + Accounts.setPassword(userId, password, logout:false) + return password +)