From nobody Sun May 07 21:21:14 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QDy5l33NWz49XRh; Sun, 7 May 2023 21:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QDy5l0ZvLz3MGJ; Sun, 7 May 2023 21:21:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683494475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sKEc2Qp+xnAcHhrvzNzr5R06vs6dkmuR+5cnGZ3/j6I=; b=ZJeVuVCteqDKIy9XBs3QEsLZpYw8ZFiHM8HkbQJyAmn5p9R++O6fUI3V1i97yOQavLXjth vfGuocvEJ6N+dVYnvfJui2DiH40pIwhTYm6IceRbPmCuvgPDOei9hPiO8CR8FjYDW+Zx5d WU5j8+VSOi8rnk32vbwdwBlskMMd/Vh2Q4i8giszEqLik02s9MMifS6qK9XQgK4XlWF1vr 2HmGLifcgsbch7Hjej/2PsZxZABR9uQhSd1op+2CzSI6khocvRHM/iB8dQOKHulBoKRkjg +QnSxaeN2HwMNPv/gT20vw67AkUoH1xMAiAjnsCxsmORyKLE3jd73wKeGNJ1dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683494475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sKEc2Qp+xnAcHhrvzNzr5R06vs6dkmuR+5cnGZ3/j6I=; b=mOXHxgG26MGmbfQiHTuTSSUF2yKJ1llO1FANQik42PvaezMcQC12vg0VhLAXKnB85qxG9x Sy9eEAHCPP0ykXF749OnoFMg/ULrI/dhHQEQApJG7q0uXdi87gpJiR7HGJLZ7FurilhfcL YrP1WOvDM9JAuSL/+On7CdOU75It5Wffv2ZU/1qQbNNjC/E0uR0nH1MDWb040m2N6WHU+a gTJnUYlktmJgiv8eBUc6rh0xwSxHnssu4fMGiOjxpd2fcM84bQmlmAXoYbOrk2yitClSat jZNJagd0W1gnXegHbIG8zT/6h1gvJncDPpykfVYGJ4eNcOg4+BTUgWvRhOnlhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683494475; a=rsa-sha256; cv=none; b=j3wK4Zm5sxhFThqaMyUC+0Vv5Pb8dW2NUztcRbGlAniGk2SyDqiwOldOoJSThg+L2nH2ii aiYXCOaP5qCVo/iL+xf5WXI97AtwDMrqmpuDyRkMDIy8iwRobDx3Fy7gB36ZnEZkEc2Vty G8RFpVQv/9UBOAWrkIso2/yZ4zhtx5o++8k5cF96KFpkNXlvu2JlB3LY/I3HPCgAz2xScS o1PkeY54LH1Yt59xsNJH9MtqLGapYmYi2Z8E1E2CF5ejnRRp71i0TcgeUSaVQCUkNSbfo5 Jo7VrQ+3uNyUc+3cjCJYrsArQAZ61sPuqcenb9DZ9mBByYBoFDMQuRwxSOXRMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QDy5k6prdzYr8; Sun, 7 May 2023 21:21:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 347LLEXk051999; Sun, 7 May 2023 21:21:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 347LLETK051998; Sun, 7 May 2023 21:21:14 GMT (envelope-from git) Date: Sun, 7 May 2023 21:21:14 GMT Message-Id: <202305072121.347LLETK051998@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 3426627ccab3 - main - security/rubygem-devise-two-factor-rails61: Allow build with rubygem-attr_encrypted 4.* List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3426627ccab3d9331bfa903579b5f15d1020e5c7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=3426627ccab3d9331bfa903579b5f15d1020e5c7 commit 3426627ccab3d9331bfa903579b5f15d1020e5c7 Author: Po-Chuan Hsieh AuthorDate: 2023-05-07 21:14:28 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-05-07 21:14:28 +0000 security/rubygem-devise-two-factor-rails61: Allow build with rubygem-attr_encrypted 4.* - Bump PORTREVISION for package change Obtained from: https://github.com/tinfoil/devise-two-factor/commit/e685f91ce62d036259885fbe31fcb4fa930bcfcb --- .../rubygem-devise-two-factor-rails61/Makefile | 3 +- .../files/patch-attr_encrypted | 48 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/security/rubygem-devise-two-factor-rails61/Makefile b/security/rubygem-devise-two-factor-rails61/Makefile index 21274cc41f27..560958696121 100644 --- a/security/rubygem-devise-two-factor-rails61/Makefile +++ b/security/rubygem-devise-two-factor-rails61/Makefile @@ -1,5 +1,6 @@ PORTNAME= devise-two-factor PORTVERSION= 4.0.2 +PORTREVISION= 1 CATEGORIES= security rubygems MASTER_SITES= RG PKGNAMESUFFIX= -rails61 @@ -12,7 +13,7 @@ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= rubygem-activesupport61>=0<7.1:devel/rubygem-activesupport61 \ - rubygem-attr_encrypted>=3<4:security/rubygem-attr_encrypted \ + rubygem-attr_encrypted>=3<5:security/rubygem-attr_encrypted \ rubygem-devise-rails61>=4.0<5:devel/rubygem-devise-rails61 \ rubygem-railties61>=0<7.1:www/rubygem-railties61 \ rubygem-rotp>=6.0<7:devel/rubygem-rotp diff --git a/security/rubygem-devise-two-factor-rails61/files/patch-attr_encrypted b/security/rubygem-devise-two-factor-rails61/files/patch-attr_encrypted new file mode 100644 index 000000000000..10b05cbe309f --- /dev/null +++ b/security/rubygem-devise-two-factor-rails61/files/patch-attr_encrypted @@ -0,0 +1,48 @@ +--- devise-two-factor.gemspec.orig 2023-05-07 17:19:51 UTC ++++ devise-two-factor.gemspec +@@ -23,7 +23,7 @@ Gem::Specification.new do |s| + + s.add_runtime_dependency(%q.freeze, ["< 7.1"]) + s.add_runtime_dependency(%q.freeze, ["< 7.1"]) +- s.add_runtime_dependency(%q.freeze, [">= 1.3", "< 4", "!= 2"]) ++ s.add_runtime_dependency(%q.freeze, [">= 1.3", "< 5", "!= 2"]) + s.add_runtime_dependency(%q.freeze, ["~> 4.0"]) + s.add_runtime_dependency(%q.freeze, ["~> 6.0"]) + s.add_development_dependency(%q.freeze, [">= 0"]) +--- spec/devise/models/two_factor_authenticatable_spec.rb.orig 2023-05-07 17:23:37 UTC ++++ spec/devise/models/two_factor_authenticatable_spec.rb +@@ -64,15 +64,31 @@ describe ::Devise::Models::TwoFactorAuthenticatable do + + describe 'otp_secret options' do + it 'should be of the key' do +- expect(subject.encrypted_attributes[:otp_secret][:key]).to eq('test-key'*8) ++ if attr_encrypted_is_rails_seven_compatible? ++ expect(subject.attr_encrypted_encrypted_attributes[:otp_secret][:key]).to eq('test-key'*8) ++ else ++ expect(subject.encrypted_attributes[:otp_secret][:key]).to eq('test-key'*8) ++ end + end + + it 'should be of the mode' do +- expect(subject.encrypted_attributes[:otp_secret][:mode]).to eq(:per_attribute_iv_and_salt) ++ if attr_encrypted_is_rails_seven_compatible? ++ expect(subject.attr_encrypted_encrypted_attributes[:otp_secret][:mode]).to eq(:per_attribute_iv_and_salt) ++ else ++ expect(subject.encrypted_attributes[:otp_secret][:mode]).to eq(:per_attribute_iv_and_salt) ++ end + end + + it 'should be of the mode' do +- expect(subject.encrypted_attributes[:otp_secret][:algorithm]).to eq('aes-256-cbc') ++ if attr_encrypted_is_rails_seven_compatible? ++ expect(subject.attr_encrypted_encrypted_attributes[:otp_secret][:algorithm]).to eq('aes-256-cbc') ++ else ++ expect(subject.encrypted_attributes[:otp_secret][:algorithm]).to eq('aes-256-cbc') ++ end ++ end ++ ++ def attr_encrypted_is_rails_seven_compatible? ++ Gem::Version.new(AttrEncrypted::Version.string) >= Gem::Version.new('4.0.0') + end + end + end