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

Fix bugs when encryption flow is enabled in the API #33

Merged
merged 15 commits into from
Jan 9, 2018
Merged

Conversation

holachuy
Copy link
Collaborator

@holachuy holachuy commented Jan 9, 2018

This is a collection of bug fixes to complete the implementation of the encryption flow (using encrypted auth credentials in cookies and storing metadata state in storage) for the API server. #3

@holachuy holachuy self-assigned this Jan 9, 2018
@holachuy holachuy added this to the Stable Infrastructure milestone Jan 9, 2018
@@ -1,5 +1,6 @@
env: LOCAL
cloud: LOCAL
encryptedFlow: true
Copy link
Member

Choose a reason for hiding this comment

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

Just a note, for the encrypted flow, we need to bring up the worker binary separately when testing locally right? Is there already documentation around that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reverted. This is not ready yet.

@@ -16,14 +16,15 @@
package org.dataportabilityproject.webapp;

import static org.apache.axis.transport.http.HTTPConstants.HEADER_SET_COOKIE;
import static org.apache.axis.transport.http.HTTPConstants.HEADER_SET_COOKIE2;
Copy link
Member

Choose a reason for hiding this comment

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

remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,58 @@
package org.dataportabilityproject.job;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: license header missing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -1,2 +1,11 @@
env: LOCAL
Copy link
Member

Choose a reason for hiding this comment

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

Isnt this file copied over by the build script?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me add a .gitignore

Copy link
Member

Choose a reason for hiding this comment

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

This file still shows up in the diff of the request

/**
* Deletes an existing {@code job} in storage with the given {@code jobState}.
*/
public void deleteJob(String id, JobState jobState) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like deleteJob is only called in testing - is this something that we can expose for TestOnly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we'll eventually need it when implementing the restart/recovery parts of the lifecycle

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, that makes sense! Thanks!

@@ -39,7 +39,7 @@
* The value ASSIGNED_WITHOUT_AUTH_DATA indicates the client has submitted all data required, such as the
* encrypted auth data, in order to begin processing the portability job.
*/
enum JobState {
public enum JobState {
Copy link
Member

Choose a reason for hiding this comment

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

This also looks like (outside of this class) its only used in Test, is there a way we can limit the visibility?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Annotated with @VisibleForTesting

@holachuy
Copy link
Collaborator Author

holachuy commented Jan 9, 2018

Thanks for the review. I think I addressed all the comments. PTAL.

@@ -1,2 +1,11 @@
env: LOCAL
Copy link
Member

Choose a reason for hiding this comment

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

This file still shows up in the diff of the request

/**
* Deletes an existing {@code job} in storage with the given {@code jobState}.
*/
public void deleteJob(String id, JobState jobState) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Oh right, that makes sense! Thanks!

Copy link
Collaborator Author

@holachuy holachuy left a comment

Choose a reason for hiding this comment

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

This is deleted

@holachuy holachuy merged commit b3c2212 into master Jan 9, 2018
@holachuy holachuy deleted the worker branch January 9, 2018 23:44
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.

None yet

2 participants