-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename TrustedProxyFilter class #2477
Conversation
lib/conjur/trusted_proxy_filter.rb
Outdated
# the trusted proxies to be configured using the environment variable, | ||
# `TRUSTED_PROXIES`. | ||
# | ||
# The value of `TRUSTED_PROXIES` must be a comma-separated list of IP | ||
# addresses or IP address ranges using CIDR notation. | ||
# | ||
# Example: TRUSTED_PROXIES=4.4.4.4,192.168.100.0/24 | ||
class TrustedProxyFilter | ||
class IsIpTrusted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
lib/conjur/is_ip_trusted.rb
Outdated
# addresses or IP address ranges using CIDR notation. | ||
# | ||
# Example: TRUSTED_PROXIES=4.4.4.4,192.168.100.0/24 | ||
class IsIpTrusted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
lib/conjur/is_ip_trusted.rb
Outdated
# | ||
# Example: TRUSTED_PROXIES=4.4.4.4,192.168.100.0/24 | ||
class IsIpTrusted | ||
def initialize(config:, disable_cache: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conjur::IsIpTrusted#initialize has boolean parameter 'disable_cache'
lib/conjur/is_ip_trusted.rb
Outdated
|
||
return [] unless trusted_proxies | ||
|
||
Set.new(trusted_proxies). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place the . on the next line, together with the method name.
@@ -2,12 +2,12 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the trusted_proxy_filter.rb
and trusted_proxy_filter_spec.rb
files still need to be removed as part of this PR.
0d44c2c
to
e2ee642
Compare
Code Climate has analyzed commit e2ee642 and detected 1 issue on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 89.6% (-1.5% change). View more on Code Climate. |
Superseded by #2484 |
Desired Outcome
This change renames the TrustedProxyFilter class to IsIPTrusted. The new name better describes what the class does.
This issue addresses #2176
Implemented Changes
The TrustedProxyFilter class has been renamed to a more apt name IsIpTrusted.
The RSpec tests for this have been changed to reflect the same
The config initializer now refers to the new class name.
Connected Issue/Story
Issue 2176
Definition of Done
The new class name reflects in all the places where the old class name was used.