Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert rocketchat-2fa to main module structure #12501

Merged
merged 64 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ad2cd8c
First wave of removal of Meteor global
rodrigok Oct 19, 2018
51095cb
Second wave of removal of Meteor global
rodrigok Oct 19, 2018
3f0c9f7
Third wave of removal of Meteor global
rodrigok Oct 19, 2018
e6dfe65
Fix tests
rodrigok Oct 19, 2018
6c46cd2
Merge remote-tracking branch 'origin/develop' into imports/meteor-1
rodrigok Oct 19, 2018
2ac4a38
Remove global variable SHA256
rodrigok Oct 19, 2018
0ebaa95
Remove global variable WebApp
rodrigok Oct 19, 2018
7db5aa9
Remove global variable EJSON
rodrigok Oct 19, 2018
bff9b31
Remove global variable Email
rodrigok Oct 19, 2018
4aafc1b
Remove global variable HTTP
rodrigok Oct 19, 2018
4551e92
Remove global variable Random
rodrigok Oct 19, 2018
501fec5
Remove global variable ReactiveDict
rodrigok Oct 19, 2018
963b5af
Remove global variable ReactiveVar
rodrigok Oct 19, 2018
103d8c5
Remove global variable Accounts
rodrigok Oct 19, 2018
7c99760
Remove globals variables Match and check
MarcosSpessatto Oct 24, 2018
b4dc88d
Remove global variable Mongo
MarcosSpessatto Oct 24, 2018
c813f5e
Remove global variable moment
MarcosSpessatto Oct 24, 2018
c3b9886
Remove global variable Tracker
MarcosSpessatto Oct 24, 2018
a3e965f
Remove global variable Blaze
MarcosSpessatto Oct 25, 2018
577acf7
Remove global variables FlowRouter and BlazeLayout
MarcosSpessatto Oct 25, 2018
2b82e3c
Add FlowRouter to eslint global in tests file
MarcosSpessatto Oct 25, 2018
be79f54
Remove global variable DDPRateLimiter
MarcosSpessatto Oct 26, 2018
70adda6
Remove global variable Session
MarcosSpessatto Oct 26, 2018
a9c962e
Remove global variable UAParser
MarcosSpessatto Oct 26, 2018
dbb0f28
Remove global variable Promise
MarcosSpessatto Oct 26, 2018
e3b4dc8
Remove global variable Reload
MarcosSpessatto Oct 26, 2018
7346aa3
Remove global variable CryptoJS
MarcosSpessatto Oct 26, 2018
5f9a3d4
Remove global variable Template
MarcosSpessatto Oct 26, 2018
39e7721
Remove global variable TAPi18n
MarcosSpessatto Oct 26, 2018
f1fa949
Remove global variable TAPi18next
MarcosSpessatto Oct 26, 2018
2d8544a
Exposing t function from rocketchat:ui package
MarcosSpessatto Oct 30, 2018
011bd15
Convert chatpal search to main module structure
MarcosSpessatto Oct 30, 2018
8fbd297
Merge branch 'develop' into imports/meteor-1
rodrigok Oct 30, 2018
9f53fab
Merge remote-tracking branch 'origin/imports/meteor-1' into imports/w…
rodrigok Oct 30, 2018
b844ba1
Fix ESLint
rodrigok Oct 30, 2018
a6b81b2
Merge remote-tracking branch 'origin/imports/meteor-1' into imports/w…
rodrigok Oct 30, 2018
d7a0eeb
Merge remote-tracking branch 'origin/imports/wave-2' into imports/wave-3
rodrigok Oct 30, 2018
d119435
Merge remote-tracking branch 'origin/imports/wave-3' into imports/wave-4
rodrigok Oct 30, 2018
8f50571
Merge remote-tracking branch 'origin/imports/wave-4' into imports/wave-5
rodrigok Oct 30, 2018
37eb898
Merge branch 'imports/wave-5' into imports/wave-6-main-module-chatpal…
MarcosSpessatto Oct 30, 2018
ac5bfe1
Convert meteor-accounts-saml to main module structure
MarcosSpessatto Oct 30, 2018
d1b3921
Convert meteor-autocomplete to main module structure
MarcosSpessatto Oct 30, 2018
0041103
Convert meteor-timesync package to modular structure
MarcosSpessatto Oct 31, 2018
eceb9c2
exposing modal global variable
MarcosSpessatto Oct 31, 2018
00a03bf
Convert rocketchat-2fa to main module structure
MarcosSpessatto Oct 31, 2018
05b9956
Merge remote-tracking branch 'origin/develop' into imports/meteor-1
rodrigok Nov 1, 2018
827f366
Merge remote-tracking branch 'origin/imports/meteor-1' into imports/w…
rodrigok Nov 1, 2018
8933394
Merge remote-tracking branch 'origin/develop' into imports/wave-2
rodrigok Nov 1, 2018
5d83610
Merge remote-tracking branch 'origin/imports/wave-2' into imports/wave-3
rodrigok Nov 1, 2018
4d5c855
Merge remote-tracking branch 'origin/develop' into imports/wave-3
rodrigok Nov 1, 2018
e8dbdbc
Merge remote-tracking branch 'origin/imports/wave-3' into imports/wave-4
rodrigok Nov 1, 2018
805a431
Merge remote-tracking branch 'origin/develop' into imports/wave-4
rodrigok Nov 1, 2018
7564ab9
Merge remote-tracking branch 'origin/imports/wave-4' into imports/wave-5
rodrigok Nov 1, 2018
5d6ac07
Merge remote-tracking branch 'origin/develop' into imports/wave-5
rodrigok Nov 1, 2018
1afc93e
Merge remote-tracking branch 'origin/imports/wave-5' into imports/wav…
rodrigok Nov 1, 2018
e296b08
Merge remote-tracking branch 'origin/develop' into imports/wave-6-mai…
rodrigok Nov 1, 2018
fc77110
Merge remote-tracking branch 'origin/imports/wave-6-main-module-chatp…
rodrigok Nov 1, 2018
1489ec6
Merge branch 'imports/wave-7-main-module-accounts-saml' into imports/…
rodrigok Nov 1, 2018
a4a0be4
Merge branch 'imports/wave-8-main-module-autocomplete' into imports/w…
rodrigok Nov 1, 2018
7a62c0e
Merge remote-tracking branch 'origin/develop' into imports/wave-8-mai…
rodrigok Nov 1, 2018
657a22d
Merge branch 'imports/wave-8-main-module-autocomplete' into imports/w…
rodrigok Nov 1, 2018
95b30d1
Merge remote-tracking branch 'origin/develop' into imports/wave-9-mai…
rodrigok Nov 1, 2018
fe63c1d
Merge remote-tracking branch 'origin/imports/wave-9-main-module-times…
rodrigok Nov 1, 2018
42cace9
Merge remote-tracking branch 'origin/develop' into imports/wave-10-ma…
rodrigok Nov 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/rocketchat-2fa/client/TOTPPassword.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { t, modal } from 'meteor/rocketchat:ui';
import toastr from 'toastr';

