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

logging: add support for hashing data #4434

Merged
merged 3 commits into from
Dec 2, 2021

Conversation

dunglas
Copy link
Collaborator

@dunglas dunglas commented Nov 23, 2021

Follows #4424, #4425 and #4426. Implements a hash filter and hash actions for the query and cookie filters ask suggested by @wiese in #4424 (comment).

@francislavoie francislavoie added the feature ⚙️ New feature or request label Nov 23, 2021
@francislavoie francislavoie added this to the v2.5.0 milestone Nov 23, 2021
@francislavoie francislavoie added the under review 🧐 Review is pending before merging label Nov 23, 2021
Copy link
Contributor

@wiese wiese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for taking this on, @dunglas!

I can imagine the hash filter become more configurable (hashing algorithm, digest length) in the future, similar to what we see in the replace filter (which has the new value passed to it), for which this is a great basis. This would then also render obsolete any (subjective) concerns about the concrete values used.

modules/logging/filters.go Outdated Show resolved Hide resolved
modules/logging/filters.go Outdated Show resolved Hide resolved
modules/logging/filters.go Show resolved Hide resolved
@dunglas
Copy link
Collaborator Author

dunglas commented Nov 24, 2021

I thought about that but I was wondering if it's really necessary to introduce (and maintain) such features. I fail to see a use case.

@francislavoie
Copy link
Member

I agree, I don't think we need to make the hashing configurable. 4 bytes is 8 hex characters, which is plenty. Git gets away with less (usually 7 chars) most of the time. 16 ^ 8 = 4.2 billion. If someone later comes up with a real usecase, we can add it without too much trouble. But I don't think we should implement something early without a good reason.

dunglas and others added 2 commits November 25, 2021 10:25
Co-authored-by: wiese <wiese@users.noreply.github.com>
Co-authored-by: wiese <wiese@users.noreply.github.com>
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kevin! This looks good to me.

@mholt mholt merged commit a1b417c into caddyserver:master Dec 2, 2021
@mholt mholt removed the under review 🧐 Review is pending before merging label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants