Changing the migration script numberand resolving a compilation issue
Project: http://git-wip-us.apache.org/repos/asf/fineract/repo Commit: http://git-wip-us.apache.org/repos/asf/fineract/commit/c689c143 Tree: http://git-wip-us.apache.org/repos/asf/fineract/tree/c689c143 Diff: http://git-wip-us.apache.org/repos/asf/fineract/diff/c689c143 Branch: refs/heads/develop Commit: c689c143e4d98b29db5dba26c3ef7a193a6d8cab Parents: 1a50128 Author: Nazeer Hussain Shaik <nazeer.sh...@confluxtechnologies.com> Authored: Mon Nov 27 17:40:14 2017 +0530 Committer: Nazeer Hussain Shaik <nazeer.sh...@confluxtechnologies.com> Committed: Mon Nov 27 17:40:14 2017 +0530 ---------------------------------------------------------------------- .../security/service/TwoFactorServiceImpl.java | 2 +- .../core_db/V336__two_factor_authentication.sql | 63 -------------------- .../core_db/V338__two_factor_authentication.sql | 63 ++++++++++++++++++++ 3 files changed, 64 insertions(+), 64 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/c689c143/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TwoFactorServiceImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TwoFactorServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TwoFactorServiceImpl.java index 64361c2..63183dd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TwoFactorServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/TwoFactorServiceImpl.java @@ -107,7 +107,7 @@ public class TwoFactorServiceImpl implements TwoFactorService { final OTPRequest request = generateNewToken(smsDelivery, extendedAccessToken); final String smsText = configurationService.getFormattedSmsTextFor(user, request); SmsMessage smsMessage = SmsMessage.pendingSms(null, null, null, user.getStaff(), smsText, - user.getStaff().mobileNo(), null); + user.getStaff().mobileNo(), null, false); this.smsMessageRepository.save(smsMessage); smsMessageScheduledJobService.sendTriggeredMessage(Collections.singleton(smsMessage), configurationService.getSMSProviderId()); http://git-wip-us.apache.org/repos/asf/fineract/blob/c689c143/fineract-provider/src/main/resources/sql/migrations/core_db/V336__two_factor_authentication.sql ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V336__two_factor_authentication.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V336__two_factor_authentication.sql deleted file mode 100644 index bd5d359..0000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V336__two_factor_authentication.sql +++ /dev/null @@ -1,63 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- Access Token Table - -CREATE TABLE `twofactor_access_token` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `token` varchar(32) NOT NULL, - `appuser_id` bigint(20) NOT NULL, - `valid_from` datetime NOT NULL, - `valid_to` datetime NOT NULL, - `enabled` bit(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `token_appuser_UNIQUE` (`token`,`appuser_id`), - KEY `user` (`appuser_id`), - KEY `token` (`token`), - CONSTRAINT `fk_2fa_access_token_user_id` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`) -); - --- Configuration - -CREATE TABLE `twofactor_configuration` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `name` varchar(40) NOT NULL, - `value` varchar(1024) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `key_UNIQUE` (`name`) -); - -INSERT INTO `twofactor_configuration` (`name`, `value`) VALUES - ('otp-delivery-email-enable', 'true'), - ('otp-delivery-email-subject', 'Fineract Two-Factor Authentication Token'), - ('otp-delivery-email-body', 'Hello {{username}}.\nYour OTP login token is {{token}}.'), - ('otp-delivery-sms-enable', 'false'), - ('otp-delivery-sms-provider', '1'), - ('otp-delivery-sms-text', 'Your authentication token for Fineract is {{token}}.'), - ('otp-token-live-time', '300'), - ('otp-token-length', '5'), - ('access-token-live-time', '86400'), - ('access-token-live-time-extended', '604800'); - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES - ('authorisation', 'INVALIDATE_TWOFACTOR_ACCESSTOKEN', 'TWOFACTOR_ACCESSTOKEN', 'INVALIDATE', '0'), - ('configuration', 'READ_TWOFACTOR_CONFIGURATION', 'TWOFACTOR_CONFIGURATION', 'READ', '0'), - ('configuration', 'UPDATE_TWOFACTOR_CONFIGURATION', 'TWOFACTOR_CONFIGURATION', 'UPDATE', '0'), - ('special', 'BYPASS_TWOFACTOR', NULL, NULL, '0'); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/c689c143/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql new file mode 100644 index 0000000..bd5d359 --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql @@ -0,0 +1,63 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- + +-- Access Token Table + +CREATE TABLE `twofactor_access_token` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `token` varchar(32) NOT NULL, + `appuser_id` bigint(20) NOT NULL, + `valid_from` datetime NOT NULL, + `valid_to` datetime NOT NULL, + `enabled` bit(1) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `token_appuser_UNIQUE` (`token`,`appuser_id`), + KEY `user` (`appuser_id`), + KEY `token` (`token`), + CONSTRAINT `fk_2fa_access_token_user_id` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`) +); + +-- Configuration + +CREATE TABLE `twofactor_configuration` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(40) NOT NULL, + `value` varchar(1024) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_UNIQUE` (`name`) +); + +INSERT INTO `twofactor_configuration` (`name`, `value`) VALUES + ('otp-delivery-email-enable', 'true'), + ('otp-delivery-email-subject', 'Fineract Two-Factor Authentication Token'), + ('otp-delivery-email-body', 'Hello {{username}}.\nYour OTP login token is {{token}}.'), + ('otp-delivery-sms-enable', 'false'), + ('otp-delivery-sms-provider', '1'), + ('otp-delivery-sms-text', 'Your authentication token for Fineract is {{token}}.'), + ('otp-token-live-time', '300'), + ('otp-token-length', '5'), + ('access-token-live-time', '86400'), + ('access-token-live-time-extended', '604800'); + + +INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES + ('authorisation', 'INVALIDATE_TWOFACTOR_ACCESSTOKEN', 'TWOFACTOR_ACCESSTOKEN', 'INVALIDATE', '0'), + ('configuration', 'READ_TWOFACTOR_CONFIGURATION', 'TWOFACTOR_CONFIGURATION', 'READ', '0'), + ('configuration', 'UPDATE_TWOFACTOR_CONFIGURATION', 'TWOFACTOR_CONFIGURATION', 'UPDATE', '0'), + ('special', 'BYPASS_TWOFACTOR', NULL, NULL, '0'); \ No newline at end of file