Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 0 additions & 66 deletions .github/workflows/jira.yaml

This file was deleted.

14 changes: 9 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / Vault ${{ matrix.vault }}
strategy:
fail-fast: false
matrix:
# https://endoflife.date/ruby
ruby: ["3.1", "3.2", "3.3", "3.4"]
vault: ["1.16.3", "1.19.5", "1.20.4", "1.21.1"]
ruby: ["3.2", "3.3", "3.4", "4.0"]
# https://endoflife.date/rails
rails: ["7.2", "8.0", "8.1"]
# https://developer.hashicorp.com/vault/docs/enterprise/lts
vault: ["1.16.3", "1.19.5", "1.20.4", "1.21.2"]
runs-on: ubuntu-latest
timeout-minutes: 5
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ruby/setup-ruby@32110d4e311bd8996b2a82bf2a43b714ccc91777 # v1.221.0
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Vault Rails Changelog

## v0.12.0 (February 4, 2026)

BREAKING CHANGES

- Set minimum Ruby version to 3.2 (Ruby 3.1 reaches EOL March 31, 2025)
- Set minimum Rails version to 7.0 (Rails 6.1 and earlier are EOL)
- Updated vault-ruby dependency from ~> 0.19 to ~> 0.20

IMPROVEMENTS

- Restored Rails version matrix testing in CI (was accidentally dropped during CircleCI to GitHub Actions migration)
- Updated CI to test currently supported Rails versions: 7.2, 8.0, 8.1
- Updated CI to test Ruby versions: 3.2, 3.3, 3.4, 4.0
- Updated CI to test currently supported Vault versions: 1.16.3 (LTS), 1.19.5 (LTS), 1.20.4, 1.21.2
- Changed default Rails version in Gemfile from 6.0.0 to 7.2.0
- Updated sqlite3 dependency from ~> 1.3.6 to >= 1.4 for Rails 7+ compatibility

## v0.11.0 (December 3, 2025)

BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Submit a helpdesk ticket to add any team other than yours referenced in the CODEOWNERS file -- they must be added to collaborators and teams in the repository settings with maintainer privileges. Remove this file as soon as you have completed this
* @hashicorp/team-tf-principals
8 changes: 2 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@

source "https://rubygems.org"

RAILS_VERSION = ENV.fetch("RAILS_VERSION", "6.0.0")
RAILS_VERSION = ENV.fetch("RAILS_VERSION", "7.2.0")

gem "rails", "~> #{RAILS_VERSION}"

# Rails versions before 7.1 have a dependency on concurrent-ruby but
# Rails versions before 7.1 have a dependency on concurrent-ruby but
# we need to pin to 1.3.4 because later versions removed a dependency on Logger
# that we need to start tests.
gem "concurrent-ruby", "1.3.4"

if RAILS_VERSION.start_with?("6")
gem "sqlite3", "~> 1.4"
end

gemspec
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Vault is the official Rails plugin for interacting with [Vault](https://vaultpro
different APIs than the most recently released version. Please see the Git tag that corresponds to your version of the
Vault Rails plugin for the proper documentation.**

## Requirements

- Ruby 3.2+
- Rails 7.0+
- Vault 1.16+ (LTS and current releases supported)

## Table of Contents
1. [Quick Start](#quick-start)
1. [Advanced Configuration](#advanced-configuration)
Expand Down
10 changes: 1 addition & 9 deletions lib/vault/encrypted_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,7 @@ def __vault_persist_attribute!(attribute, options)

# Only persist changed attributes to minimize requests - this helps
# minimize the number of requests to Vault.
if ActiveRecord.gem_version >= Gem::Version.new("6.0")
return unless previous_changes.include?(attribute)
elsif ActiveRecord.gem_version >= Gem::Version.new("5.2")
return unless previous_changes_include?(attribute)
elsif ActiveRecord.gem_version >= Gem::Version.new("5.1")
return unless saved_change_to_attribute?(attribute.to_s)
else
return unless attribute_changed?(attribute)
end
return unless previous_changes.include?(attribute)

# Get the current value of the plaintext attribute
plaintext = attributes[attribute.to_s]
Expand Down
2 changes: 1 addition & 1 deletion lib/vault/rails/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Vault
module Rails
VERSION = "0.11.0"
VERSION = "0.12.0"
end
end
5 changes: 0 additions & 5 deletions spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,4 @@

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

# Use native SQLite integers as booleans in Rails 5.2+
if ActiveRecord.gem_version >= Gem::Version.new("5.2")
config.active_record.sqlite3.represent_boolean_as_integer = true
end
end
14 changes: 2 additions & 12 deletions spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance.
if config.respond_to?(:public_file_server)
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
else
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'
end
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }

# Show full error reports and disable caching.
config.consider_all_requests_local = true
Expand All @@ -41,9 +36,4 @@

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

# Use native SQLite integers as booleans in Rails 5.2+
if ActiveRecord.gem_version >= Gem::Version.new("5.2")
config.active_record.sqlite3.represent_boolean_as_integer = true
end
end
2 changes: 2 additions & 0 deletions spec/dummy/config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
# Rails 7+ made the asset pipeline (Sprockets) optional. The assets config
# only exists if sprockets-rails is in the Gemfile.
if Rails.application.config.respond_to?(:assets)
Rails.application.config.assets.version = '1.0'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
wrap_parameters format: [:json]
end

# To enable root element in JSON for ActiveRecord objects.
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/encrypted_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
describe Vault::EncryptedModel do
let(:klass) do
Class.new(ActiveRecord::Base) do
# Rails 7.2+ requires table_name to be set explicitly for anonymous classes
self.table_name = "people"
include Vault::EncryptedModel
end
end
Expand Down
10 changes: 4 additions & 6 deletions vault.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,21 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["spec/**/*"]

s.required_ruby_version = ">= 3.1"
s.required_ruby_version = ">= 3.2"

s.add_dependency "activesupport", ">= 5.0"
s.add_dependency "vault", "~> 0.19"
s.add_dependency "activesupport", ">= 7.0"
s.add_dependency "vault", "~> 0.20"
# mutex_m was removed from Ruby's default gems in 3.4.0
# Rails 6.0 depends on it but doesn't declare it explicitly
s.add_dependency "mutex_m"
# bigdecimal was removed from Ruby's default gems in 3.4.0
# Rails 6.0 depends on it but doesn't declare it explicitly
s.add_dependency "bigdecimal"

s.add_development_dependency "bundler"
s.add_development_dependency "pry"
s.add_development_dependency "pry-byebug"
s.add_development_dependency "rake", "~> 12.3.3"
s.add_development_dependency "rspec", "~> 3.2"
s.add_development_dependency "sqlite3", "~> 1.3.6"
s.add_development_dependency "sqlite3", ">= 1.4"
# ostruct will be removed from Ruby's default gems in 3.5.0
# rake 12.3.3 depends on it but doesn't declare it explicitly
s.add_development_dependency "ostruct"
Expand Down