-
Notifications
You must be signed in to change notification settings - Fork 21
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 ability to mask object key prefixes in logs #402
Conversation
027e2ef
to
5e01385
Compare
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class ObjectKeyFactoryTest { |
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.
Renamed from ObjectKeyTest.java
+ prefixMasking*
tests added.
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class ObjectKeyTest { |
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.
Renamed into ObjectKeyFactoryTest
5e01385
to
b024730
Compare
throw new KeyNotFoundException(this, key, e); | ||
throw new KeyNotFoundException(this, key); |
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.
This is needed to satisfy the new tests for masking in BaseStorageTest
. I don't think we that badly need this inner exception in the file system storage implementation to make the test more complex, so I just decided to remove it. The same below.
return "masked-key"; | ||
} | ||
}; | ||
|
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.
Deletions don't throw exceptions when keys don't exist => not tested here.
integrationTestImplementation "org.wiremock:wiremock:$wireMockVersion" | ||
|
||
integrationTestImplementation("org.wiremock:wiremock:$wireMockVersion") { | ||
exclude group: "org.slf4j" |
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 screws up logging in s3
tests otherwise. Doing in this PR because I needed it for visual validation of masking.
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.
LGTM, apart from some nits.
core/src/test/java/io/aiven/kafka/tieredstorage/ObjectKeyFactoryTest.java
Outdated
Show resolved
Hide resolved
storage/core/src/testFixtures/java/io/aiven/kafka/tieredstorage/storage/TestObjectKey.java
Show resolved
Hide resolved
b024730
to
7fba3dd
Compare
See individual commits for details.