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

Add a private selector to the include and exclude filters. #23

Closed

Conversation

kwilczynski
Copy link

This commit adds support for a private selector to the include and exclude
filters allowing to filter out private IP addresses accordingly leveraging RFC
6890 to identify a private IP addresses. This new functionality would be the
eval equivalent of (using include as an example):

  $ sockaddr eval -r '{{ GetAllInterfaces | include "rfc" "6890" }}'

Signed-off-by: Krzysztof Wilczynski kw@linux.com

@kwilczynski
Copy link
Author

Unit tests (omitting -v due to a lengthy output):

 go test -run TestIncludeExcludeIfs
PASS
ok  	github.com/hashicorp/go-sockaddr	0.029s

@kwilczynski kwilczynski force-pushed the f-add-private-selector branch from a683306 to 06f5d0d Compare May 15, 2018 23:58
This commit adds support for a `private` selector to the `include` and `exclude`
filters allowing to filter out private IP addresses accordingly leveraging RFC
6890 to identify a private IP addresses. This new functionality would be the
`eval` equivalent of (using include as an example):

````
  $ sockaddr eval -r '{{ GetAllInterfaces | include "rfc" "6890" }}'
````

Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
@kwilczynski kwilczynski force-pushed the f-add-private-selector branch from 06f5d0d to bd55e00 Compare May 16, 2018 00:06
@kwilczynski
Copy link
Author

After speaking with @sean- about this we decided that this is not an appropriate addition. As convenience as it is, it adds a special snowflake of a use-case to make it work, and therefore we do not want to support it (more special code carries out the burden of having to special a special case of some sort, and I fully agree with this).

@kwilczynski kwilczynski deleted the f-add-private-selector branch May 16, 2018 17:09
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.

1 participant