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

First release of E2E #92

Merged
merged 16 commits into from Jan 9, 2018

Conversation

Projects
None yet
3 participants
@tobiasKaminsky
Copy link
Member

commented Sep 27, 2017

This is the first release to support end to end encryption.
Server app is needed: https://github.com/nextcloud/end_to_end_encryption

@nextcloud nextcloud deleted a comment from codacy-bot Sep 27, 2017

@nextcloud nextcloud deleted a comment from codacy-bot Sep 27, 2017

@nextcloud nextcloud deleted a comment from codacy-bot Sep 27, 2017

prop = propSet.get(EXTENDED_PROPERTY_IS_ENCRYPTED, Namespace.getNamespace(NAMESPACE_NC));
if (prop != null) {
String encryptedValue = (String) prop.getValue();
if ("1".equals(encryptedValue)) {

This comment has been minimized.

Copy link
@AndyScherzinger

AndyScherzinger Nov 6, 2017

Member

Can we make "1" a constant so this gets the look of a business rule to be read like if (IS_ENCRYPTED.equals(encryptedValue)) ?

}
} catch (Exception e) {
result = new RemoteOperationResult(e);
e.printStackTrace();

This comment has been minimized.

Copy link
@AndyScherzinger

AndyScherzinger Nov 6, 2017

Member

Please use a logger instead :)

This comment has been minimized.

Copy link
@AndyScherzinger

AndyScherzinger Nov 6, 2017

Member

nevermind, it is just in the next line.

This comment has been minimized.

Copy link
@tobiasKaminsky

tobiasKaminsky Nov 28, 2017

Author Member

👍 still it is not useful to print a stacktrace.

/**
* Lock a file
*/

This comment has been minimized.

Copy link
@AndyScherzinger

AndyScherzinger Nov 6, 2017

Member

please remove empty line

@AndyScherzinger

This comment has been minimized.

Copy link
Member

commented Nov 6, 2017

Only minor comments, only thing I am unsure about is if the e.printStackTrace(); statements should be removed.

@tobiasKaminsky tobiasKaminsky referenced this pull request Dec 20, 2017

Closed

First release of E2E #1598

10 of 12 tasks complete
PARAM_SINGLE_COOKIE_HEADER, // to avoid problems with some web servers
PARAM_SINGLE_COOKIE_HEADER_VALUE);
getParams().setParameter(HttpMethodParams.USER_AGENT, userAgent);
getParams().setParameter(PARAM_PROTOCOL_VERSION, HttpVersion.HTTP_1_1);

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Why 1.1?

This comment has been minimized.

}
} catch (Exception e) {
result = new RemoteOperationResult(e);
e.printStackTrace();

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Please remove.

deleteMethod = new DeleteMethod(client.getBaseUri() + LOCK_FILE_URL + localId);
deleteMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
deleteMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded");
deleteMethod.addRequestHeader("token", token);

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

put "token" in private static final variable please. Not a huge fan of this, but consistency shrug

// remote request
putMethod = new PutMethod(client.getBaseUri() + METADATA_URL + fileId);
putMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
putMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded");

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Content-Type as private static final pls.

putMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded");

NameValuePair[] putParams = new NameValuePair[2];
putParams[0] = new NameValuePair("token", token);

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Token and format too pls.


} catch (Exception e) {
result = new RemoteOperationResult(e);
e.printStackTrace();

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Remove.

}
} catch (Exception e) {
result = new RemoteOperationResult(e);
e.printStackTrace();

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Remove.

// remote request
postMethod = new PostMethod(client.getBaseUri() + PUBLIC_KEY_URL + JSON_FORMAT);
postMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
postMethod.setParameter("csr", csr);

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

csr s private static final pls.


} catch (Exception e) {
result = new RemoteOperationResult(e);
e.printStackTrace();

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

Remove.

// remote request
postMethod = new PostMethod(client.getBaseUri() + PRIVATE_KEY_URL + JSON_FORMAT);
postMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
postMethod.setParameter("privateKey", privateKey);

This comment has been minimized.

Copy link
@mario

mario Jan 7, 2018

Member

privateKey as private static final.

@tobiasKaminsky tobiasKaminsky referenced this pull request Jan 8, 2018

Closed

Release 3.0 - Roadmap #1884

52 of 57 tasks complete
@tobiasKaminsky

This comment has been minimized.

Copy link
Member Author

commented Jan 8, 2018

@mario thanks for the CR, I fixed everything and rebased the PR.

postMethod = new PostMethod(client.getBaseUri() + LOCK_FILE_URL + localId + JSON_FORMAT);

if (!token.isEmpty()) {
postMethod.setParameter("token", token);

This comment has been minimized.

Copy link
@mario

mario Jan 9, 2018

Member

token should be private static final.

// remote request
postMethod = new PostMethod(client.getBaseUri() + METADATA_URL + fileId + JSON_FORMAT);
postMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
postMethod.setParameter("metaData", encryptedMetadataJson);

This comment has been minimized.

Copy link
@mario

mario Jan 9, 2018

Member

metaData should be private static final.

@mario

This comment has been minimized.

Copy link
Member

commented Jan 9, 2018

@tobiasKaminsky after you fix the two remaining things, feel free to merge. Good job! :)

👍

Approved with PullApprove

tobiasKaminsky added some commits Aug 30, 2017

do not fail if permission is empty/null
correctly set user agent everywhere

tobiasKaminsky added some commits Jan 8, 2018

@tobiasKaminsky

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2018

Merging with only one approval as @AndyScherzinger is on vacation.

@tobiasKaminsky tobiasKaminsky merged commit fca8d44 into master Jan 9, 2018

2 of 3 checks passed

code-review/pullapprove Approval required by 1 of: AndyScherzinger, przybylski
Details
Codacy/PR Quality Review Good work! A positive pull request.
Details
continuous-integration/drone/pr the build was successful
Details

@tobiasKaminsky tobiasKaminsky deleted the e2e branch Jan 9, 2018

@tobiasKaminsky tobiasKaminsky added this to the NC lib 1.0.34 milestone Jan 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.