Skip to content

Core EncryptedLogging code from FluxC#2

Merged
wzieba merged 138 commits intomainfrom
from_fluxc
Apr 16, 2024
Merged

Core EncryptedLogging code from FluxC#2
wzieba merged 138 commits intomainfrom
from_fluxc

Conversation

@wzieba
Copy link
Copy Markdown
Member

@wzieba wzieba commented Apr 15, 2024

Description

This PR introduces core code of the Encrypted Logging feature, taken from FluxC project. In consist all commits that modified those files, with changes of packages and imports, to align with the new project structure.

I did it using filter-repo tool, with the following command:

git filter-repo \
 --path example/src/test/java/org/wordpress/android/fluxc/encryptedlog/EncryptedLogSqlUtilsTest.kt \
 --path-rename example/src/test/java/org/wordpress/android/fluxc/encryptedlog:encryptedlogging/src/test/kotlin/com/automattic/encryptedlogging/encryptedlog \
 --path example/src/androidTest/java/org/wordpress/android/fluxc/release/ReleaseStack_EncryptedLogTest.kt \
 --path-rename example/src/androidTest/java/org/wordpress/android/fluxc/release:encryptedlogging/src/androidTest/kotlin/com/automattic/encryptedlogging/release \
 --path example/src/androidTest/java/org/wordpress/android/fluxc/LogEncrypterTest.kt \
 --path-rename example/src/androidTest/java/org/wordpress/android/fluxc/:encryptedlogging/src/androidTest/kotlin/com/automattic/encryptedlogging/ \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/model/encryptedlogging/EncryptedLog.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/action/EncryptedLogAction.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/model/encryptedlogging/LogEncrypter.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/network/BaseRequest.java \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/network/EncryptedLogUploadRequest.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/encryptedlog/EncryptedLogRestClient.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/persistence/EncryptedLogSqlUtils.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/store/EncryptedLogStore.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/model/encryptedlogging/EncryptedSecretStreamKey.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/model/encryptedlogging/SecretStreamKey.kt \
 --path fluxc/src/main/java/org/wordpress/android/fluxc/model/encryptedlogging/EncryptionUtils.kt \
 --path-rename fluxc/src/main/java/org/wordpress/android/fluxc/:encryptedlogging/src/main/kotlin/com/automattic/encryptedlogging/ \
 --tag-rename '':'fluxc-' \
 --replace-text ~/expressions.txt

where expressions.txt is

org.wordpress.android.fluxc==>com.automattic.encryptedlogging

maxme and others added 30 commits August 2, 2016 11:27
- Also added a method for disabling retries for requests, to be used by creation API calls we don't want accidentally duplicated
…rrors-reported-by-checkstyle

Fix style errors reported by checkstyle
The WPCom authenticator was too narrow a scope for this class, as it's
used by XML-RPC as well (and also WP-API).
…pected-error

Add extra infos to unexpected errors / add url to XMLRPC parse errors
ParaskP7 and others added 26 commits August 9, 2022 14:39
Description: "This rule detects and reports usages of magic numbers in
the code. Prefer defining constants with clear names describing what the
magic number means."

For more info see: https://detekt.dev/docs/rules/style/#magicnumber
Description: "Long lines might be hard to read on smaller screens or
printouts. Additionally, having a maximum line length in the codebase
will help make the code more uniform."

For more info see: https://detekt.dev/docs/rules/style/#maxlinelength
Description: "Having many exit points in a function can be confusing and
impacts readability of the code."

For more info see: https://detekt.dev/docs/rules/style/#returncount
Description: "A class which only contains utility variables and
functions with no concrete implementation can be refactored into an
'object' or a class with a non-public constructor. Furthermore, this
rule reports utility classes which are not final."

For more info see: https://detekt.dev/docs/rules/style/
#utilityclasswithpublicconstructor

Note: As part of this commit, the unused 'versionRegex' was also
removed from the 'WhatsNewAppVersionUtils' utility class.
…etekt-baseline-warnings

[Detekt Baseline Warnings] FluxC Module - Resolve/Suppress Style Warnings
Description: "Exceptions should not be swallowed. This rule reports all
instances where exceptions are 'caught' and not correctly passed
(e.g. as a cause) into a newly thrown exception.

The exception types configured in 'ignoredExceptionTypes' indicate
nonexceptional outcomes. These by default configured exception types are
part of Java. Therefore, Kotlin developers have to handle them by using
the catch clause. For that reason, this rule ignores that these
configured exception types are caught."

For more info see: https://detekt.dev/docs/rules/exceptions
#swallowedexception
Description: "This rule reports catch blocks for exceptions that have a
type that is too generic. It should be preferred to catch specific
exceptions to the case that is currently handled. If the scope of the
caught exception is too broad it can lead to unintended exceptions being
caught."

For more info see: https://detekt.dev/docs/rules/exceptions
#toogenericexceptioncaught
…etekt-baseline-warnings

[Detekt Baseline Warnings] FluxC Module - Resolve/Suppress Other Warnings
This connected test was temporarily disabled as it was only failing in
CircleCI. However, since CircleCI is not longer being used for this
project, and instead, this project is now using Buildkite, this test
is being re-enabled.
While 'testQueueForUpload' passes, 'testQueueForUploadForInvalidUuid'
fails and thus temporarily ignored.
…e-stack-encrypted-log-test

[Test] Re-Enable Release Stack Encrypted Log Connected Test
…rypted-logging-endpoint

Fix a crash that occurs when parsing the result of encrypted-logging endpoint
@wzieba wzieba marked this pull request as ready for review April 16, 2024 15:22
@wzieba wzieba changed the title From fluxc Core EncryptedLogging code from FluxC Apr 16, 2024
@wzieba wzieba merged commit 76f898d into main Apr 16, 2024
@wzieba wzieba deleted the from_fluxc branch April 16, 2024 15:23
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.