cobalt-rubocop 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd065596ae4e92888e92dabb5f30c1ef58420633090f455e1b8243ca29a29a9e
4
- data.tar.gz: 0d73e78f813543da948d3da9cea85f892f8c80e02866a69ae3f133ac3a3c422b
3
+ metadata.gz: 5a8b20ef0a6e956161bcf06b505456596556afa73a71c71689546256ec9017b4
4
+ data.tar.gz: 4309706cb33ccc799053fbdf2b2afdd92e5bfaa740acadfe4abbac026b0ea505
5
5
  SHA512:
6
- metadata.gz: e5f9fc4099f495a2439da30053e563eb99d18e6cd90d3b5c48cf079ee9dde5bb54b7462765ca4fb1637cb89085dc63a09723a7c418c3a2c77ac6f618696bf1e7
7
- data.tar.gz: 2e85d5f9491e17043824a7ec9318da665cc37b4f4bd89466bf7bcec653d78e878871d3e8fb6fed5da404d87cb00882d23529d0b8da809c070423731f841fd689
6
+ metadata.gz: ce5b1e998d57140cad9de70902ce00c22b6a11072202c6ea90597b7cb6c49bd4108cf912fa90ee082f901b7f52cb3d146f36c0ebba938a0e8b4938a476c20918
7
+ data.tar.gz: 5760968ed4f9e4f59ee565d9aa0c337d70748a273a804d25c2560c174cf02abcd8cd372c0c1480fb7f53cf1b55f034af1fa27f0484ac52d03ada564fae21fa6f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## main (unreleased)
4
4
 
5
+ ## 1.0.2 (2024-02-01)
6
+
7
+ * Designate SHA3-256 as a secure hashing algorithm
8
+
5
9
  ## 1.0.1 (2023-07-13)
6
10
 
7
11
  * Disable `RSpec/ScatteredSetup` for specs inside `/api`, since it
data/README.md CHANGED
@@ -5,8 +5,19 @@
5
5
  ![Gem Downloads](https://img.shields.io/gem/dt/cobalt-rubocop)
6
6
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
7
7
 
8
+ ## Description
9
+
8
10
  This repository provides recommended linting rules for Ruby repositories.
9
11
 
12
+ ## Contributing
13
+
14
+ If you wish to contribute, please check our guidelines in
15
+ [CONTRIBUTING.md]
16
+
17
+ ## Who to ask for help
18
+
19
+ Ask the [CODEOWNERS]
20
+
10
21
  ## Installation
11
22
 
12
23
  ### Gemfile
@@ -28,12 +39,12 @@ gem 'rubocop-rails', require: false
28
39
  gem 'rubocop-rspec', require: false
29
40
  ```
30
41
 
31
- [Specific versions](https://github.com/cobalthq/cobalt-rubocop/blob/main/cobalt-rubocop.gemspec) installed for:
42
+ [Specific versions] installed for:
32
43
 
33
- - [rubocop](https://github.com/rubocop-hq/rubocop)
34
- - [rubocop-performance](https://github.com/rubocop/rubocop-performance)
35
- - [rubocop-rails](https://github.com/rubocop/rubocop-rails)
36
- - [rubocop-rspec](https://github.com/rubocop/rubocop-rspec)
44
+ - [rubocop]
45
+ - [rubocop-performance]
46
+ - [rubocop-rails]
47
+ - [rubocop-rspec]
37
48
 
38
49
  ### .rubocop.yml
39
50
 
@@ -66,62 +77,12 @@ The number of offences can be counted:
66
77
  grep "Offense count" .rubocop_todo.yml | awk -F: '{sum+=$2} END {print sum}'
67
78
  ```
68
79
 
69
- ## Custom Cops
70
-
71
- ### InsecureHashAlgorithm
72
-
73
- See [Ruby Docs](https://ruby-doc.org/stdlib-2.7.2/libdoc/openssl/rdoc/OpenSSL/Digest.html) for built in hash functions.
74
-
75
- - Default Configuration:
76
-
77
- ```yml
78
- Cobalt/InsecureHashAlgorithm:
79
- Allowed:
80
- - SHA256
81
- - SHA384
82
- - SHA512
83
- ```
84
-
85
- ```ruby
86
- # bad
87
- OpenSSL::Digest::MD5.digest('abc')
88
- OpenSSL::Digest::SHA1.digest('abc')
89
- OpenSSL::HMAC.new('abc', 'sha1')
90
-
91
- # good
92
- OpenSSL::Digest::SHA256.digest('abc')
93
- OpenSSL::Digest::SHA384.digest('abc')
94
- OpenSSL::Digest::SHA512.digest('abc')
95
- OpenSSL::HMAC.new('abc', 'sha256')
96
- ```
97
-
98
- ## Development
99
-
100
- ```shell
101
- git clone git@github.com:cobalthq/cobalt-rubocop.git
102
- bundle install
103
- ```
104
-
105
- ### Testing locally
106
-
107
- In your application, use the `path` attribute to point to your local copy of the gem
108
-
109
- ```ruby
110
- # Use the relative path from your application, to the cobalt-rubocop folder
111
- gem 'cobalt-rubocop', path: '../cobalt-rubocop', require: false
112
- ```
113
-
114
- Alternatively:
115
-
116
- - `rake build`
117
- - `gem install pkg/cobalt-rubocop-<version_number>.gem`
118
-
119
- ## Publish (internal)
120
-
121
- > Note: Publishing a new version of this gem is only meant for maintainers.
80
+ <!-- Links -->
122
81
 
123
- - Ensure you have access to publish on [rubygems](https://rubygems.org/gems/cobalt-rubocop).
124
- - Update [CHANGELOG](https://github.com/cobalthq/cobalt-rubocop/blob/main/CHANGELOG.md).
125
- - Update [`VERSION`](https://github.com/cobalthq/cobalt-rubocop/blob/main/lib/rubocop/cobalt/version.rb).
126
- - `rake release`
127
- - This command builds the gem, creates a tag and publishes to rubygems, see [bundler docs](https://bundler.io/guides/creating_gem.html#releasing-the-gem).
82
+ [CODEOWNERS]: ./CODEOWNERS
83
+ [CONTRIBUTING.md]: ./CONTRIBUTING.md
84
+ [Specific versions]: ./cobalt-rubocop.gemspec
85
+ [rubocop-performance]: https://github.com/rubocop/rubocop-performance
86
+ [rubocop-rails]: https://github.com/rubocop/rubocop-rails
87
+ [rubocop-rspec]: https://github.com/rubocop/rubocop-rspec
88
+ [rubocop]: https://github.com/rubocop-hq/rubocop
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Cobalt
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.2'
6
6
  end
7
7
  end
@@ -77,10 +77,13 @@ module RuboCop
77
77
  %i[hexencode bubblebabble].include?(val)
78
78
  end
79
79
 
80
+ # SHA3-256 is designated as secure by
81
+ # https://github.com/cobalthq/cobalt-pentest-api/blob/main/docs/adr/0019_hash_api_tokens.md
80
82
  DEFAULT_ALLOWED = %w[
81
83
  SHA256
82
84
  SHA384
83
85
  SHA512
86
+ SHA3-256
84
87
  ].freeze
85
88
 
86
89
  def allowed_hash_functions
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobalt-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cobalt Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-13 00:00:00.000000000 Z
11
+ date: 2024-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.4.1
122
+ rubygems_version: 3.4.10
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Cobalt RuboCop