Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

ajay-vel
Copy link
Contributor

@ajay-vel ajay-vel commented Feb 2, 2022

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.

@ajay-vel ajay-vel requested a review from a team as a code owner February 2, 2022 16:16
@ajay-vel ajay-vel requested a review from micahlee February 2, 2022 16:16
# 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
Copy link

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.

# addresses or IP address ranges using CIDR notation.
#
# Example: TRUSTED_PROXIES=4.4.4.4,192.168.100.0/24
class IsIpTrusted
Copy link

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.

#
# Example: TRUSTED_PROXIES=4.4.4.4,192.168.100.0/24
class IsIpTrusted
def initialize(config:, disable_cache: true)
Copy link

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'


return [] unless trusted_proxies

Set.new(trusted_proxies).
Copy link

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 @@

Copy link
Contributor

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.

@ajay-vel ajay-vel force-pushed the 2176-rename-trusted-proxy-filter-class branch from 0d44c2c to e2ee642 Compare February 3, 2022 15:09
@codeclimate
Copy link

codeclimate bot commented Feb 3, 2022

Code Climate has analyzed commit e2ee642 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

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.

@micahlee
Copy link
Contributor

micahlee commented May 3, 2022

Superseded by #2484

@micahlee micahlee closed this May 3, 2022
@micahlee micahlee deleted the 2176-rename-trusted-proxy-filter-class branch May 3, 2022 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants