diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index aa97e97..a6e76c3 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -18,6 +18,7 @@ on: permissions: contents: read + id-token: write packages: write jobs: @@ -40,16 +41,13 @@ jobs: - name: Build gem run: gem build active_cipher_storage.gemspec + - name: Configure RubyGems credentials + if: github.event_name == 'release' || inputs.publish_to_rubygems + uses: rubygems/configure-rubygems-credentials@v1.0.0 + - name: Publish to RubyGems if: github.event_name == 'release' || inputs.publish_to_rubygems - env: - GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}" - run: | - mkdir -p "$HOME/.gem" - touch "$HOME/.gem/credentials" - chmod 0600 "$HOME/.gem/credentials" - printf -- "---\n:rubygems_api_key: %s\n" "$GEM_HOST_API_KEY" > "$HOME/.gem/credentials" - gem push active_cipher_storage-*.gem + run: gem push active_cipher_storage-*.gem - name: Publish to GitHub Packages if: inputs.publish_to_github_packages diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 77efda9..9a15204 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -32,10 +32,26 @@ jobs: - name: Run tests run: bundle exec rake + lint: + name: RuboCop + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler-cache: true + + - name: Run RuboCop + run: bundle exec rubocop + build: name: Build gem runs-on: ubuntu-latest - needs: test + needs: [test, lint] steps: - uses: actions/checkout@v4 diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..f5ef90a --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,132 @@ +AllCops: + NewCops: enable + SuggestExtensions: false + TargetRubyVersion: 3.2 + Exclude: + - "coverage/**/*" + - "pkg/**/*" + - "vendor/**/*" + - ".worktrees/**/*" + - "examples/**/*" + +Style/Documentation: + Enabled: false + +Metrics/BlockLength: + Exclude: + - "active_cipher_storage.gemspec" + - "spec/**/*" + +Bundler/OrderedGems: + Enabled: false + +Gemspec/DevelopmentDependencies: + Enabled: false + +Gemspec/OrderedDependencies: + Enabled: false + +Layout/ArgumentAlignment: + Enabled: false + +Layout/EmptyLineAfterGuardClause: + Enabled: false + +Layout/ExtraSpacing: + Enabled: false + +Layout/FirstArgumentIndentation: + Enabled: false + +Layout/FirstHashElementIndentation: + Enabled: false + +Layout/HashAlignment: + Enabled: false + +Layout/LineEndStringConcatenationIndentation: + Enabled: false + +Layout/MultilineMethodCallBraceLayout: + Enabled: false + +Layout/SpaceAroundOperators: + Enabled: false + +Lint/AmbiguousOperatorPrecedence: + Enabled: false + +Lint/ConstantDefinitionInBlock: + Enabled: false + +Lint/EmptyBlock: + Enabled: false + +Lint/MissingSuper: + Enabled: false + +Lint/UnusedMethodArgument: + Enabled: false + +Metrics/AbcSize: + Enabled: false + +Metrics/ClassLength: + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Naming/BlockForwarding: + Enabled: false + +Naming/MethodParameterName: + Enabled: false + +Naming/RescuedExceptionsVariableName: + Enabled: false + +Style/ArgumentsForwarding: + Enabled: false + +Style/BitwisePredicate: + Enabled: false + +Style/BlockDelimiters: + Enabled: false + +Style/FrozenStringLiteralComment: + Enabled: false + +Style/IfUnlessModifier: + Enabled: false + +Style/MultilineIfModifier: + Enabled: false + +Style/MultilineTernaryOperator: + Enabled: false + +Style/MutableConstant: + Enabled: false + +Style/RescueStandardError: + Enabled: false + +Style/StringConcatenation: + Enabled: false + +Style/StringLiterals: + Enabled: false + +Style/TrivialAccessors: + Enabled: false + +Style/YodaCondition: + Enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 733bb61..cd1938d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,11 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht ## [Unreleased] -## [0.1.0] - 2026-04-25 +## [1.0.0] - 2026-04-25 ### Added -- Initial ActiveCipherStorage gem implementation. +- Initial public ActiveCipherStorage gem release. - Transparent Rails Active Storage encryption service. - Direct S3 encrypted upload, download, streaming, and multipart support. - Backend-managed encrypted multipart uploads for frontend chunk upload flows. @@ -20,5 +20,5 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht - Header-only key rotation for re-wrapping encrypted DEKs. - Unit and integration coverage for crypto, providers, Active Storage, S3, multipart upload, streaming, metadata, and key rotation. -[Unreleased]: https://github.com/codebyjass/active-cipher-storage/compare/v0.1.0...HEAD -[0.1.0]: https://github.com/codebyjass/active-cipher-storage/releases/tag/v0.1.0 +[Unreleased]: https://github.com/codebyjass/active-cipher-storage/compare/v1.0.0...HEAD +[1.0.0]: https://github.com/codebyjass/active-cipher-storage/releases/tag/v1.0.0 diff --git a/Gemfile.lock b/Gemfile.lock index fd6c558..af484cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - active_cipher_storage (0.1.0) + active_cipher_storage (1.0.0) concurrent-ruby (~> 1.2) GEM @@ -51,6 +51,7 @@ GEM securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) + ast (2.4.3) aws-eventstream (1.4.0) aws-partitions (1.1240.0) aws-sdk-core (3.245.0) @@ -88,6 +89,8 @@ GEM concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.19.4) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) logger (1.7.0) loofah (2.25.1) crass (~> 1.0.2) @@ -100,6 +103,10 @@ GEM racc (~> 1.4) nokogiri (1.19.2-x86_64-linux-gnu) racc (~> 1.4) + parallel (1.28.0) + parser (3.3.11.1) + ast (~> 2.4.1) + racc prism (1.9.0) racc (1.8.1) rack (3.2.6) @@ -115,7 +122,9 @@ GEM rails-html-sanitizer (1.7.0) loofah (~> 2.25) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rainbow (3.1.1) rake (13.4.2) + regexp_parser (2.12.0) rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -129,6 +138,21 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.7) + rubocop (1.86.1) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.1) + parser (>= 3.3.7.2) + prism (~> 1.7) + ruby-progressbar (1.13.0) securerandom (0.4.1) simplecov (0.22.0) docile (~> 1.1) @@ -139,6 +163,9 @@ GEM timeout (0.6.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) uri (1.1.1) useragent (0.16.11) @@ -157,6 +184,7 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.12) rspec-mocks (~> 3.12) + rubocop (~> 1.0) simplecov (~> 0.22) BUNDLED WITH diff --git a/Rakefile b/Rakefile index a0a35e5..dbabdae 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,12 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" +require "rubocop/rake_task" RSpec::Core::RakeTask.new(:spec) RSpec::Core::RakeTask.new("spec:unit") { |t| t.pattern = "spec/unit/**/*_spec.rb" } RSpec::Core::RakeTask.new("spec:integration") { |t| t.pattern = "spec/integration/**/*_spec.rb" } +RuboCop::RakeTask.new(:rubocop) + +task lint: :rubocop task default: :spec diff --git a/active_cipher_storage.gemspec b/active_cipher_storage.gemspec index cff2fc8..84d8db3 100644 --- a/active_cipher_storage.gemspec +++ b/active_cipher_storage.gemspec @@ -48,6 +48,7 @@ Gem::Specification.new do |spec| # Dev/test spec.add_development_dependency "rspec", "~> 3.12" spec.add_development_dependency "rspec-mocks", "~> 3.12" + spec.add_development_dependency "rubocop", "~> 1.0" spec.add_development_dependency "simplecov", "~> 0.22" spec.add_development_dependency "faker", "~> 3.0" spec.add_development_dependency "rake", "~> 13.0" diff --git a/lib/active_cipher_storage/version.rb b/lib/active_cipher_storage/version.rb index 36475de..35c7887 100644 --- a/lib/active_cipher_storage/version.rb +++ b/lib/active_cipher_storage/version.rb @@ -1,3 +1,3 @@ module ActiveCipherStorage - VERSION = "0.1.0" + VERSION = "1.0.0" end