function reportError(error, callback) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/client/accountSecurity.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Template } from 'meteor/templating';
import { t, modal } from 'meteor/rocketchat:ui';
import { RocketChat } from 'meteor/rocketchat:lib';
import toastr from 'toastr';
import qrcode from 'yaqrcode';

Expand Down
3 changes: 3 additions & 0 deletions packages/rocketchat-2fa/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './accountSecurity.html';
import './accountSecurity';
import './TOTPPassword';
19 changes: 3 additions & 16 deletions packages/rocketchat-2fa/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,9 @@ Package.onUse(function(api) {
'rocketchat:lib',
'sha',
'random',
'rocketchat:ui',
]);

api.addFiles('client/accountSecurity.html', 'client');
api.addFiles('client/accountSecurity.js', 'client');
api.addFiles('client/TOTPPassword.js', 'client');

api.addFiles('server/lib/totp.js', 'server');

api.addFiles('server/methods/checkCodesRemaining.js', 'server');
api.addFiles('server/methods/disable.js', 'server');
api.addFiles('server/methods/enable.js', 'server');
api.addFiles('server/methods/regenerateCodes.js', 'server');
api.addFiles('server/methods/validateTempToken.js', 'server');

api.addFiles('server/models/users.js', 'server');

api.addFiles('server/startup/settings.js', 'server');
api.addFiles('server/loginHandler.js', 'server');
api.mainModule('client/index.js', 'client');
api.mainModule('server/index.js', 'server');
});
9 changes: 9 additions & 0 deletions packages/rocketchat-2fa/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import './startup/settings';
import './lib/totp';
import './models/users';
import './methods/checkCodesRemaining';
import './methods/disable';
import './methods/enable';
import './methods/regenerateCodes';
import './methods/validateTempToken';
import './loginHandler';
1 change: 1 addition & 0 deletions packages/rocketchat-2fa/server/lib/totp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SHA256 } from 'meteor/sha';
import { Random } from 'meteor/random';
import { RocketChat } from 'meteor/rocketchat:lib';
import speakeasy from 'speakeasy';

RocketChat.TOTP = {
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-2fa/server/loginHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { RocketChat } from 'meteor/rocketchat:lib';

Accounts.registerLoginHandler('totp', function(options) {
if (!options.totp || !options.totp.code) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';

Meteor.methods({
'2fa:checkCodesRemaining'() {
if (!Meteor.userId()) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/server/methods/disable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Meteor.methods({
'2fa:disable'(code) {
if (!Meteor.userId()) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/server/methods/enable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Meteor.methods({
'2fa:enable'() {
if (!Meteor.userId()) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/server/methods/regenerateCodes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Meteor.methods({
'2fa:regenerateCodes'(userToken) {
if (!Meteor.userId()) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/server/methods/validateTempToken.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Meteor.methods({
'2fa:validateTempToken'(userToken) {
if (!Meteor.userId()) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/server/models/users.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.models.Users.disable2FAAndSetTempSecretByUserId = function(userId, tempToken) {
return this.update({
_id: userId,
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-2fa/server/startup/settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.settings.addGroup('Accounts', function() {
this.section('Two Factor Authentication', function() {
this.add('Accounts_TwoFactorAuthentication_Enabled', true, {
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui/client/views/app/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Meteor } from 'meteor/meteor';
import { Blaze } from 'meteor/blaze';
import { Template } from 'meteor/templating';

this.modal = {
modal = {
renderedModal: null,
open(config = {}, fn, onCancel) {
config.confirmButtonText = config.confirmButtonText || (config.type === 'error' ? t('Ok') : t('Send'));
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-ui/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ Package.onUse(function(api) {

api.export('fileUpload');
api.export('t');
api.export('modal');
});