Skip to content

Commit

Permalink
Merge pull request #101 from southbridgeio/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
haukot authored Apr 6, 2022
2 parents 2312a20 + b7f4bf0 commit 2a531ed
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.7.5

* Fix problem with telegram_id exceeding int.

# 1.7.4

* Bump redmine_bots dependency version
Expand Down
7 changes: 7 additions & 0 deletions db/migrate/015_change_telegram_id_to_decimal.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ChangeTelegramIdToDecimal < Rails.version < '5.0' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
def change
change_column :redmine_2fa_telegram_accounts, :telegram_id, :decimal
change_column :redmine_2fa_telegram_connections, :telegram_id, :decimal
change_column :users, :two_fa_id, :decimal
end
end
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

Redmine::Plugin.register :redmine_2fa do
name 'Redmine 2FA'
version '1.7.4'
version '1.7.5'
url 'https://github.com/southbridgeio/redmine_2fa'
description 'Two-factor authorization for Redmine'
author 'Southbridge'
author_url 'https://southbridge.io'

requires_redmine version_or_higher: '3.0'

requires_redmine_plugin :redmine_bots, '0.5.0'
requires_redmine_plugin :redmine_bots, '0.5.1'

settings(default: { 'required' => false,
'active_protocols' => RedmineTwoFa::AVAILABLE_PROTOCOLS
Expand Down
30 changes: 30 additions & 0 deletions test/functional/telegram_auth_source_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require File.expand_path('../../test_helper', __FILE__)

class TelegramAuthSourceTest < ActionController::TestCase
fixtures :users, :email_addresses, :roles, :auth_sources

setup do
@user = User.find(2) #jsmith
@user.two_fa = 'telegram'
@user.save
end

context 'telegram_id' do
setup do
@telegram_id = 999_999_999_999
end

should 'user can handle two_fa_id above integer range' do
@user.two_fa_id = @telegram_id
@user.save
end

should 'telegram_connection can handle telegram_id above integer range' do
RedmineTwoFa::TelegramConnection.create!(telegram_id: @telegram_id, user_id: @user.id)
end

should 'telegram_accounts can handle telegram_id above integer range' do
RedmineTwoFa::TelegramAccount.create!(telegram_id: @telegram_id, user_id: @user.id)
end
end
end

0 comments on commit 2a531ed

Please sign in to comment.