[jira] [Commented] (NIFI-2093) Clear state link on Component State window is hidden

2016-06-23 Thread Koji Kawamura (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15345944#comment-15345944
 ] 

Koji Kawamura commented on NIFI-2093:
-

Access policy checks for Controller service and Reporting task have following 
authorization check code:
{code:title=ControllerServiceResource.java}
public Response getState() {
// authorize access
serviceFacade.authorizeAccess(lookup -> {
final Authorizable controllerService = 
lookup.getControllerService(id);
// Shouldn't it be READ?
controllerService.authorize(authorizer, RequestAction.WRITE);
});
}

public Response clearState() {
final boolean validationPhase = isValidationPhase(httpServletRequest);
if (validationPhase || !isTwoPhaseRequest(httpServletRequest)) {
// authorize access
serviceFacade.authorizeAccess(lookup -> {
final Authorizable controllerService = 
lookup.getControllerService(id);
controllerService.authorize(authorizer, RequestAction.WRITE);
});
}
}
{code}

[~mcgilman]
Do we need something in addition to that? BTW, getState authorizes WRITE 
action. Shouldn't it be READ?

> Clear state link on Component State window is hidden
> 
>
> Key: NIFI-2093
> URL: https://issues.apache.org/jira/browse/NIFI-2093
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
> Fix For: 1.0.0
>
> Attachments: ComponentState-ConsumeKafka.png
>
>
> It seems that ComponentStateEntity should have accessPolicy so that 
> CanvasUtis.supportsModification() can handle whether the link is active or 
> not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2078) State management for processors whose states are managed externally

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346016#comment-15346016
 ] 

ASF GitHub Bot commented on NIFI-2078:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/563
  
Integration test with Kerberized Kafka and Zookeeper haven't finished yet, 
but the implementation is done. Would you please initiate the code review 
process?

This PR added External State management functionality to GetKafka and 
ConsumeKafka as following screenshot:


![componentstate-consumekafka](https://cloud.githubusercontent.com/assets/1107620/16295638/f31a3c1e-3962-11e6-9b71-63f4f581e199.png)



> State management for processors whose states are managed externally
> ---
>
> Key: NIFI-2078
> URL: https://issues.apache.org/jira/browse/NIFI-2078
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Core Framework
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
> Fix For: 1.0.0
>
>
> Inherently by the nature of a given processor it may involve state managed by 
> itself (using nifi state management), or can be managed by some external 
> service it interacts with (kafka's offset), and theoretically some might have 
> both going on. With the new state management, we're giving users a way to 
> reset state managed by nifi for a given processor. But it doesnt apply to 
> those processors who have external state.
> we should consider offering a way to reset state that allows a processor to 
> call out to whatever external store it impacts



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2093) Clear state link on Component State window is hidden

2016-06-23 Thread Matt Gilman (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346335#comment-15346335
 ] 

Matt Gilman commented on NIFI-2093:
---

[~ijokarumawak] I was referring to client side. Whether the Clear link is 
activate or not is based on a flag passed into the showState function in 
nf-component-state.js. If you look where this is called from we already account 
for the access controls for Processors via calling supportsModification. 
However, I didn't notice a comparable check for Controller Services and 
Reporting Tasks.

I believe the check on the server side is accurate. In our 0.x baseline, 
viewing and clearing state are actions that are reserved for a Data Flow 
Manager. Meaning that read only users are not allowed to view or clear state. 
In our new component based access model, that would equate to requiring WRITE 
access for the component. I think we made the decision on requiring DFM role in 
0.x because state is a very low level concept and not something that a MONITOR 
user should be concerned with.

> Clear state link on Component State window is hidden
> 
>
> Key: NIFI-2093
> URL: https://issues.apache.org/jira/browse/NIFI-2093
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
> Fix For: 1.0.0
>
> Attachments: ComponentState-ConsumeKafka.png
>
>
> It seems that ComponentStateEntity should have accessPolicy so that 
> CanvasUtis.supportsModification() can handle whether the link is active or 
> not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (NIFI-2093) Clear state link on Component State window is hidden

2016-06-23 Thread Matt Gilman (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346335#comment-15346335
 ] 

Matt Gilman edited comment on NIFI-2093 at 6/23/16 12:25 PM:
-

[~ijokarumawak] I was referring to client side. Whether the Clear link is 
activate or not is based on a flag passed into the showState function in 
nf-component-state.js. If you look where this is called from we already account 
for the access controls for Processors via calling supportsModification. 
However, I didn't notice a comparable check for Controller Services and 
Reporting Tasks. What's there may be ok if we're already checking the access 
controls prior to that point but its something that I wanted to make sure was 
re-visited.

I believe the check on the server side is accurate. In our 0.x baseline, 
viewing and clearing state are actions that are reserved for a Data Flow 
Manager. Meaning that read only users are not allowed to view or clear state. 
In our new component based access model, that would equate to requiring WRITE 
access for the component. I think we made the decision on requiring DFM role in 
0.x because state is a very low level concept and not something that a MONITOR 
user should be concerned with.


was (Author: mcgilman):
[~ijokarumawak] I was referring to client side. Whether the Clear link is 
activate or not is based on a flag passed into the showState function in 
nf-component-state.js. If you look where this is called from we already account 
for the access controls for Processors via calling supportsModification. 
However, I didn't notice a comparable check for Controller Services and 
Reporting Tasks.

I believe the check on the server side is accurate. In our 0.x baseline, 
viewing and clearing state are actions that are reserved for a Data Flow 
Manager. Meaning that read only users are not allowed to view or clear state. 
In our new component based access model, that would equate to requiring WRITE 
access for the component. I think we made the decision on requiring DFM role in 
0.x because state is a very low level concept and not something that a MONITOR 
user should be concerned with.

> Clear state link on Component State window is hidden
> 
>
> Key: NIFI-2093
> URL: https://issues.apache.org/jira/browse/NIFI-2093
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
> Fix For: 1.0.0
>
> Attachments: ComponentState-ConsumeKafka.png
>
>
> It seems that ComponentStateEntity should have accessPolicy so that 
> CanvasUtis.supportsModification() can handle whether the link is active or 
> not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (NIFI-2044) Require revision for component creation

2016-06-23 Thread Matt Gilman (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman reassigned NIFI-2044:
-

Assignee: Matt Gilman

> Require revision for component creation
> ---
>
> Key: NIFI-2044
> URL: https://issues.apache.org/jira/browse/NIFI-2044
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework, Core UI
>Reporter: Matt Gilman
>Assignee: Matt Gilman
> Fix For: 1.0.0
>
>
> - When creating a component, require the revision to be specified to ensure 
> we're using the appropriate client id.
> - Perform proper authorization when components are created via PUT.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2095) Introduce UI for managing Users & User Groups

2016-06-23 Thread Matt Gilman (JIRA)
Matt Gilman created NIFI-2095:
-

 Summary: Introduce UI for managing Users & User Groups
 Key: NIFI-2095
 URL: https://issues.apache.org/jira/browse/NIFI-2095
 Project: Apache NiFi
  Issue Type: Improvement
  Components: Core UI
Reporter: Matt Gilman
Assignee: Matt Gilman
Priority: Blocker
 Fix For: 1.0.0






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2095) Introduce UI for managing Users & User Groups

2016-06-23 Thread Matt Gilman (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman updated NIFI-2095:
--
Issue Type: Sub-task  (was: Improvement)
Parent: NIFI-1550

> Introduce UI for managing Users & User Groups
> -
>
> Key: NIFI-2095
> URL: https://issues.apache.org/jira/browse/NIFI-2095
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Matt Gilman
>Assignee: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2096) Can't upload template using Firefox

2016-06-23 Thread Rob Moran (JIRA)
Rob Moran created NIFI-2096:
---

 Summary: Can't upload template using Firefox
 Key: NIFI-2096
 URL: https://issues.apache.org/jira/browse/NIFI-2096
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Rob Moran
Priority: Blocker


Tried in FF 42 and 47

>From the Templates shell, clicking the + icon does not trigger the system 
>prompt to choose a file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MINIFI-40) SecurityPropertiesSchema doesn't properly handle empty security properties

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/MINIFI-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346492#comment-15346492
 ] 

ASF GitHub Bot commented on MINIFI-40:
--

Github user brosander closed the pull request at:

https://github.com/apache/nifi-minifi/pull/19


> SecurityPropertiesSchema doesn't properly handle empty security properties
> --
>
> Key: MINIFI-40
> URL: https://issues.apache.org/jira/browse/MINIFI-40
> Project: Apache NiFi MiNiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>
> The SecurityPropertiesSchema class uses the getOptionalKeyAsType method with 
> a default value of null for each of the keystore, truststore and sslProtcol 
> properties. This ends up getting translated to "null" in the nifi.properties 
> file. 
> The correct default should be "". 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2096) Can't upload template using Firefox

2016-06-23 Thread Rob Moran (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rob Moran updated NIFI-2096:

Description: 
Tried in FF 40.0.2 and 47

>From the Templates shell, clicking the + icon does not trigger the system 
>prompt to choose a file.

  was:
Tried in FF 42 and 47

>From the Templates shell, clicking the + icon does not trigger the system 
>prompt to choose a file.


> Can't upload template using Firefox
> ---
>
> Key: NIFI-2096
> URL: https://issues.apache.org/jira/browse/NIFI-2096
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Rob Moran
>Priority: Blocker
>
> Tried in FF 40.0.2 and 47
> From the Templates shell, clicking the + icon does not trigger the system 
> prompt to choose a file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2097) RemoteProcessGroupStatusTest binds to a static Port

2016-06-23 Thread Joseph Percivall (JIRA)
Joseph Percivall created NIFI-2097:
--

 Summary: RemoteProcessGroupStatusTest binds to a static Port
 Key: NIFI-2097
 URL: https://issues.apache.org/jira/browse/NIFI-2097
 Project: Apache NiFi
  Issue Type: Bug
Reporter: Joseph Percivall
Assignee: Joseph Percivall
 Fix For: 0.7.0


In the unit test class RemoteProcessGroupStatusTest, when creating the 
FlowController to do a unit test the ExternalSiteListener always attempts to 
bind to port 9990. This causes an IllegalStateException when something is 
already on the port.

This should be fixed to bind to a free port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2061) Ensure nodes in a cluster use consistent authorizations

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346579#comment-15346579
 ] 

ASF GitHub Bot commented on NIFI-2061:
--

GitHub user bbende opened a pull request:

https://github.com/apache/nifi/pull/566

NIFI-2061 Ensure nodes in a cluster use consistent authorizations

- Added methods to AbstractPolicyBasedAuthorizer to generate and inherit a 
fingerprint
- Updated StandardFlowSynchronizer to compare authorization fingerprints

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/bbende/nifi NIFI-2061

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/566.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #566


commit 54a056c9132207eb40217ddc191f2ca866f45939
Author: Bryan Bende 
Date:   2016-06-20T20:58:42Z

NIFI-2061 Added methods to AbstractPolicyBasedAuthorizer to generate and 
inherit a fingerprint
- Updated StandardFlowSynchronizer to compare authorization fingerprints




> Ensure nodes in a cluster use consistent authorizations
> ---
>
> Key: NIFI-2061
> URL: https://issues.apache.org/jira/browse/NIFI-2061
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Affects Versions: 1.0.0
>Reporter: Bryan Bende
>Assignee: Bryan Bende
>Priority: Minor
> Fix For: 1.0.0
>
>
> When a node joins the cluster we currently compute a fingerprint of the flow 
> to ensure that the node's flow is compatible with the rest of the cluster. We 
> need to do something similar with authorizations to ensure different nodes 
> don't have completely different authorizations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MINIFI-40) SecurityPropertiesSchema doesn't properly handle empty security properties

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/MINIFI-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346623#comment-15346623
 ] 

ASF GitHub Bot commented on MINIFI-40:
--

GitHub user brosander reopened a pull request:

https://github.com/apache/nifi-minifi/pull/19

MINIFI-40 - Defaulting to empty string for keystore, truststore, sslP…

…rotocol

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/brosander/nifi-minifi MINIFI-40

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi-minifi/pull/19.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #19


commit fb2b9f2dcaab09fa18510417d32b845cc15f36e7
Author: Bryan Rosander 
Date:   2016-06-17T20:48:50Z

MINIFI-40 - Defaulting to empty string for keystore, truststore, 
sslProtocol, keystoreType, keystorePassword, keyPassword, truststoreType




> SecurityPropertiesSchema doesn't properly handle empty security properties
> --
>
> Key: MINIFI-40
> URL: https://issues.apache.org/jira/browse/MINIFI-40
> Project: Apache NiFi MiNiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>
> The SecurityPropertiesSchema class uses the getOptionalKeyAsType method with 
> a default value of null for each of the keystore, truststore and sslProtcol 
> properties. This ends up getting translated to "null" in the nifi.properties 
> file. 
> The correct default should be "". 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2098) Improve testManyFilesOpened in TestStandardProcessSession

2016-06-23 Thread Joseph Percivall (JIRA)
Joseph Percivall created NIFI-2098:
--

 Summary: Improve testManyFilesOpened in TestStandardProcessSession
 Key: NIFI-2098
 URL: https://issues.apache.org/jira/browse/NIFI-2098
 Project: Apache NiFi
  Issue Type: Bug
Reporter: Joseph Percivall
Priority: Minor


This unit test[1] is just unnecessarily long and poorly written (uses 
System.out). What the test is trying to test should be revisited and at the 
very least it should be ignored for the maven build. 

[1] 
https://github.com/apache/nifi/blob/0.x/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java#L804-L804



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (NIFI-2027) Properties Tables

2016-06-23 Thread Scott Aslan (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Aslan reassigned NIFI-2027:
-

Assignee: Scott Aslan

> Properties Tables
> -
>
> Key: NIFI-2027
> URL: https://issues.apache.org/jira/browse/NIFI-2027
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Scott Aslan
>Assignee: Scott Aslan
> Fix For: 1.0.0
>
>
> - Non-EL Property editor, cannot resize horizontally
> - EL Property editor, resize renders too slowly
> - Is empty check box positioning is off
> - window resize event needs to resize any visible properties tables
> - Property table heights are too short
> - GoTo icon is right aligned



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-1554) Incorporate new Authorizer API

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346737#comment-15346737
 ] 

ASF GitHub Bot commented on NIFI-1554:
--

GitHub user mcgilman opened a pull request:

https://github.com/apache/nifi/pull/567

NIFI-1554: Continuing to incorporate component based authorization

- Addressing access controls for the Controller resource.
- Addressing access controls for RAW site to site clients.
- Addressing access controls for downloading content (from provenance and 
queue).
- Addressing access controls for accessing queues.
- Addressing access controls for cluster endpoints.
- Addressing access controls for counter endpoints.
- Removing redundant authorization calls.
NIFI-2044:
- Requiring revision when creating components.
- Performing correct authorization when creating a component through a PUT 
request.
NIFI-1901
- Continuing to restore access control tests.
- Converting access control tests to itegration tests.
- Restoring contrib check to travis build.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mcgilman/nifi NIFI-1554

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/567.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #567


commit a9ca3218539bf87c70037fda6d313a38d0c43231
Author: Matt Gilman 
Date:   2016-06-23T15:04:40Z

NIFI-1554:
- Addressing access controls for the Controller resource.
- Addressing access controls for RAW site to site clients.
- Addressing access controls for downloading content (from provenance and 
queue).
- Addressing access controls for accessing queues.
- Addressing access controls for cluster endpoints.
- Addressing access controls for counter endpoints.
- Removing redundant authorization calls.
NIFI-2044:
- Requiring revision when creating components.
- Performing correct authorization when creating a component through a PUT 
request.
NIFI-1901
- Continuing to restore access control tests.
- Converting access control tests to itegration tests.
- Restoring contrib check to travis build.




> Incorporate new Authorizer API
> --
>
> Key: NIFI-1554
> URL: https://issues.apache.org/jira/browse/NIFI-1554
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Reporter: Matt Gilman
>Assignee: Matt Gilman
> Fix For: 1.0.0
>
>
> - Introduce checks on user actions using new Authorizer API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-1554) Incorporate new Authorizer API

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346740#comment-15346740
 ] 

ASF GitHub Bot commented on NIFI-1554:
--

Github user bbende commented on the issue:

https://github.com/apache/nifi/pull/567
  
Will start reviewing...


> Incorporate new Authorizer API
> --
>
> Key: NIFI-1554
> URL: https://issues.apache.org/jira/browse/NIFI-1554
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Reporter: Matt Gilman
>Assignee: Matt Gilman
> Fix For: 1.0.0
>
>
> - Introduce checks on user actions using new Authorizer API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2092) TestProcessorLifecyle fails on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346741#comment-15346741
 ] 

ASF GitHub Bot commented on NIFI-2092:
--

GitHub user JPercivall opened a pull request:

https://github.com/apache/nifi/pull/568

NIFI-2092 Fixing unit tests which try to clean up directories before …

…stopping the FlowController that has locks opened.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/JPercivall/nifi NIFI-2092

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/568.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #568


commit 8ed0ddadcd3d494997f231aafb406fa62d23824e
Author: jpercivall 
Date:   2016-06-23T16:42:16Z

NIFI-2092 Fixing unit tests which try to clean up directories before 
stopping the FlowController that has locks opened.




> TestProcessorLifecyle fails on Windows
> --
>
> Key: NIFI-2092
> URL: https://issues.apache.org/jira/browse/NIFI-2092
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 1.0.0, 0.7.0
>
>
> Currently, the "after" method tries to delete the content-repo and test-repo 
> before shutting down the flowcontroller[1] (causing failures due to files 
> being locked).
> `fc.shutdown(true)` should be moved before the deleteDirectory() calls.
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java#L93-L93



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2061) Ensure nodes in a cluster use consistent authorizations

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346761#comment-15346761
 ] 

ASF GitHub Bot commented on NIFI-2061:
--

Github user mcgilman commented on the issue:

https://github.com/apache/nifi/pull/566
  
Reviewing...


> Ensure nodes in a cluster use consistent authorizations
> ---
>
> Key: NIFI-2061
> URL: https://issues.apache.org/jira/browse/NIFI-2061
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Affects Versions: 1.0.0
>Reporter: Bryan Bende
>Assignee: Bryan Bende
>Priority: Minor
> Fix For: 1.0.0
>
>
> When a node joins the cluster we currently compute a fingerprint of the flow 
> to ensure that the node's flow is compatible with the rest of the cluster. We 
> need to do something similar with authorizations to ensure different nodes 
> don't have completely different authorizations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2097) RemoteProcessGroupStatusTest binds to a static Port

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346798#comment-15346798
 ] 

ASF GitHub Bot commented on NIFI-2097:
--

GitHub user JPercivall opened a pull request:

https://github.com/apache/nifi/pull/569

NIFI-2097 Changing RemoteProcessGroupStatusTest.java to use a random open 
port ...

... instead of a statically defined one

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/JPercivall/nifi NIFI-2097

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/569.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #569


commit 81f303a943193a17daa03ae1fa7c5da3c984a057
Author: jpercivall 
Date:   2016-06-23T16:55:58Z

NIFI-2097 Changing RemoteProcessGroupStatusTest to run on a random open 
port instead of a statically defined one

commit b664fc648a9250dc745a7d60d47d6889d8d633cf
Author: jpercivall 
Date:   2016-06-23T17:21:56Z

NIFI-2097 Changing RemoteProcessGroupStatusTest.java to use a random open 
port instead of a statically defined one




> RemoteProcessGroupStatusTest binds to a static Port
> ---
>
> Key: NIFI-2097
> URL: https://issues.apache.org/jira/browse/NIFI-2097
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 0.7.0
>
>
> In the unit test class RemoteProcessGroupStatusTest, when creating the 
> FlowController to do a unit test the ExternalSiteListener always attempts to 
> bind to port 9990. This causes an IllegalStateException when something is 
> already on the port.
> This should be fixed to bind to a free port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2062) Upgrade AWS SDK

2016-06-23 Thread James Wing (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Wing updated NIFI-2062:
-
Fix Version/s: 1.0.0

> Upgrade AWS SDK
> ---
>
> Key: NIFI-2062
> URL: https://issues.apache.org/jira/browse/NIFI-2062
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: 1.0.0
>Reporter: James Wing
>Assignee: James Wing
> Fix For: 1.0.0
>
>
> I propose to update NiFi's current AWS SDK from version 1.10.32 (Nov 3, 2015) 
> to version 1.11.8 (Jun 16, 2016).  Known impact:
> * *API Signature Version* - I expect the largest impact will be to S3 
> processors, where the default API signature version will change from v2 to v4 
> for a wider number of operations.  See release notes for 
> [1.11.0|https://aws.amazon.com/releasenotes/Java/9979983567247718].
> * *Region Endpoint Info* - The AWS SDK contains baked-in configuration data 
> about AWS regions and the services they support, which is periodically 
> updated.
> * *Service Updates* - Potentially relevant updates to future NiFi support for 
> AWS IoT and other newer services.
> I am not aware of any shocking changes for the services NiFi currently 
> supports (S3, SNS, SQS, DynamoDB, Lambda, Kinesis Firehose).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2098) Improve testManyFilesOpened in TestStandardProcessSession

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346849#comment-15346849
 ] 

ASF GitHub Bot commented on NIFI-2098:
--

GitHub user JPercivall opened a pull request:

https://github.com/apache/nifi/pull/570

NIFI-2098 Adding ignore annotation to testManyFilesOpened unit test



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/JPercivall/nifi NIFI-2098

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #570


commit f029ac28e8cd8d84d2390f8dbb0b8c01a2e6a37b
Author: jpercivall 
Date:   2016-06-23T17:45:21Z

NIFI-2098 Adding ignore annotation to testManyFilesOpened unit test




> Improve testManyFilesOpened in TestStandardProcessSession
> -
>
> Key: NIFI-2098
> URL: https://issues.apache.org/jira/browse/NIFI-2098
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Priority: Minor
>
> This unit test[1] is just unnecessarily long and poorly written (uses 
> System.out). What the test is trying to test should be revisited and at the 
> very least it should be ignored for the maven build. 
> [1] 
> https://github.com/apache/nifi/blob/0.x/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java#L804-L804



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2099) Process group save confirmation dialog has no title text

2016-06-23 Thread Andrew Lim (JIRA)
Andrew Lim created NIFI-2099:


 Summary: Process group save confirmation dialog has no title text
 Key: NIFI-2099
 URL: https://issues.apache.org/jira/browse/NIFI-2099
 Project: Apache NiFi
  Issue Type: Sub-task
  Components: Core UI
Affects Versions: 1.0.0
 Environment: Max OS X, Chrome
Reporter: Andrew Lim
Priority: Minor
 Fix For: 1.0.0


Changed the name of a Process Group and then selected "Apply".  A dialog box 
with the text "Process group configuration successfully saved." is shown, but 
this box has no text labeling this window.

See attached screenshot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-1974) Support Custom Properties in Expression Language

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346865#comment-15346865
 ] 

ASF GitHub Bot commented on NIFI-1974:
--

GitHub user YolandaMDavis opened a pull request:

https://github.com/apache/nifi/pull/571

NIFI-1974 - Support Custom Properties in Expression Language

This is the commit of the custom property expression language support with 
Variable Registry (for master)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/YolandaMDavis/nifi NIFI-1974-master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/571.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #571


commit 0bf9b66ea2c0472b87b9f0c561d0660807d38eb4
Author: Yolanda M. Davis 
Date:   2016-06-23T17:25:17Z

NIFI-1974 - initial commit Custom Property Expression Language support with 
Variable Registry




> Support Custom Properties in Expression Language
> 
>
> Key: NIFI-1974
> URL: https://issues.apache.org/jira/browse/NIFI-1974
> Project: Apache NiFi
>  Issue Type: New Feature
>Reporter: Yolanda M. Davis
>Assignee: Yolanda M. Davis
> Fix For: 1.0.0, 0.7.0
>
>
> Add a property in "nifi.properties" config file to allows users to specify a 
> list of custom properties files (containing data such as environmental 
> specific values, or sensitive values, etc.). The key/value pairs should be 
> loaded upon NIFI startup and availbale to processors for use in expression 
> languages. 
> Optimally this will lay the groundwork for a UI driven Variable Registry.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2099) Process group save confirmation dialog has no title text

2016-06-23 Thread Andrew Lim (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Lim updated NIFI-2099:
-
Attachment: NIFI-2099_PGnoTitle.png

> Process group save confirmation dialog has no title text
> 
>
> Key: NIFI-2099
> URL: https://issues.apache.org/jira/browse/NIFI-2099
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Affects Versions: 1.0.0
> Environment: Max OS X, Chrome
>Reporter: Andrew Lim
>Priority: Minor
>  Labels: UI
> Fix For: 1.0.0
>
> Attachments: NIFI-2099_PGnoTitle.png
>
>
> Changed the name of a Process Group and then selected "Apply".  A dialog box 
> with the text "Process group configuration successfully saved." is shown, but 
> this box has no text labeling this window.
> See attached screenshot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


nifi git commit: NIFI-2092 Fixing unit tests which try to clean up directories before stopping the FlowController that has locks opened.

2016-06-23 Thread ozhurakousky
Repository: nifi
Updated Branches:
  refs/heads/0.x 7b7788ef7 -> 6e7b67e84


NIFI-2092 Fixing unit tests which try to clean up directories before stopping 
the FlowController that has locks opened.

This closes #568


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/6e7b67e8
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/6e7b67e8
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/6e7b67e8

Branch: refs/heads/0.x
Commit: 6e7b67e8480d5c2772eac90a4a8aae32704b5fb0
Parents: 7b7788e
Author: jpercivall 
Authored: Thu Jun 23 12:42:16 2016 -0400
Committer: Oleg Zhurakousky 
Committed: Thu Jun 23 14:19:02 2016 -0400

--
 .../apache/nifi/controller/scheduling/TestProcessorLifecycle.java  | 2 +-
 .../test/java/org/apache/nifi/controller/MonitorMemoryTest.java| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/6e7b67e8/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
index df52516..f0756a8 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
@@ -90,9 +90,9 @@ public class TestProcessorLifecycle {
 
 @After
 public void after() throws Exception {
+fc.shutdown(true);
 FileUtils.deleteDirectory(new File("./target/test-repo"));
 FileUtils.deleteDirectory(new File("./target/content_repository"));
-fc.shutdown(true);
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/nifi/blob/6e7b67e8/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
--
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
index b81d952..54f6aab 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
@@ -51,9 +51,9 @@ public class MonitorMemoryTest {
 
 @After
 public void after() throws Exception {
+fc.shutdown(true);
 FileUtils.deleteDirectory(new File("./target/test-repo"));
 FileUtils.deleteDirectory(new File("./target/content_repository"));
-fc.shutdown(true);
 }
 
 @Test(expected = IllegalStateException.class)



[jira] [Commented] (NIFI-2092) TestProcessorLifecyle fails on Windows

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346909#comment-15346909
 ] 

ASF subversion and git services commented on NIFI-2092:
---

Commit 6e7b67e8480d5c2772eac90a4a8aae32704b5fb0 in nifi's branch refs/heads/0.x 
from [~JPercivall]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=6e7b67e ]

NIFI-2092 Fixing unit tests which try to clean up directories before stopping 
the FlowController that has locks opened.

This closes #568


> TestProcessorLifecyle fails on Windows
> --
>
> Key: NIFI-2092
> URL: https://issues.apache.org/jira/browse/NIFI-2092
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 1.0.0, 0.7.0
>
>
> Currently, the "after" method tries to delete the content-repo and test-repo 
> before shutting down the flowcontroller[1] (causing failures due to files 
> being locked).
> `fc.shutdown(true)` should be moved before the deleteDirectory() calls.
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java#L93-L93



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2092) TestProcessorLifecyle fails on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346913#comment-15346913
 ] 

ASF GitHub Bot commented on NIFI-2092:
--

Github user olegz commented on the issue:

https://github.com/apache/nifi/pull/568
  
@JPercivall the magic words did not seem to work so please close this PR. 
Also, please issue another PR for 1.0 since this one has merge conflicts.


> TestProcessorLifecyle fails on Windows
> --
>
> Key: NIFI-2092
> URL: https://issues.apache.org/jira/browse/NIFI-2092
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 1.0.0, 0.7.0
>
>
> Currently, the "after" method tries to delete the content-repo and test-repo 
> before shutting down the flowcontroller[1] (causing failures due to files 
> being locked).
> `fc.shutdown(true)` should be moved before the deleteDirectory() calls.
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java#L93-L93



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2082) When a node is disconnected from cluster, it should be made extremely obvious in the UI

2016-06-23 Thread Rob Moran (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346914#comment-15346914
 ] 

Rob Moran commented on NIFI-2082:
-

[~markap14] – in a case like this do all the clustered nodes remain aware of 
the situation?

* Does the disconnected node know that it _should_ be part of a cluster?
* And do the remaining (connected) nodes in the cluster know that one is 
missing?

If these answer yes, we can call attention to the cluster icon/node count in 
the flow status. The user can view a tooltip when hovering this area for 
details. I'd recommend doing even more to let the user know when they try to 
make a change to a disconnected node, but first want to make sure each node can 
be aware of what is happening.

If no, well, that is not good...

> When a node is disconnected from cluster, it should be made extremely obvious 
> in the UI
> ---
>
> Key: NIFI-2082
> URL: https://issues.apache.org/jira/browse/NIFI-2082
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Mark Payne
>Priority: Critical
> Fix For: 1.0.0
>
>
> Because we now have a zero-master clustering paradigm, it's possible to open 
> the UI on a node that is disconnected from the cluster. In this case, changes 
> made to the UI will be accepted, but they will not be replicated to the 
> cluster. As a result, the flow will be out-of-sync with the cluster, and in 
> order to get the node back to the cluster, the changes would have to be 
> undone and the work potentially lost (user could create a template to save 
> the changes but may not know what all they changed).
> The UI should make it very obvious that the node is disconnected and that any 
> changes that made will not be replicated to the cluster.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


nifi git commit: NIFI-2097 Changing RemoteProcessGroupStatusTest.java to use a random open port instead of a statically defined one

2016-06-23 Thread ozhurakousky
Repository: nifi
Updated Branches:
  refs/heads/0.x 6e7b67e84 -> 03c937623


NIFI-2097 Changing RemoteProcessGroupStatusTest.java to use a random open port 
instead of a statically defined one

This closes #569


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/03c93762
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/03c93762
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/03c93762

Branch: refs/heads/0.x
Commit: 03c9376233e4669c32bf4b62e3f33368b1184619
Parents: 6e7b67e
Author: jpercivall 
Authored: Thu Jun 23 13:24:15 2016 -0400
Committer: Oleg Zhurakousky 
Committed: Thu Jun 23 14:25:11 2016 -0400

--
 .../apache/nifi/remote/RemoteProcessGroupStatusTest.java  | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/03c93762/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
index 56f7074..98e9eb9 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/remote/RemoteProcessGroupStatusTest.java
@@ -19,7 +19,9 @@ package org.apache.nifi.remote;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 
+import java.io.IOException;
 import java.lang.reflect.Method;
+import java.net.ServerSocket;
 import java.net.URL;
 import java.util.Collections;
 
@@ -58,12 +60,18 @@ public class RemoteProcessGroupStatusTest {
 }
 
 @Before
-public void before() {
+public void before() throws IOException {
+int port;
+try (ServerSocket socket = new ServerSocket(0)) {
+socket.setReuseAddress(true);
+port = socket.getLocalPort();
+}
 NiFiProperties properties = NiFiProperties.getInstance();
 
properties.setProperty(NiFiProperties.PROVENANCE_REPO_IMPLEMENTATION_CLASS, 
MockProvenanceEventRepository.class.getName());
 properties.setProperty(NiFiProperties.STATE_MANAGEMENT_CONFIG_FILE, 
"src/test/resources/state-management.xml");
 
properties.setProperty(NiFiProperties.STATE_MANAGEMENT_LOCAL_PROVIDER_ID, 
"local-provider");
 properties.setProperty(NiFiProperties.REMOTE_INPUT_HOST, "localhost");
+properties.setProperty(NiFiProperties.REMOTE_INPUT_PORT, 
String.valueOf(port));
 properties.setProperty("nifi.remote.input.secure", "false");
 
 RingBufferEventRepository repository = new 
RingBufferEventRepository(1);



[jira] [Commented] (NIFI-2097) RemoteProcessGroupStatusTest binds to a static Port

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346916#comment-15346916
 ] 

ASF subversion and git services commented on NIFI-2097:
---

Commit 03c9376233e4669c32bf4b62e3f33368b1184619 in nifi's branch refs/heads/0.x 
from [~JPercivall]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=03c9376 ]

NIFI-2097 Changing RemoteProcessGroupStatusTest.java to use a random open port 
instead of a statically defined one

This closes #569


> RemoteProcessGroupStatusTest binds to a static Port
> ---
>
> Key: NIFI-2097
> URL: https://issues.apache.org/jira/browse/NIFI-2097
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 0.7.0
>
>
> In the unit test class RemoteProcessGroupStatusTest, when creating the 
> FlowController to do a unit test the ExternalSiteListener always attempts to 
> bind to port 9990. This causes an IllegalStateException when something is 
> already on the port.
> This should be fixed to bind to a free port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-1974) Support Custom Properties in Expression Language

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346915#comment-15346915
 ] 

ASF GitHub Bot commented on NIFI-1974:
--

Github user YolandaMDavis closed the pull request at:

https://github.com/apache/nifi/pull/501


> Support Custom Properties in Expression Language
> 
>
> Key: NIFI-1974
> URL: https://issues.apache.org/jira/browse/NIFI-1974
> Project: Apache NiFi
>  Issue Type: New Feature
>Reporter: Yolanda M. Davis
>Assignee: Yolanda M. Davis
> Fix For: 1.0.0, 0.7.0
>
>
> Add a property in "nifi.properties" config file to allows users to specify a 
> list of custom properties files (containing data such as environmental 
> specific values, or sensitive values, etc.). The key/value pairs should be 
> loaded upon NIFI startup and availbale to processors for use in expression 
> languages. 
> Optimally this will lay the groundwork for a UI driven Variable Registry.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2097) RemoteProcessGroupStatusTest binds to a static Port

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346922#comment-15346922
 ] 

ASF GitHub Bot commented on NIFI-2097:
--

Github user olegz commented on the issue:

https://github.com/apache/nifi/pull/569
  
@JPercivall the magic words did not work here either, so please close it.


> RemoteProcessGroupStatusTest binds to a static Port
> ---
>
> Key: NIFI-2097
> URL: https://issues.apache.org/jira/browse/NIFI-2097
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 0.7.0
>
>
> In the unit test class RemoteProcessGroupStatusTest, when creating the 
> FlowController to do a unit test the ExternalSiteListener always attempts to 
> bind to port 9990. This causes an IllegalStateException when something is 
> already on the port.
> This should be fixed to bind to a free port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2092) TestProcessorLifecyle fails on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346934#comment-15346934
 ] 

ASF GitHub Bot commented on NIFI-2092:
--

Github user JPercivall commented on the issue:

https://github.com/apache/nifi/pull/568
  
Got it, thanks @olegz 


> TestProcessorLifecyle fails on Windows
> --
>
> Key: NIFI-2092
> URL: https://issues.apache.org/jira/browse/NIFI-2092
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 1.0.0, 0.7.0
>
>
> Currently, the "after" method tries to delete the content-repo and test-repo 
> before shutting down the flowcontroller[1] (causing failures due to files 
> being locked).
> `fc.shutdown(true)` should be moved before the deleteDirectory() calls.
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java#L93-L93



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2092) TestProcessorLifecyle fails on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346935#comment-15346935
 ] 

ASF GitHub Bot commented on NIFI-2092:
--

Github user JPercivall closed the pull request at:

https://github.com/apache/nifi/pull/568


> TestProcessorLifecyle fails on Windows
> --
>
> Key: NIFI-2092
> URL: https://issues.apache.org/jira/browse/NIFI-2092
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 1.0.0, 0.7.0
>
>
> Currently, the "after" method tries to delete the content-repo and test-repo 
> before shutting down the flowcontroller[1] (causing failures due to files 
> being locked).
> `fc.shutdown(true)` should be moved before the deleteDirectory() calls.
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java#L93-L93



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[2/2] nifi git commit: NIFI-2061 Added methods to AbstractPolicyBasedAuthorizer to generate and inherit a fingerprint - Updated StandardFlowSynchronizer to compare authorization fingerprints - This cl

2016-06-23 Thread mcgilman
NIFI-2061 Added methods to AbstractPolicyBasedAuthorizer to generate and 
inherit a fingerprint
- Updated StandardFlowSynchronizer to compare authorization fingerprints
- This closes #566


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/4f2643f6
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/4f2643f6
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/4f2643f6

Branch: refs/heads/master
Commit: 4f2643f668a7e028edc9d5112d0e98b411d3d9ef
Parents: baed85f
Author: Bryan Bende 
Authored: Mon Jun 20 16:58:42 2016 -0400
Committer: Matt Gilman 
Committed: Thu Jun 23 14:36:04 2016 -0400

--
 .../AbstractPolicyBasedAuthorizer.java  | 295 ++-
 .../TestAbstractPolicyBasedAuthorizer.java  | 269 +
 .../nifi/cluster/protocol/StandardDataFlow.java |  12 +-
 .../protocol/jaxb/message/AdaptedDataFlow.java  |  10 +
 .../protocol/jaxb/message/DataFlowAdapter.java  |   3 +-
 .../jaxb/message/TestJaxbProtocolUtils.java |   2 +-
 .../node/TestNodeClusterCoordinator.java|   6 +-
 .../apache/nifi/cluster/protocol/DataFlow.java  |   6 +
 .../apache/nifi/controller/FlowController.java  |  24 +-
 .../nifi/controller/StandardFlowService.java|  32 +-
 .../controller/StandardFlowSynchronizer.java| 125 +++-
 .../nifi/spring/FlowControllerFactoryBean.java  |  12 +-
 .../spring/StandardFlowServiceFactoryBean.java  |  13 +-
 .../src/main/resources/nifi-context.xml |   3 +-
 .../StandardFlowSynchronizerSpec.groovy |   5 +
 .../controller/StandardFlowServiceTest.java |  26 +-
 .../nifi/controller/TestFlowController.java | 124 +++-
 .../scheduling/TestProcessorLifecycle.java  |   4 +-
 .../nifi/remote/StandardRootGroupPort.java  |   8 +-
 .../nifi/controller/MonitorMemoryTest.java  |   4 +-
 20 files changed, 915 insertions(+), 68 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/4f2643f6/nifi-api/src/main/java/org/apache/nifi/authorization/AbstractPolicyBasedAuthorizer.java
--
diff --git 
a/nifi-api/src/main/java/org/apache/nifi/authorization/AbstractPolicyBasedAuthorizer.java
 
b/nifi-api/src/main/java/org/apache/nifi/authorization/AbstractPolicyBasedAuthorizer.java
index f67ac8b..71168f6 100644
--- 
a/nifi-api/src/main/java/org/apache/nifi/authorization/AbstractPolicyBasedAuthorizer.java
+++ 
b/nifi-api/src/main/java/org/apache/nifi/authorization/AbstractPolicyBasedAuthorizer.java
@@ -17,7 +17,26 @@
 package org.apache.nifi.authorization;
 
 import org.apache.nifi.authorization.exception.AuthorizationAccessException;
-
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 import java.util.Set;
 
 /**
@@ -25,6 +44,23 @@ import java.util.Set;
  */
 public abstract class AbstractPolicyBasedAuthorizer implements Authorizer {
 
+static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY = 
DocumentBuilderFactory.newInstance();
+static final XMLOutputFactory XML_OUTPUT_FACTORY = 
XMLOutputFactory.newInstance();
+
+static final String USER_ELEMENT = "user";
+static final String USER_GROUP_ELEMENT = "userGroup";
+static final String GROUP_ELEMENT = "group";
+static final String POLICY_ELEMENT = "policy";
+static final String POLICY_USER_ELEMENT = "policyUser";
+static final String POLICY_GROUP_ELEMENT = "policyGroup";
+static final String IDENTIFIER_ATTR = "identifier";
+static final String IDENTITY_ATTR = "identity";
+static final String NAME_ATTR = "name";
+static final String RESOURCE_ATTR = "resource";
+static final String ACTIONS_ATTR = "actions";
+
+public static final String EMPTY_FINGERPRINT = "EMPTY";
+
 @Override
 public final AuthorizationResult authorize(AuthorizationRequest request) 
throws AuthorizationAccessException {
 final UsersAndAccessPolicies usersAndAccessPolicies = 
getUsersAndAccessPolicies();
@@ -218,4 +254,261 @@ public abstract class AbstractPolicyBasedAuthorizer 
implements Authorizer {
  */
 public abstract UsersAndAccessPolicies getUsersAndAccessPolicies() throws 
AuthorizationAccessException;
 
+/**
+ * Parses

[jira] [Commented] (NIFI-2061) Ensure nodes in a cluster use consistent authorizations

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346942#comment-15346942
 ] 

ASF GitHub Bot commented on NIFI-2061:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/566


> Ensure nodes in a cluster use consistent authorizations
> ---
>
> Key: NIFI-2061
> URL: https://issues.apache.org/jira/browse/NIFI-2061
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Affects Versions: 1.0.0
>Reporter: Bryan Bende
>Assignee: Bryan Bende
>Priority: Minor
> Fix For: 1.0.0
>
>
> When a node joins the cluster we currently compute a fingerprint of the flow 
> to ensure that the node's flow is compatible with the rest of the cluster. We 
> need to do something similar with authorizations to ensure different nodes 
> don't have completely different authorizations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2061) Ensure nodes in a cluster use consistent authorizations

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346939#comment-15346939
 ] 

ASF subversion and git services commented on NIFI-2061:
---

Commit 4f2643f668a7e028edc9d5112d0e98b411d3d9ef in nifi's branch 
refs/heads/master from [~bbende]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=4f2643f ]

NIFI-2061 Added methods to AbstractPolicyBasedAuthorizer to generate and 
inherit a fingerprint
- Updated StandardFlowSynchronizer to compare authorization fingerprints
- This closes #566


> Ensure nodes in a cluster use consistent authorizations
> ---
>
> Key: NIFI-2061
> URL: https://issues.apache.org/jira/browse/NIFI-2061
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Affects Versions: 1.0.0
>Reporter: Bryan Bende
>Assignee: Bryan Bende
>Priority: Minor
> Fix For: 1.0.0
>
>
> When a node joins the cluster we currently compute a fingerprint of the flow 
> to ensure that the node's flow is compatible with the rest of the cluster. We 
> need to do something similar with authorizations to ensure different nodes 
> don't have completely different authorizations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[1/2] nifi git commit: NIFI-2061 Added methods to AbstractPolicyBasedAuthorizer to generate and inherit a fingerprint - Updated StandardFlowSynchronizer to compare authorization fingerprints - This cl

2016-06-23 Thread mcgilman
Repository: nifi
Updated Branches:
  refs/heads/master baed85fa3 -> 4f2643f66


http://git-wip-us.apache.org/repos/asf/nifi/blob/4f2643f6/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java
index 58f4804..cd10d5c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java
@@ -16,7 +16,7 @@
  */
 package org.apache.nifi.remote;
 
-import org.apache.nifi.admin.service.KeyService;
+import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.connectable.ConnectableType;
 import org.apache.nifi.controller.AbstractPort;
@@ -71,7 +71,7 @@ public class StandardRootGroupPort extends AbstractPort 
implements RootGroupPort
 private final AtomicReference> userAccessControl = new 
AtomicReference>(new HashSet());
 private final ProcessScheduler processScheduler;
 private final boolean secure;
-private final KeyService keyService;
+private final Authorizer authorizer;
 @SuppressWarnings("unused")
 private final BulletinRepository bulletinRepository;
 private final EventReporter eventReporter;
@@ -85,13 +85,13 @@ public class StandardRootGroupPort extends AbstractPort 
implements RootGroupPort
 private boolean shutdown = false;   // guarded by requestLock
 
 public StandardRootGroupPort(final String id, final String name, final 
ProcessGroup processGroup,
-final TransferDirection direction, final ConnectableType type, 
final KeyService keyService,
+final TransferDirection direction, final ConnectableType type, 
final Authorizer authorizer,
 final BulletinRepository bulletinRepository, final 
ProcessScheduler scheduler, final boolean secure) {
 super(id, name, processGroup, type, scheduler);
 
 this.processScheduler = scheduler;
 setScheduldingPeriod(MINIMUM_SCHEDULING_NANOS + " nanos");
-this.keyService = keyService;
+this.authorizer = authorizer;
 this.secure = secure;
 this.bulletinRepository = bulletinRepository;
 this.scheduler = scheduler;

http://git-wip-us.apache.org/repos/asf/nifi/blob/4f2643f6/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
--
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
index 044d29a..0970da4 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
@@ -25,7 +25,7 @@ import java.lang.reflect.Modifier;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.nifi.admin.service.AuditService;
-import org.apache.nifi.admin.service.KeyService;
+import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.controller.repository.FlowFileEventRepository;
 import org.apache.nifi.provenance.MockProvenanceEventRepository;
 import org.apache.nifi.util.CapturingLogger;
@@ -136,6 +136,6 @@ public class MonitorMemoryTest {
 properties.setProperty("nifi.remote.input.secure", "");
 
 return 
FlowController.createStandaloneInstance(mock(FlowFileEventRepository.class), 
properties,
-mock(KeyService.class), mock(AuditService.class), null, null);
+mock(Authorizer.class), mock(AuditService.class), null, null);
 }
 }



[jira] [Commented] (NIFI-2061) Ensure nodes in a cluster use consistent authorizations

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346943#comment-15346943
 ] 

ASF GitHub Bot commented on NIFI-2061:
--

Github user mcgilman commented on the issue:

https://github.com/apache/nifi/pull/566
  
Looks great @bbende!. I've merged to master.


> Ensure nodes in a cluster use consistent authorizations
> ---
>
> Key: NIFI-2061
> URL: https://issues.apache.org/jira/browse/NIFI-2061
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Affects Versions: 1.0.0
>Reporter: Bryan Bende
>Assignee: Bryan Bende
>Priority: Minor
> Fix For: 1.0.0
>
>
> When a node joins the cluster we currently compute a fingerprint of the flow 
> to ensure that the node's flow is compatible with the rest of the cluster. We 
> need to do something similar with authorizations to ensure different nodes 
> don't have completely different authorizations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346952#comment-15346952
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

GitHub user markap14 opened a pull request:

https://github.com/apache/nifi/pull/572

NIFI-2059: Ensure that we properly pass along proxied entities in HTT…

…P headers when secure and ensure that we don't keep creating new Root 
Group ID's once we've created one, even after restart

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/markap14/nifi NIFI-2059

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/572.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #572


commit d692265308957425781790ef43400b1b79545bfe
Author: Mark Payne 
Date:   2016-06-23T18:25:11Z

NIFI-2059: Ensure that we properly pass along proxied entities in HTTP 
headers when secure and ensure that we don't keep creating new Root Group ID's 
once we've created one, even after restart




> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346971#comment-15346971
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/572#discussion_r68293435
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
 ---
@@ -210,6 +212,15 @@ public AsyncClusterResponse 
replicate(Set nodeIds, String method
 final Map updatedHeaders = new HashMap<>(headers);
 
updatedHeaders.put(RequestReplicator.CLUSTER_ID_GENERATION_SEED_HEADER, 
UUID.randomUUID().toString());
 updatedHeaders.put(RequestReplicator.REPLICATION_INDICATOR_HEADER, 
"true");
+
+// If the user is authenticated, add them as a proxied entity so 
that when the receiving NiFi receives the request,
+// it knows that we are acting as a proxy on behalf of the current 
user.
+final NiFiUser user = NiFiUserUtils.getNiFiUser();
+if (user != null && !user.equals(NiFiUser.ANONYMOUS)) {
--- End diff --

Should use `user.isAnonymous()` to detect anonymous user.


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346972#comment-15346972
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/572#discussion_r68293664
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
 ---
@@ -210,6 +212,15 @@ public AsyncClusterResponse 
replicate(Set nodeIds, String method
 final Map updatedHeaders = new HashMap<>(headers);
 
updatedHeaders.put(RequestReplicator.CLUSTER_ID_GENERATION_SEED_HEADER, 
UUID.randomUUID().toString());
 updatedHeaders.put(RequestReplicator.REPLICATION_INDICATOR_HEADER, 
"true");
+
+// If the user is authenticated, add them as a proxied entity so 
that when the receiving NiFi receives the request,
+// it knows that we are acting as a proxy on behalf of the current 
user.
+final NiFiUser user = NiFiUserUtils.getNiFiUser();
+if (user != null && !user.equals(NiFiUser.ANONYMOUS)) {
+final String proxiedEntitiesChain = 
ProxiedEntitiesUtils.buildProxiedEntitiesChainString(NiFiUserUtils.getNiFiUser());
--- End diff --

Might as well use the user obtained on line 218.


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346975#comment-15346975
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user mcgilman commented on the issue:

https://github.com/apache/nifi/pull/572
  
Reviewing...


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2097) RemoteProcessGroupStatusTest binds to a static Port

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346978#comment-15346978
 ] 

ASF GitHub Bot commented on NIFI-2097:
--

Github user JPercivall closed the pull request at:

https://github.com/apache/nifi/pull/569


> RemoteProcessGroupStatusTest binds to a static Port
> ---
>
> Key: NIFI-2097
> URL: https://issues.apache.org/jira/browse/NIFI-2097
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 0.7.0
>
>
> In the unit test class RemoteProcessGroupStatusTest, when creating the 
> FlowController to do a unit test the ExternalSiteListener always attempts to 
> bind to port 9990. This causes an IllegalStateException when something is 
> already on the port.
> This should be fixed to bind to a free port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2097) RemoteProcessGroupStatusTest binds to a static Port

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346977#comment-15346977
 ] 

ASF GitHub Bot commented on NIFI-2097:
--

Github user JPercivall commented on the issue:

https://github.com/apache/nifi/pull/569
  
Thanks @olegz, closing


> RemoteProcessGroupStatusTest binds to a static Port
> ---
>
> Key: NIFI-2097
> URL: https://issues.apache.org/jira/browse/NIFI-2097
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 0.7.0
>
>
> In the unit test class RemoteProcessGroupStatusTest, when creating the 
> FlowController to do a unit test the ExternalSiteListener always attempts to 
> bind to port 9990. This causes an IllegalStateException when something is 
> already on the port.
> This should be fixed to bind to a free port.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread Mark Payne (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Payne updated NIFI-2089:
-
Fix Version/s: 1.0.0

> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347032#comment-15347032
 ] 

ASF GitHub Bot commented on NIFI-2089:
--

GitHub user markap14 opened a pull request:

https://github.com/apache/nifi/pull/573

NIFI-2089: Ensure streams are closed before attempting to remove files

Also fixed buggy unit tests that did not properly utilize the Content 
Repository API but instead attempted to write to files directly

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/markap14/nifi NIFI-2089

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/573.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #573


commit a4281ae4197428dd3f4f14450467f78068e2345b
Author: Mark Payne 
Date:   2016-06-23T19:21:44Z

NIFI-2089: Ensure streams are closed before attempting to remove files




> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> 

[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347039#comment-15347039
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user markap14 commented on the issue:

https://github.com/apache/nifi/pull/572
  
@mcgilman the PR has been updated to incorporate the feedback you provided. 
Thanks!


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347037#comment-15347037
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/572#discussion_r68300354
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
 ---
@@ -210,6 +212,15 @@ public AsyncClusterResponse 
replicate(Set nodeIds, String method
 final Map updatedHeaders = new HashMap<>(headers);
 
updatedHeaders.put(RequestReplicator.CLUSTER_ID_GENERATION_SEED_HEADER, 
UUID.randomUUID().toString());
 updatedHeaders.put(RequestReplicator.REPLICATION_INDICATOR_HEADER, 
"true");
+
+// If the user is authenticated, add them as a proxied entity so 
that when the receiving NiFi receives the request,
+// it knows that we are acting as a proxy on behalf of the current 
user.
+final NiFiUser user = NiFiUserUtils.getNiFiUser();
+if (user != null && !user.equals(NiFiUser.ANONYMOUS)) {
--- End diff --

Good call


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347038#comment-15347038
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/572#discussion_r68300367
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
 ---
@@ -210,6 +212,15 @@ public AsyncClusterResponse 
replicate(Set nodeIds, String method
 final Map updatedHeaders = new HashMap<>(headers);
 
updatedHeaders.put(RequestReplicator.CLUSTER_ID_GENERATION_SEED_HEADER, 
UUID.randomUUID().toString());
 updatedHeaders.put(RequestReplicator.REPLICATION_INDICATOR_HEADER, 
"true");
+
+// If the user is authenticated, add them as a proxied entity so 
that when the receiving NiFi receives the request,
+// it knows that we are acting as a proxy on behalf of the current 
user.
+final NiFiUser user = NiFiUserUtils.getNiFiUser();
+if (user != null && !user.equals(NiFiUser.ANONYMOUS)) {
+final String proxiedEntitiesChain = 
ProxiedEntitiesUtils.buildProxiedEntitiesChainString(NiFiUserUtils.getNiFiUser());
--- End diff --

And another good call.


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2098) Improve testManyFilesOpened in TestStandardProcessSession

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347058#comment-15347058
 ] 

ASF GitHub Bot commented on NIFI-2098:
--

Github user markap14 commented on the issue:

https://github.com/apache/nifi/pull/570
  
@JPercivall I think this unit test is actually quite helpful to have. It 
can add a little while to the build process, but it ensures that we don't 
accidentally hold open the file handles that we are not supposed to hold open. 
I think the System.out.println() calls need to be replaced with logger calls 
but don't think we should Ignore the test. If we want to avoid running it too 
often, we should probably look at making it an integration test instead.


> Improve testManyFilesOpened in TestStandardProcessSession
> -
>
> Key: NIFI-2098
> URL: https://issues.apache.org/jira/browse/NIFI-2098
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Priority: Minor
>
> This unit test[1] is just unnecessarily long and poorly written (uses 
> System.out). What the test is trying to test should be revisited and at the 
> very least it should be ignored for the maven build. 
> [1] 
> https://github.com/apache/nifi/blob/0.x/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java#L804-L804



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2044) Require revision for component creation

2016-06-23 Thread Matt Gilman (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman updated NIFI-2044:
--
Description: 
- When creating a component, require the revision to be specified to ensure 
we're using the appropriate client id.
- Require component exists for PUT requests.

  was:
- When creating a component, require the revision to be specified to ensure 
we're using the appropriate client id.
- Perform proper authorization when components are created via PUT.


> Require revision for component creation
> ---
>
> Key: NIFI-2044
> URL: https://issues.apache.org/jira/browse/NIFI-2044
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework, Core UI
>Reporter: Matt Gilman
>Assignee: Matt Gilman
> Fix For: 1.0.0
>
>
> - When creating a component, require the revision to be specified to ensure 
> we're using the appropriate client id.
> - Require component exists for PUT requests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


nifi git commit: NIFI-2059: Ensure that we properly pass along proxied entities in HTTP headers when secure and ensure that we don't keep creating new Root Group ID's once we've created one, even afte

2016-06-23 Thread mcgilman
Repository: nifi
Updated Branches:
  refs/heads/master 4f2643f66 -> fd5327e1b


NIFI-2059: Ensure that we properly pass along proxied entities in HTTP headers 
when secure and ensure that we don't keep creating new Root Group ID's once 
we've created one, even after restart. This closes #572.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/fd5327e1
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/fd5327e1
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/fd5327e1

Branch: refs/heads/master
Commit: fd5327e1b94e665a048a3127471c730a1f564da8
Parents: 4f2643f
Author: Mark Payne 
Authored: Thu Jun 23 14:25:11 2016 -0400
Committer: Matt Gilman 
Committed: Thu Jun 23 16:32:25 2016 -0400

--
 .../replication/ThreadPoolRequestReplicator.java   | 15 +--
 .../nifi/controller/StandardFlowService.java   | 17 -
 .../nifi/persistence/FlowConfigurationDAO.java |  5 +
 .../StandardXMLFlowConfigurationDAO.java   | 10 --
 4 files changed, 34 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/fd5327e1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
index ed83159..3d90b6f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/ThreadPoolRequestReplicator.java
@@ -43,6 +43,8 @@ import javax.ws.rs.HttpMethod;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 
+import org.apache.nifi.authorization.user.NiFiUser;
+import org.apache.nifi.authorization.user.NiFiUserUtils;
 import org.apache.nifi.cluster.coordination.ClusterCoordinator;
 import org.apache.nifi.cluster.coordination.http.HttpResponseMerger;
 import org.apache.nifi.cluster.coordination.http.StandardHttpResponseMerger;
@@ -57,9 +59,9 @@ import 
org.apache.nifi.cluster.manager.exception.UnknownNodeException;
 import org.apache.nifi.cluster.manager.exception.UriConstructionException;
 import org.apache.nifi.cluster.protocol.NodeIdentifier;
 import org.apache.nifi.events.EventReporter;
-import org.apache.nifi.logging.NiFiLog;
 import org.apache.nifi.reporting.Severity;
 import org.apache.nifi.util.FormatUtils;
+import org.apache.nifi.web.security.ProxiedEntitiesUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -72,7 +74,7 @@ import com.sun.jersey.core.util.MultivaluedMapImpl;
 
 public class ThreadPoolRequestReplicator implements RequestReplicator {
 
-private static final Logger logger = new 
NiFiLog(LoggerFactory.getLogger(ThreadPoolRequestReplicator.class));
+private static final Logger logger = 
LoggerFactory.getLogger(ThreadPoolRequestReplicator.class);
 private static final int MAX_CONCURRENT_REQUESTS = 100;
 
 private final Client client; // the client to use for issuing requests
@@ -210,6 +212,15 @@ public class ThreadPoolRequestReplicator implements 
RequestReplicator {
 final Map updatedHeaders = new HashMap<>(headers);
 
updatedHeaders.put(RequestReplicator.CLUSTER_ID_GENERATION_SEED_HEADER, 
UUID.randomUUID().toString());
 updatedHeaders.put(RequestReplicator.REPLICATION_INDICATOR_HEADER, 
"true");
+
+// If the user is authenticated, add them as a proxied entity so that 
when the receiving NiFi receives the request,
+// it knows that we are acting as a proxy on behalf of the current 
user.
+final NiFiUser user = NiFiUserUtils.getNiFiUser();
+if (user != null && !user.isAnonymous()) {
+final String proxiedEntitiesChain = 
ProxiedEntitiesUtils.buildProxiedEntitiesChainString(user);
+updatedHeaders.put(ProxiedEntitiesUtils.PROXY_ENTITIES_CHAIN, 
proxiedEntitiesChain);
+}
+
 return replicate(nodeIds, method, uri, entity, updatedHeaders, true, 
null);
 }
 

http://git-wip-us.apache.org/repos/asf/nifi/blob/fd5327e1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowService.java
--

[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347123#comment-15347123
 ] 

ASF subversion and git services commented on NIFI-2059:
---

Commit fd5327e1b94e665a048a3127471c730a1f564da8 in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=fd5327e ]

NIFI-2059: Ensure that we properly pass along proxied entities in HTTP headers 
when secure and ensure that we don't keep creating new Root Group ID's once 
we've created one, even after restart. This closes #572.


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347125#comment-15347125
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/572


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread Matt Gilman (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman resolved NIFI-2059.
---
Resolution: Fixed

> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347124#comment-15347124
 ] 

ASF GitHub Bot commented on NIFI-2059:
--

Github user mcgilman commented on the issue:

https://github.com/apache/nifi/pull/572
  
Looks great @markap14! This has been merged to master.


> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2059) Secure cluster request replication

2016-06-23 Thread Matt Gilman (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman updated NIFI-2059:
--
Assignee: Mark Payne

> Secure cluster request replication
> --
>
> Key: NIFI-2059
> URL: https://issues.apache.org/jira/browse/NIFI-2059
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Reporter: Matt Gilman
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0
>
>
> I attempted to stand up a secure cluster and was having issues with request 
> replication. It appears that with the current approach every node will need 
> to authorize every other node as a proxy and we need to ensure those requests 
> are being replicated on behalf of the end user.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2101) Flow File Details Dialog

2016-06-23 Thread Scott Aslan (JIRA)
Scott Aslan created NIFI-2101:
-

 Summary: Flow File Details Dialog
 Key: NIFI-2101
 URL: https://issues.apache.org/jira/browse/NIFI-2101
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Scott Aslan


Needs UI refresh



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2100) Queue Listing Dialog

2016-06-23 Thread Scott Aslan (JIRA)
Scott Aslan created NIFI-2100:
-

 Summary: Queue Listing Dialog
 Key: NIFI-2100
 URL: https://issues.apache.org/jira/browse/NIFI-2100
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Scott Aslan


Needs UI refresh



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2100) Queue Listing Dialog

2016-06-23 Thread Scott Aslan (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Aslan updated NIFI-2100:
--
Attachment: screenshot-1.png

> Queue Listing Dialog
> 
>
> Key: NIFI-2100
> URL: https://issues.apache.org/jira/browse/NIFI-2100
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Scott Aslan
> Attachments: screenshot-1.png
>
>
> Needs UI refresh



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2102) Queue Viewer Refresh

2016-06-23 Thread Matt Gilman (JIRA)
Matt Gilman created NIFI-2102:
-

 Summary: Queue Viewer Refresh
 Key: NIFI-2102
 URL: https://issues.apache.org/jira/browse/NIFI-2102
 Project: Apache NiFi
  Issue Type: Sub-task
  Components: Core UI
Reporter: Matt Gilman
 Fix For: 1.0.0


Sure queue viewer and all associated dialogs are properly styled. Include 
FlowFile details, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2101) Flow File Details Dialog

2016-06-23 Thread Scott Aslan (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Aslan updated NIFI-2101:
--
Attachment: screenshot-1.png

> Flow File Details Dialog
> 
>
> Key: NIFI-2101
> URL: https://issues.apache.org/jira/browse/NIFI-2101
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Scott Aslan
> Attachments: screenshot-1.png
>
>
> Needs UI refresh



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (NIFI-2102) Queue Viewer Refresh

2016-06-23 Thread Matt Gilman (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Gilman resolved NIFI-2102.
---
Resolution: Duplicate

> Queue Viewer Refresh
> 
>
> Key: NIFI-2102
> URL: https://issues.apache.org/jira/browse/NIFI-2102
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Matt Gilman
> Fix For: 1.0.0
>
>
> Sure queue viewer and all associated dialogs are properly styled. Include 
> FlowFile details, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (MINIFI-41) Command Line Configuration Utility

2016-06-23 Thread Bryan Rosander (JIRA)
Bryan Rosander created MINIFI-41:


 Summary: Command Line Configuration Utility
 Key: MINIFI-41
 URL: https://issues.apache.org/jira/browse/MINIFI-41
 Project: Apache NiFi MiNiFi
  Issue Type: New Feature
Reporter: Bryan Rosander


It would really increase usability if we had a way to transform template xmls 
into configuration YAML files for consumption by MiNiFi.

The utility should:
1. Transform template xmls exported from NiFi into configuration YAML files.
2. Validate the contents of a given YAML file in the same way MiNiFi does at 
runtime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


nifi git commit: NIFI-2092 Fixing unit tests which try to clean up directories before stopping the FlowController that has locks opened.

2016-06-23 Thread jpercivall
Repository: nifi
Updated Branches:
  refs/heads/master fd5327e1b -> f0662a24e


NIFI-2092 Fixing unit tests which try to clean up directories before stopping 
the FlowController that has locks opened.

This closes #568


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f0662a24
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f0662a24
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f0662a24

Branch: refs/heads/master
Commit: f0662a24ef6ddd73eecf5393cb83718d38ae5cd5
Parents: fd5327e
Author: jpercivall 
Authored: Thu Jun 23 12:42:16 2016 -0400
Committer: jpercivall 
Committed: Thu Jun 23 16:40:00 2016 -0400

--
 .../apache/nifi/controller/scheduling/TestProcessorLifecycle.java  | 2 +-
 .../test/java/org/apache/nifi/controller/MonitorMemoryTest.java| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/f0662a24/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
index 2aaa88a..16f4784 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java
@@ -91,9 +91,9 @@ public class TestProcessorLifecycle {
 
 @After
 public void after() throws Exception {
+fc.shutdown(true);
 FileUtils.deleteDirectory(new File("./target/test-repo"));
 FileUtils.deleteDirectory(new File("./target/content_repository"));
-fc.shutdown(true);
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/nifi/blob/f0662a24/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
--
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
index 0970da4..7109537 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/test/java/org/apache/nifi/controller/MonitorMemoryTest.java
@@ -51,9 +51,9 @@ public class MonitorMemoryTest {
 
 @After
 public void after() throws Exception {
+fc.shutdown(true);
 FileUtils.deleteDirectory(new File("./target/test-repo"));
 FileUtils.deleteDirectory(new File("./target/content_repository"));
-fc.shutdown(true);
 }
 
 @Test(expected = IllegalStateException.class)



[jira] [Commented] (NIFI-2092) TestProcessorLifecyle fails on Windows

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347168#comment-15347168
 ] 

ASF subversion and git services commented on NIFI-2092:
---

Commit f0662a24ef6ddd73eecf5393cb83718d38ae5cd5 in nifi's branch 
refs/heads/master from [~JPercivall]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=f0662a2 ]

NIFI-2092 Fixing unit tests which try to clean up directories before stopping 
the FlowController that has locks opened.

This closes #568


> TestProcessorLifecyle fails on Windows
> --
>
> Key: NIFI-2092
> URL: https://issues.apache.org/jira/browse/NIFI-2092
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Joseph Percivall
> Fix For: 1.0.0, 0.7.0
>
>
> Currently, the "after" method tries to delete the content-repo and test-repo 
> before shutting down the flowcontroller[1] (causing failures due to files 
> being locked).
> `fc.shutdown(true)` should be moved before the deleteDirectory() calls.
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestProcessorLifecycle.java#L93-L93



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2103) Flow diagram gets cutoff

2016-06-23 Thread Joseph Witt (JIRA)
Joseph Witt created NIFI-2103:
-

 Summary: Flow diagram gets cutoff
 Key: NIFI-2103
 URL: https://issues.apache.org/jira/browse/NIFI-2103
 Project: Apache NiFi
  Issue Type: Sub-task
  Components: Core UI
Affects Versions: 1.0.0
Reporter: Joseph Witt
 Fix For: 1.0.0


See attached image.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2103) Flow diagram gets cutoff

2016-06-23 Thread Joseph Witt (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joseph Witt updated NIFI-2103:
--
Attachment: Screen Shot 2016-06-23 at 2.01.27 PM.png

> Flow diagram gets cutoff
> 
>
> Key: NIFI-2103
> URL: https://issues.apache.org/jira/browse/NIFI-2103
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Joseph Witt
> Fix For: 1.0.0
>
> Attachments: Screen Shot 2016-06-23 at 2.01.27 PM.png
>
>
> See attached image.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2103) Flow diagram gets cutoff

2016-06-23 Thread Joseph Witt (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347188#comment-15347188
 ] 

Joseph Witt commented on NIFI-2103:
---

once i resize the browser it refreshes and goes to where it should

> Flow diagram gets cutoff
> 
>
> Key: NIFI-2103
> URL: https://issues.apache.org/jira/browse/NIFI-2103
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Joseph Witt
> Fix For: 1.0.0
>
> Attachments: Screen Shot 2016-06-23 at 2.01.27 PM.png
>
>
> See attached image.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (NIFI-2104) Text in Processor dialogue gets cutoff

2016-06-23 Thread Joseph Witt (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joseph Witt updated NIFI-2104:
--
Attachment: Screen Shot 2016-06-23 at 2.08.03 PM.png

> Text in Processor dialogue gets cutoff
> --
>
> Key: NIFI-2104
> URL: https://issues.apache.org/jira/browse/NIFI-2104
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Joseph Witt
> Fix For: 1.0.0
>
> Attachments: Screen Shot 2016-06-23 at 2.08.03 PM.png
>
>
> see attached image.  RElationship description gets cutoff.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2104) Text in Processor dialogue gets cutoff

2016-06-23 Thread Joseph Witt (JIRA)
Joseph Witt created NIFI-2104:
-

 Summary: Text in Processor dialogue gets cutoff
 Key: NIFI-2104
 URL: https://issues.apache.org/jira/browse/NIFI-2104
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Joseph Witt
 Fix For: 1.0.0
 Attachments: Screen Shot 2016-06-23 at 2.08.03 PM.png

see attached image.  RElationship description gets cutoff.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[09/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
deleted file mode 100644
index d98c755..000
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.web.api;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HEAD;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
-import org.apache.nifi.web.IllegalClusterResourceRequestException;
-import org.apache.nifi.web.NiFiServiceFacade;
-import org.apache.nifi.web.api.dto.ClusterDTO;
-import org.apache.nifi.web.api.dto.NodeDTO;
-import org.apache.nifi.web.api.dto.search.NodeSearchResultDTO;
-import org.apache.nifi.web.api.entity.ClusterEntity;
-import org.apache.nifi.web.api.entity.ClusterSearchResultsEntity;
-import org.apache.nifi.web.api.entity.NodeEntity;
-
-import com.sun.jersey.api.core.ResourceContext;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiParam;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
-import com.wordnik.swagger.annotations.Authorization;
-
-
-/**
- * RESTful endpoint for managing a cluster.
- */
-@Path("/cluster")
-@Api(
-value = "/cluster",
-description = "Endpoint for managing the cluster."
-)
-public class ClusterResource extends ApplicationResource {
-
-@Context
-private ResourceContext resourceContext;
-private NiFiServiceFacade serviceFacade;
-
-/**
- * Returns a 200 OK response to indicate this is a valid cluster endpoint.
- *
- * @return An OK response with an empty entity body.
- */
-@HEAD
-@Consumes(MediaType.WILDCARD)
-@Produces(MediaType.WILDCARD)
-public Response getClusterHead() {
-if (isConnectedToCluster()) {
-return Response.ok().build();
-} else {
-return Response.status(Response.Status.NOT_FOUND).entity("NiFi 
instance is not clustered").build();
-}
-}
-
-/**
- * Gets the contents of this NiFi cluster. This includes all nodes and 
their status.
- *
- * @return A clusterEntity
- */
-@GET
-@Consumes(MediaType.WILDCARD)
-@Produces(MediaType.APPLICATION_JSON)
-// TODO - @PreAuthorize("hasAnyRole('ROLE_MONITOR', 'ROLE_DFM', 
'ROLE_ADMIN')")
-@ApiOperation(
-value = "Gets the contents of the cluster",
-notes = "Returns the contents of the cluster including all nodes 
and their status.",
-response = ClusterEntity.class,
-authorizations = {
-@Authorization(value = "Read Only", type = "ROLE_MONITOR"),
-@Authorization(value = "DFM", type = "ROLE_DFM"),
-@Authorization(value = "Admin", type = "ROLE_ADMIN")
-}
-)
-@ApiResponses(
-value = {
-@ApiResponse(code = 400, message = "NiFi was unable to 
complete the request because it was invalid. The request should not be retried 
without modification."),
-@ApiResponse(code = 401, message = "Client could not be 
authenticated."),
-   

[11/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
NIFI-1554:
- Addressing access controls for the Controller resource.
- Addressing access controls for RAW site to site clients.
- Addressing access controls for downloading content (from provenance and 
queue).
- Addressing access controls for accessing queues.
- Addressing access controls for cluster endpoints.
- Addressing access controls for counter endpoints.
- Removing redundant authorization calls.
NIFI-2044:
- Requiring revision when creating components.
- Requiring component creation over POST requests.
NIFI-1901
- Continuing to restore access control tests.
- Converting access control tests to itegration tests.
- Restoring contrib check to travis build.
- This closes #567


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f0811ca4
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f0811ca4
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f0811ca4

Branch: refs/heads/master
Commit: f0811ca45adf15edf02f0f2d5f1d2d6929edd329
Parents: f0662a2
Author: Matt Gilman 
Authored: Thu Jun 23 15:55:18 2016 -0400
Committer: Matt Gilman 
Committed: Thu Jun 23 17:09:54 2016 -0400

--
 .travis.yml |2 +-
 .../main/java/org/apache/nifi/web/Revision.java |   27 +-
 .../java/org/apache/nifi/web/TestRevision.java  |   61 +
 .../nifi-framework/nifi-authorizer/pom.xml  |4 +
 .../web/api/dto/ControllerConfigurationDTO.java |   54 +-
 .../nifi/web/api/dto/FlowConfigurationDTO.java  |   80 ++
 .../apache/nifi/web/api/dto/RevisionDTO.java|3 +-
 .../entity/ControllerConfigurationEntity.java   |   29 +-
 .../web/api/entity/FlowConfigurationEntity.java |   48 +
 .../authorization/resource/Authorizable.java|   26 +-
 .../authorization/resource/ResourceFactory.java |   44 +
 .../authorization/resource/ResourceType.java|1 +
 .../nifi/authorization/user/NiFiUser.java   |4 -
 .../endpoints/ReportingTasksEndpointMerger.java |2 +-
 .../nifi/web/revision/UpdateRevisionTask.java   |   32 -
 .../controller/StandardFlowServiceTest.java |   22 +-
 .../scheduling/TestProcessorLifecycle.java  |   42 +-
 .../nifi/remote/StandardRootGroupPort.java  |   28 +-
 .../HttpServletConfigurationRequestContext.java |6 +-
 .../nifi-web/nifi-web-api/pom.xml   |2 +-
 .../org/apache/nifi/web/AuthorizableLookup.java |7 +
 .../org/apache/nifi/web/NiFiServiceFacade.java  |   70 +-
 .../nifi/web/StandardAuthorizableLookup.java|5 +
 .../nifi/web/StandardNiFiServiceFacade.java |  467 +++
 .../StandardNiFiWebConfigurationContext.java|   12 +-
 .../java/org/apache/nifi/web/UpdateResult.java  |   40 -
 .../nifi/web/api/AccessPolicyResource.java  |   20 +-
 .../apache/nifi/web/api/ClusterResource.java|  357 -
 .../apache/nifi/web/api/ConnectionResource.java |   17 +-
 .../apache/nifi/web/api/ControllerResource.java |  651 ++---
 .../nifi/web/api/ControllerServiceResource.java |   23 +-
 .../apache/nifi/web/api/CountersResource.java   |  252 
 .../nifi/web/api/FlowFileQueueResource.java |   69 +-
 .../org/apache/nifi/web/api/FlowResource.java   |  386 -
 .../org/apache/nifi/web/api/FunnelResource.java |   17 +-
 .../apache/nifi/web/api/HistoryResource.java|  525 ---
 .../apache/nifi/web/api/InputPortResource.java  |   53 +-
 .../org/apache/nifi/web/api/LabelResource.java  |   51 +-
 .../org/apache/nifi/web/api/NodeResource.java   |  219 ---
 .../apache/nifi/web/api/OutputPortResource.java |   53 +-
 .../nifi/web/api/ProcessGroupResource.java  |  151 +-
 .../apache/nifi/web/api/ProcessorResource.java  |   17 +-
 .../web/api/RemoteProcessGroupResource.java |   15 +-
 .../nifi/web/api/ReportingTaskResource.java |   23 +-
 .../apache/nifi/web/api/SiteToSiteResource.java |   21 +-
 .../apache/nifi/web/api/UserGroupsResource.java |   16 +-
 .../org/apache/nifi/web/api/UsersResource.java  |   16 +-
 .../org/apache/nifi/web/api/dto/DtoFactory.java |7 +-
 .../apache/nifi/web/api/dto/EntityFactory.java  |9 +-
 .../nifi/web/controller/ControllerFacade.java   |  107 +-
 .../web/dao/impl/StandardConnectionDAO.java |   33 +-
 .../dao/impl/StandardControllerServiceDAO.java  |7 +-
 .../src/main/resources/nifi-web-api-context.xml |   19 +-
 .../web/StandardNiFiServiceFacadeSpec.groovy|  224 ++-
 .../apache/nifi/integration/NiFiWebApiTest.java |6 +-
 .../accesscontrol/AccessControlHelper.java  |   31 +
 .../accesscontrol/AccessTokenEndpointTest.java  |  274 
 .../accesscontrol/AdminAccessControlTest.java   | 1010 -
 .../ConnectionAccessControlTest.java|  427 --
 .../accesscontrol/DfmAccessControlTest.java | 1322 --
 .../accesscontrol/FunnelAccessControlTest.java  |  361 -
 .../accesscontrol/ITAccessTokenEndpoint.java|  274 
 .../ITConnectionAccessControl.java 

[02/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/OutputPortAccessControlTest.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/OutputPortAccessControlTest.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/OutputPortAccessControlTest.java
deleted file mode 100644
index 900b11f..000
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/OutputPortAccessControlTest.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.integration.accesscontrol;
-
-import com.sun.jersey.api.client.ClientResponse;
-import org.apache.nifi.integration.util.NiFiTestAuthorizer;
-import org.apache.nifi.integration.util.NiFiTestUser;
-import org.apache.nifi.web.api.dto.PortDTO;
-import org.apache.nifi.web.api.dto.RevisionDTO;
-import org.apache.nifi.web.api.dto.flow.FlowDTO;
-import org.apache.nifi.web.api.entity.PortEntity;
-import org.apache.nifi.web.api.entity.ProcessGroupFlowEntity;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.NONE_CLIENT_ID;
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.READ_CLIENT_ID;
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.READ_WRITE_CLIENT_ID;
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.WRITE_CLIENT_ID;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Access control test for output ports.
- */
-public class OutputPortAccessControlTest {
-
-private static final String FLOW_XML_PATH = 
"target/test-classes/access-control/flow-output-ports.xml";
-
-private static AccessControlHelper helper;
-private static int count = 0;
-
-@BeforeClass
-public static void setup() throws Exception {
-helper = new AccessControlHelper(FLOW_XML_PATH);
-}
-
-/**
- * Ensures the READ user can get an output port.
- *
- * @throws Exception ex
- */
-@Test
-public void testReadUserGetOutputPort() throws Exception {
-final PortEntity entity = getRandomOutputPort(helper.getReadUser());
-assertTrue(entity.getAccessPolicy().getCanRead());
-assertFalse(entity.getAccessPolicy().getCanWrite());
-assertNotNull(entity.getComponent());
-}
-
-/**
- * Ensures the READ WRITE user can get an output port.
- *
- * @throws Exception ex
- */
-@Test
-public void testReadWriteUserGetOutputPort() throws Exception {
-final PortEntity entity = 
getRandomOutputPort(helper.getReadWriteUser());
-assertTrue(entity.getAccessPolicy().getCanRead());
-assertTrue(entity.getAccessPolicy().getCanWrite());
-assertNotNull(entity.getComponent());
-}
-
-/**
- * Ensures the WRITE user can get an output port.
- *
- * @throws Exception ex
- */
-@Test
-public void testWriteUserGetOutputPort() throws Exception {
-final PortEntity entity = getRandomOutputPort(helper.getWriteUser());
-assertFalse(entity.getAccessPolicy().getCanRead());
-assertTrue(entity.getAccessPolicy().getCanWrite());
-assertNull(entity.getComponent());
-}
-
-/**
- * Ensures the NONE user can get an output port.
- *
- * @throws Exception ex
- */
-@Test
-public void testNoneUserGetOutputPort() throws Exception {
-final PortEntity entity = getRandomOutputPort(he

[10/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 50fa505..eaaef98 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -17,15 +17,16 @@
 package org.apache.nifi.web;
 
 import com.google.common.collect.Sets;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.action.Action;
 import org.apache.nifi.action.Component;
 import org.apache.nifi.action.FlowChangeAction;
 import org.apache.nifi.action.Operation;
 import org.apache.nifi.action.details.FlowChangePurgeDetails;
 import org.apache.nifi.admin.service.AuditService;
-import org.apache.nifi.admin.service.KeyService;
+import org.apache.nifi.authorization.AccessDeniedException;
 import org.apache.nifi.authorization.AccessPolicy;
+import org.apache.nifi.authorization.AuthorizationResult;
+import org.apache.nifi.authorization.AuthorizationResult.Result;
 import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.authorization.Group;
 import org.apache.nifi.authorization.RequestAction;
@@ -97,6 +98,7 @@ import org.apache.nifi.web.api.dto.DocumentedTypeDTO;
 import org.apache.nifi.web.api.dto.DropRequestDTO;
 import org.apache.nifi.web.api.dto.DtoFactory;
 import org.apache.nifi.web.api.dto.EntityFactory;
+import org.apache.nifi.web.api.dto.FlowConfigurationDTO;
 import org.apache.nifi.web.api.dto.FlowFileDTO;
 import org.apache.nifi.web.api.dto.FlowSnippetDTO;
 import org.apache.nifi.web.api.dto.FunnelDTO;
@@ -141,6 +143,7 @@ import 
org.apache.nifi.web.api.entity.ControllerConfigurationEntity;
 import org.apache.nifi.web.api.entity.ControllerServiceEntity;
 import 
org.apache.nifi.web.api.entity.ControllerServiceReferencingComponentEntity;
 import 
org.apache.nifi.web.api.entity.ControllerServiceReferencingComponentsEntity;
+import org.apache.nifi.web.api.entity.FlowConfigurationEntity;
 import org.apache.nifi.web.api.entity.FlowEntity;
 import org.apache.nifi.web.api.entity.FunnelEntity;
 import org.apache.nifi.web.api.entity.LabelEntity;
@@ -184,6 +187,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
@@ -240,7 +244,6 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
 
 // administrative services
 private AuditService auditService;
-private KeyService keyService;
 
 // properties
 private NiFiProperties properties;
@@ -515,12 +518,7 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
 // Write Operations
 // -
 @Override
-public UpdateResult updateAccessPolicy(final Revision 
revision, final AccessPolicyDTO accessPolicyDTO) {
-// if access policy does not exist, then create new access policy
-if (!accessPolicyDAO.hasAccessPolicy(accessPolicyDTO.getId())) {
-return new UpdateResult<>(createAccessPolicy(revision, 
accessPolicyDTO), false);
-}
-
+public AccessPolicyEntity updateAccessPolicy(final Revision revision, 
final AccessPolicyDTO accessPolicyDTO) {
 final Authorizable accessPolicyAuthorizable = 
authorizableLookup.getAccessPolicyAuthorizable(accessPolicyDTO.getId());
 final RevisionUpdate snapshot = 
updateComponent(revision,
 accessPolicyAuthorizable,
@@ -532,16 +530,11 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
 });
 
 final AccessPolicyDTO accessPolicy = 
dtoFactory.createAccessPolicyDto(accessPolicyAuthorizable);
-return new 
UpdateResult<>(entityFactory.createAccessPolicyEntity(snapshot.getComponent(), 
dtoFactory.createRevisionDTO(snapshot.getLastModification()), accessPolicy), 
false);
+return entityFactory.createAccessPolicyEntity(snapshot.getComponent(), 
dtoFactory.createRevisionDTO(snapshot.getLastModification()), accessPolicy);
 }
 
 @Override
-public UpdateResult updateUser(final Revision revision, final 
UserDTO userDTO) {
-// if user does not exist, then create new user
-if (!userDAO.hasUser(userDTO.getId())) {
-return new UpdateResult<>(createUser(re

[05/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ConnectionAccessControlTest.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ConnectionAccessControlTest.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ConnectionAccessControlTest.java
deleted file mode 100644
index ab01ea8..000
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ConnectionAccessControlTest.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.integration.accesscontrol;
-
-import com.sun.jersey.api.client.ClientResponse;
-import org.apache.nifi.connectable.ConnectableType;
-import org.apache.nifi.integration.util.NiFiTestAuthorizer;
-import org.apache.nifi.integration.util.NiFiTestUser;
-import org.apache.nifi.web.api.dto.ConnectableDTO;
-import org.apache.nifi.web.api.dto.ConnectionDTO;
-import org.apache.nifi.web.api.dto.RevisionDTO;
-import org.apache.nifi.web.api.dto.flow.FlowDTO;
-import org.apache.nifi.web.api.entity.ConnectionEntity;
-import org.apache.nifi.web.api.entity.ProcessGroupFlowEntity;
-import org.apache.nifi.web.api.entity.ProcessorEntity;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.NONE_CLIENT_ID;
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.READ_CLIENT_ID;
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.READ_WRITE_CLIENT_ID;
-import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.WRITE_CLIENT_ID;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Access control test for connections.
- */
-public class ConnectionAccessControlTest {
-
-private static final String FLOW_XML_PATH = 
"target/test-classes/access-control/flow-connections.xml";
-
-private static AccessControlHelper helper;
-
-@BeforeClass
-public static void setup() throws Exception {
-helper = new AccessControlHelper(FLOW_XML_PATH);
-}
-
-/**
- * Ensures the READ user can get a connection.
- *
- * @throws Exception ex
- */
-@Test
-public void testReadUserGetConnection() throws Exception {
-final ConnectionEntity entity = 
getRandomConnection(helper.getReadUser());
-assertTrue(entity.getAccessPolicy().getCanRead());
-assertFalse(entity.getAccessPolicy().getCanWrite());
-assertNotNull(entity.getComponent());
-}
-
-/**
- * Ensures the READ WRITE user can get a connection.
- *
- * @throws Exception ex
- */
-@Test
-public void testReadWriteUserGetConnection() throws Exception {
-final ConnectionEntity entity = 
getRandomConnection(helper.getReadWriteUser());
-assertTrue(entity.getAccessPolicy().getCanRead());
-assertTrue(entity.getAccessPolicy().getCanWrite());
-assertNotNull(entity.getComponent());
-}
-
-/**
- * Ensures the WRITE user can get a connection.
- *
- * @throws Exception ex
- */
-@Test
-public void testWriteUserGetConnection() throws Exception {
-final ConnectionEntity entity = 
getRandomConnection(helper.getWriteUser());
-assertFalse(entity.getAccessPolicy().getCanRead());
-assertTrue(entity.getAccessPolicy().getCanWrite());
-assertNull(entity.getComponent());
-}
-
-/**
- * Ensures the NONE user can get a connection.
-  

[01/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
Repository: nifi
Updated Branches:
  refs/heads/master f0662a24e -> f0811ca45


http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiFlowTestAuthorizer.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiFlowTestAuthorizer.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiFlowTestAuthorizer.java
new file mode 100644
index 000..07d6906
--- /dev/null
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiFlowTestAuthorizer.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.integration.util;
+
+import org.apache.nifi.authorization.AuthorizationRequest;
+import org.apache.nifi.authorization.AuthorizationResult;
+import org.apache.nifi.authorization.Authorizer;
+import org.apache.nifi.authorization.AuthorizerConfigurationContext;
+import org.apache.nifi.authorization.AuthorizerInitializationContext;
+import org.apache.nifi.authorization.RequestAction;
+import org.apache.nifi.authorization.exception.AuthorizationAccessException;
+import org.apache.nifi.authorization.exception.AuthorizerCreationException;
+import org.apache.nifi.authorization.resource.ResourceFactory;
+
+/**
+ *
+ */
+public class NiFiFlowTestAuthorizer implements Authorizer {
+
+public static final String NO_POLICY_COMPONENT_NAME = "No policies";
+
+public static final String PROXY_DN = "CN=localhost, OU=Apache NiFi, 
O=Apache, L=Santa Monica, ST=CA, C=US";
+
+public static final String NONE_USER_DN = "none@nifi";
+public static final String READ_USER_DN = "read@nifi";
+public static final String WRITE_USER_DN = "write@nifi";
+public static final String READ_WRITE_USER_DN = "readwrite@nifi";
+
+public static final String TOKEN_USER = "user@nifi";
+
+/**
+ * Creates a new FileAuthorizationProvider.
+ */
+public NiFiFlowTestAuthorizer() {
+}
+
+@Override
+public void initialize(AuthorizerInitializationContext 
initializationContext) throws AuthorizerCreationException {
+}
+
+@Override
+public void onConfigured(AuthorizerConfigurationContext 
configurationContext) throws AuthorizerCreationException {
+}
+
+@Override
+public AuthorizationResult authorize(AuthorizationRequest request) throws 
AuthorizationAccessException {
+// allow proxy
+if 
(ResourceFactory.getProxyResource().getIdentifier().equals(request.getResource().getIdentifier())
 && PROXY_DN.equals(request.getIdentity())) {
+return AuthorizationResult.approved();
+}
+
+// read access
+if (READ_USER_DN.equals(request.getIdentity()) || 
READ_WRITE_USER_DN.equals(request.getIdentity())) {
+if (RequestAction.READ.equals(request.getAction())) {
+return AuthorizationResult.approved();
+}
+}
+
+// write access
+if (WRITE_USER_DN.equals(request.getIdentity()) || 
READ_WRITE_USER_DN.equals(request.getIdentity())) {
+if (RequestAction.WRITE.equals(request.getAction())) {
+return AuthorizationResult.approved();
+}
+}
+
+return AuthorizationResult.denied();
+}
+
+@Override
+public void preDestruction() {
+}
+
+}

http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiTestAuthorizer.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiTestAuthorizer.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/util/NiFiTestAuthorize

[06/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/groovy/org/apache/nifi/web/StandardNiFiServiceFacadeSpec.groovy
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/groovy/org/apache/nifi/web/StandardNiFiServiceFacadeSpec.groovy
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/groovy/org/apache/nifi/web/StandardNiFiServiceFacadeSpec.groovy
index a4c2b37..7b5f594 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/groovy/org/apache/nifi/web/StandardNiFiServiceFacadeSpec.groovy
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/groovy/org/apache/nifi/web/StandardNiFiServiceFacadeSpec.groovy
@@ -20,6 +20,7 @@ import org.apache.nifi.authorization.*
 import org.apache.nifi.authorization.resource.Authorizable
 import org.apache.nifi.authorization.resource.ResourceFactory
 import org.apache.nifi.authorization.user.NiFiUser
+import org.apache.nifi.authorization.user.NiFiUserDetails
 import org.apache.nifi.controller.service.ControllerServiceProvider
 import org.apache.nifi.web.api.dto.*
 import org.apache.nifi.web.api.entity.UserEntity
@@ -28,11 +29,25 @@ import org.apache.nifi.web.dao.AccessPolicyDAO
 import org.apache.nifi.web.dao.UserDAO
 import org.apache.nifi.web.dao.UserGroupDAO
 import org.apache.nifi.web.revision.*
+import org.apache.nifi.web.security.token.NiFiAuthenticationToken
+import org.springframework.security.core.context.SecurityContextHolder
+import spock.lang.Ignore
 import spock.lang.Specification
 import spock.lang.Unroll
 
+@Ignore
 class StandardNiFiServiceFacadeSpec extends Specification {
 
+def setup() {
+final NiFiUser user = new NiFiUser("nifi-user");
+final NiFiAuthenticationToken auth = new NiFiAuthenticationToken(new 
NiFiUserDetails(user));
+SecurityContextHolder.getContext().setAuthentication(auth);
+}
+
+def cleanup() {
+SecurityContextHolder.getContext().setAuthentication(null);
+}
+
 @Unroll
 def "CreateUser: isAuthorized: #isAuthorized"() {
 given:
@@ -48,7 +63,7 @@ class StandardNiFiServiceFacadeSpec extends Specification {
 def newUser = new 
User.Builder().identifier(userDto.id).identity(userDto.identity).build()
 
 when:
-def userEntity = niFiServiceFacade.createUser(new Revision(0L, 
'client-1'), userDto)
+def userEntity = niFiServiceFacade.createUser(new Revision(0L, 
'client-1', userDto.id), userDto)
 
 then:
 1 * userDao.createUser(_) >> newUser
@@ -97,19 +112,19 @@ class StandardNiFiServiceFacadeSpec extends Specification {
 }
 
 then:
-if (isAuthorized) {
-1 * userDao.getUser(userDto.id) >> requestedUser
-}
+1 * userDao.getUser(userDto.id) >> requestedUser
 1 * revisionManager.get(_, _) >> { String id, ReadOnlyRevisionCallback 
callback ->
 callback.withRevision(new Revision(1L, 'client1', 'root'))
 }
 1 * authorizableLookup.getUsersAuthorizable() >> new 
SimpleAuthorizable(null, ResourceFactory.getUsersResource(),
 isAuthorized, authorizationResult)
 0 * _
+
+assert userEntity != null
 if (isAuthorized) {
-assert userEntity?.component?.id?.equals(userDto.id)
+assert userEntity.component?.id?.equals(userDto.id)
 } else {
-assert exception instanceof AccessDeniedException
+assert userEntity.component == null
 }
 
 where:
@@ -149,6 +164,7 @@ class StandardNiFiServiceFacadeSpec extends Specification {
 1 * revisionManager.updateRevision(_, _, _) >> { RevisionClaim 
revisionClaim, NiFiUser niFiUser, UpdateRevisionTask callback ->
 callback.update()
 }
+1 * revisionManager.getRevision(currentRevision.componentId) >> 
currentRevision.incrementRevision(currentRevision.clientId)
 }
 1 * authorizableLookup.getUsersAuthorizable() >> new 
SimpleAuthorizable(null, ResourceFactory.getUsersResource(),
 isAuthorized, authorizationResult)
@@ -215,11 +231,11 @@ class StandardNiFiServiceFacadeSpec extends Specification 
{
 }
 
 where:
-userExists | currentRevision | userDto | 
isAuthorized | authorizationResult
-true   | new Revision(1L, 'client1') | createUserDTO() | true  
   | AuthorizationResult.approved()
-false  | null| createUserDTO() | true  
   | AuthorizationResult.approved()
-true   | new Revision(1L, 'client1') | createUserDTO() | false 
   | AuthorizationResult.denied()
-false  | null| createUserDTO() 

[jira] [Updated] (NIFI-2105) Flow status graphs when resizing window get wacky

2016-06-23 Thread Joseph Witt (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joseph Witt updated NIFI-2105:
--
Attachment: Screen Shot 2016-06-23 at 2.11.44 PM.png

> Flow status graphs when resizing window get wacky
> -
>
> Key: NIFI-2105
> URL: https://issues.apache.org/jira/browse/NIFI-2105
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Joseph Witt
> Attachments: Screen Shot 2016-06-23 at 2.11.44 PM.png
>
>
> When you first bring up the status history it looks great.  If you make the 
> window smaller it quickly becomes messed up.  If you resize window larger 
> again it looks ok again.  If you make it smaller again it looks bad again.  
> If you change tabs and come back then it is fine again.  So seems like some 
> missing lifecycle call?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2105) Flow status graphs when resizing window get wacky

2016-06-23 Thread Joseph Witt (JIRA)
Joseph Witt created NIFI-2105:
-

 Summary: Flow status graphs when resizing window get wacky
 Key: NIFI-2105
 URL: https://issues.apache.org/jira/browse/NIFI-2105
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Joseph Witt
 Attachments: Screen Shot 2016-06-23 at 2.11.44 PM.png

When you first bring up the status history it looks great.  If you make the 
window smaller it quickly becomes messed up.  If you resize window larger again 
it looks ok again.  If you make it smaller again it looks bad again.  If you 
change tabs and come back then it is fine again.  So seems like some missing 
lifecycle call?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[04/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITAccessTokenEndpoint.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITAccessTokenEndpoint.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITAccessTokenEndpoint.java
new file mode 100644
index 000..55fa1a4
--- /dev/null
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITAccessTokenEndpoint.java
@@ -0,0 +1,274 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.integration.accesscontrol;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import org.apache.commons.io.FileUtils;
+import org.apache.nifi.integration.util.NiFiTestServer;
+import org.apache.nifi.integration.util.NiFiTestUser;
+import org.apache.nifi.integration.util.SourceTestProcessor;
+import org.apache.nifi.nar.ExtensionManager;
+import org.apache.nifi.nar.NarClassLoaders;
+import org.apache.nifi.security.util.SslContextFactory;
+import org.apache.nifi.util.NiFiProperties;
+import org.apache.nifi.web.api.dto.AccessConfigurationDTO;
+import org.apache.nifi.web.api.dto.AccessStatusDTO;
+import org.apache.nifi.web.api.dto.ProcessorDTO;
+import org.apache.nifi.web.api.dto.RevisionDTO;
+import org.apache.nifi.web.api.entity.AccessConfigurationEntity;
+import org.apache.nifi.web.api.entity.AccessStatusEntity;
+import org.apache.nifi.web.api.entity.ProcessorEntity;
+import org.apache.nifi.web.util.WebUtils;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Access token endpoint test.
+ */
+public class ITAccessTokenEndpoint {
+
+private static final String CLIENT_ID = "token-endpoint-id";
+private static final String CONTEXT_PATH = "/nifi-api";
+private static final String FLOW_XML_PATH = 
"target/test-classes/access-control/flow-admin.xml";
+
+private static NiFiTestServer SERVER;
+private static NiFiTestUser TOKEN_USER;
+private static String BASE_URL;
+
+@BeforeClass
+public static void setup() throws Exception {
+// configure the location of the nifi properties
+File nifiPropertiesFile = new 
File("src/test/resources/access-control/nifi.properties");
+System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, 
nifiPropertiesFile.getAbsolutePath());
+
+// update the flow.xml property
+NiFiProperties props = NiFiProperties.getInstance();
+props.setProperty("nifi.flow.configuration.file", FLOW_XML_PATH);
+
+// delete the database directory to avoid issues with re-registration 
in testRequestAccessUsingToken
+FileUtils.deleteDirectory(props.getDatabaseRepositoryPath().toFile());
+
+// load extensions
+NarClassLoaders.load(props);
+ExtensionManager.discoverExtensions();
+
+// start the server
+SERVER = new NiFiTestServer("src/main/webapp", CONTEXT_PATH);
+SERVER.startServer();
+SERVER.loadFlow();
+
+// get the base url
+BASE_URL = SERVER.getBaseUrl() + CONTEXT_PATH;
+
+// create the user
+final Client client = WebUtils.createClient(null, 
createTrustContext(props));
+TOKEN_USER = new NiFiTestUser(client, null);
+}
+
+private static SSLContext createTrustContext(final NiFiProperties props) 
throws Exception {
+return 
SslContextFactory.createTrustSslContext(props.getProperty(NiFiProperties.SECURITY_TRUSTSTORE),
+
props.getProperty(NiFiProperties.SECURITY_TRUSTSTORE_PASSWD).toCharArray(),
+props.getProperty(NiFiProperties.SECURITY_TRUSTSTORE_TYPE), 
"TLS");
+}
+
+// ---

[03/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java
new file mode 100644
index 000..5de49df
--- /dev/null
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITOutputPortAccessControl.java
@@ -0,0 +1,405 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.integration.accesscontrol;
+
+import com.sun.jersey.api.client.ClientResponse;
+import org.apache.nifi.integration.util.NiFiTestAuthorizer;
+import org.apache.nifi.integration.util.NiFiTestUser;
+import org.apache.nifi.web.api.dto.PortDTO;
+import org.apache.nifi.web.api.dto.RevisionDTO;
+import org.apache.nifi.web.api.dto.flow.FlowDTO;
+import org.apache.nifi.web.api.entity.PortEntity;
+import org.apache.nifi.web.api.entity.ProcessGroupFlowEntity;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.NONE_CLIENT_ID;
+import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.READ_CLIENT_ID;
+import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.READ_WRITE_CLIENT_ID;
+import static 
org.apache.nifi.integration.accesscontrol.AccessControlHelper.WRITE_CLIENT_ID;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Access control test for output ports.
+ */
+public class ITOutputPortAccessControl {
+
+private static final String FLOW_XML_PATH = 
"target/test-classes/access-control/flow-output-ports.xml";
+
+private static AccessControlHelper helper;
+private static int count = 0;
+
+@BeforeClass
+public static void setup() throws Exception {
+helper = new AccessControlHelper(FLOW_XML_PATH);
+}
+
+/**
+ * Ensures the READ user can get an output port.
+ *
+ * @throws Exception ex
+ */
+@Test
+public void testReadUserGetOutputPort() throws Exception {
+final PortEntity entity = getRandomOutputPort(helper.getReadUser());
+assertTrue(entity.getAccessPolicy().getCanRead());
+assertFalse(entity.getAccessPolicy().getCanWrite());
+assertNotNull(entity.getComponent());
+}
+
+/**
+ * Ensures the READ WRITE user can get an output port.
+ *
+ * @throws Exception ex
+ */
+@Test
+public void testReadWriteUserGetOutputPort() throws Exception {
+final PortEntity entity = 
getRandomOutputPort(helper.getReadWriteUser());
+assertTrue(entity.getAccessPolicy().getCanRead());
+assertTrue(entity.getAccessPolicy().getCanWrite());
+assertNotNull(entity.getComponent());
+}
+
+/**
+ * Ensures the WRITE user can get an output port.
+ *
+ * @throws Exception ex
+ */
+@Test
+public void testWriteUserGetOutputPort() throws Exception {
+final PortEntity entity = getRandomOutputPort(helper.getWriteUser());
+assertFalse(entity.getAccessPolicy().getCanRead());
+assertTrue(entity.getAccessPolicy().getCanWrite());
+assertNull(entity.getComponent());
+}
+
+/**
+ * Ensures the NONE user can get an output port.
+ *
+ * @throws Exception ex
+ */
+@Test
+public void testNoneUserGetOutputPort() throws Exception {
+final PortEntity entity = getRandomOutputPort(helper.getNoneUs

[jira] [Commented] (NIFI-1554) Incorporate new Authorizer API

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347192#comment-15347192
 ] 

ASF GitHub Bot commented on NIFI-1554:
--

Github user bbende commented on the issue:

https://github.com/apache/nifi/pull/567
  
+1 looks good, verified full build passes with contrib-check and the new 
integration test pass, ran the app a bit and verified basic functionality


> Incorporate new Authorizer API
> --
>
> Key: NIFI-1554
> URL: https://issues.apache.org/jira/browse/NIFI-1554
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Reporter: Matt Gilman
>Assignee: Matt Gilman
> Fix For: 1.0.0
>
>
> - Introduce checks on user actions using new Authorizer API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[07/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
index 6a90d1f..b6671b2 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
@@ -16,36 +16,14 @@
  */
 package org.apache.nifi.web.api;
 
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.transform.stream.StreamSource;
-
+import com.sun.jersey.api.core.ResourceContext;
+import com.sun.jersey.multipart.FormDataParam;
+import com.wordnik.swagger.annotations.Api;
+import com.wordnik.swagger.annotations.ApiOperation;
+import com.wordnik.swagger.annotations.ApiParam;
+import com.wordnik.swagger.annotations.ApiResponse;
+import com.wordnik.swagger.annotations.ApiResponses;
+import com.wordnik.swagger.annotations.Authorization;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.authorization.RequestAction;
@@ -54,7 +32,6 @@ import org.apache.nifi.controller.Snippet;
 import org.apache.nifi.web.AuthorizableLookup;
 import org.apache.nifi.web.NiFiServiceFacade;
 import org.apache.nifi.web.Revision;
-import org.apache.nifi.web.UpdateResult;
 import org.apache.nifi.web.api.dto.ConnectionDTO;
 import org.apache.nifi.web.api.dto.ProcessGroupDTO;
 import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO;
@@ -88,14 +65,34 @@ import org.apache.nifi.web.api.request.LongParameter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.sun.jersey.api.core.ResourceContext;
-import com.sun.jersey.multipart.FormDataParam;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiParam;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
-import com.wordnik.swagger.annotations.Authorization;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.transform.stream.StreamSource;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * RESTful endpoint for managing a Group.
@@ -320,21 +317,16 @@ public class ProcessGroupResource extends 
ApplicationResource {
 serviceFacade,
 revision,
 lookup -> {
-final Authorizable processGroup = lookup.getProcessGroup(id);
-processGroup.authorize(authorizer, RequestAction.WRITE);
+Authorizable authorizable = lookup.getProcessGroup(id);
+authorizable.authorize(authorizer, RequestAction.WRITE);
 },
 null,
 () -> {
 // update the process group
-final UpdateResult updateResult = 
serviceFacade.updateProcessGroup(revision, requestProcessGroupDTO);
-   

[08/11] nifi git commit: NIFI-1554: - Addressing access controls for the Controller resource. - Addressing access controls for RAW site to site clients. - Addressing access controls for downloading co

2016-06-23 Thread mcgilman
http://git-wip-us.apache.org/repos/asf/nifi/blob/f0811ca4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
index 1e3c776..e04ed44 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
@@ -46,6 +46,9 @@ import org.apache.nifi.web.api.dto.BulletinBoardDTO;
 import org.apache.nifi.web.api.dto.BulletinQueryDTO;
 import org.apache.nifi.web.api.dto.ProcessGroupDTO;
 import org.apache.nifi.web.api.dto.RevisionDTO;
+import org.apache.nifi.web.api.dto.action.ActionDTO;
+import org.apache.nifi.web.api.dto.action.HistoryDTO;
+import org.apache.nifi.web.api.dto.action.HistoryQueryDTO;
 import org.apache.nifi.web.api.dto.flow.FlowDTO;
 import org.apache.nifi.web.api.dto.flow.ProcessGroupFlowDTO;
 import org.apache.nifi.web.api.dto.search.SearchResultsDTO;
@@ -59,15 +62,19 @@ import 
org.apache.nifi.web.api.dto.status.ProcessorStatusDTO;
 import org.apache.nifi.web.api.dto.status.RemoteProcessGroupStatusDTO;
 import org.apache.nifi.web.api.dto.status.StatusHistoryDTO;
 import org.apache.nifi.web.api.entity.AboutEntity;
+import org.apache.nifi.web.api.entity.ActionEntity;
 import org.apache.nifi.web.api.entity.AuthorityEntity;
 import org.apache.nifi.web.api.entity.BannerEntity;
 import org.apache.nifi.web.api.entity.BulletinBoardEntity;
+import org.apache.nifi.web.api.entity.ComponentHistoryEntity;
 import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
 import org.apache.nifi.web.api.entity.ControllerServiceEntity;
 import org.apache.nifi.web.api.entity.ControllerServiceTypesEntity;
 import org.apache.nifi.web.api.entity.ControllerServicesEntity;
 import org.apache.nifi.web.api.entity.ControllerStatusEntity;
 import org.apache.nifi.web.api.entity.Entity;
+import org.apache.nifi.web.api.entity.FlowConfigurationEntity;
+import org.apache.nifi.web.api.entity.HistoryEntity;
 import org.apache.nifi.web.api.entity.IdentityEntity;
 import org.apache.nifi.web.api.entity.PortStatusEntity;
 import org.apache.nifi.web.api.entity.PrioritizerTypesEntity;
@@ -85,6 +92,7 @@ import org.apache.nifi.web.api.entity.SearchResultsEntity;
 import org.apache.nifi.web.api.entity.StatusHistoryEntity;
 import org.apache.nifi.web.api.request.BulletinBoardPatternParameter;
 import org.apache.nifi.web.api.request.ClientIdParameter;
+import org.apache.nifi.web.api.request.DateTimeParameter;
 import org.apache.nifi.web.api.request.IntegerParameter;
 import org.apache.nifi.web.api.request.LongParameter;
 
@@ -187,7 +195,7 @@ public class FlowResource extends ApplicationResource {
 /**
  * Authorizes access to the flow.
  */
-private void authorizeFlow() {
+private void authorizeFlow(final RequestAction action) {
 final NiFiUser user = NiFiUserUtils.getNiFiUser();
 
 final AuthorizationRequest request = new AuthorizationRequest.Builder()
@@ -195,7 +203,7 @@ public class FlowResource extends ApplicationResource {
 .identity(user.getIdentity())
 .anonymous(user.isAnonymous())
 .accessAttempt(true)
-.action(RequestAction.READ)
+.action(action)
 .build();
 
 final AuthorizationResult result = authorizer.authorize(request);
@@ -233,11 +241,51 @@ public class FlowResource extends ApplicationResource {
 }
 )
 public Response generateClientId() {
-authorizeFlow();
+authorizeFlow(RequestAction.READ);
 return clusterContext(generateOkResponse(generateUuid())).build();
 }
 
 /**
+ * Retrieves the configuration for the flow.
+ *
+ * @return A flowConfigurationEntity.
+ */
+@GET
+@Consumes(MediaType.WILDCARD)
+@Produces(MediaType.APPLICATION_JSON)
+@Path("config")
+// TODO - @PreAuthorize("hasAnyRole('ROLE_MONITOR', 'ROLE_DFM', 
'ROLE_ADMIN', 'ROLE_NIFI')")
+@ApiOperation(
+value = "Retrieves the configuration for this NiFi flow",
+response = FlowConfigurationEntity.class,
+authorizations = {
+@Authorization(value = "Read Only", type = "ROLE_MONITOR"),
+@Authorization(value = "Data Flow Manager", type = 
"ROLE_DFM"),
+@Authorization(value = "Administrator", type = 
"ROLE_ADMIN"),
+@Authorization(value = "ROLE_NIFI", type = "ROLE_NIFI")
+}
+)
+@ApiResponses(
+   

[jira] [Updated] (NIFI-2106) Clicking refresh in 'Status History' window causes window to grow

2016-06-23 Thread Joseph Witt (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joseph Witt updated NIFI-2106:
--
Attachment: Screen Shot 2016-06-23 at 2.19.57 PM.png

> Clicking refresh in 'Status History' window causes window to grow
> -
>
> Key: NIFI-2106
> URL: https://issues.apache.org/jira/browse/NIFI-2106
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core UI
>Reporter: Joseph Witt
> Fix For: 1.0.0
>
> Attachments: Screen Shot 2016-06-23 at 2.19.57 PM.png
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (NIFI-2106) Clicking refresh in 'Status History' window causes window to grow

2016-06-23 Thread Joseph Witt (JIRA)
Joseph Witt created NIFI-2106:
-

 Summary: Clicking refresh in 'Status History' window causes window 
to grow
 Key: NIFI-2106
 URL: https://issues.apache.org/jira/browse/NIFI-2106
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Joseph Witt
 Fix For: 1.0.0
 Attachments: Screen Shot 2016-06-23 at 2.19.57 PM.png





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347321#comment-15347321
 ] 

ASF GitHub Bot commented on NIFI-2089:
--

Github user JPercivall commented on the issue:

https://github.com/apache/nifi/pull/573
  
+1 

Fixes errors seen on Windows, code looks good and passes contrib-check. 
Thanks Mark


> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


nifi git commit: NIFI-2089: Ensure streams are closed before attempting to remove files

2016-06-23 Thread jpercivall
Repository: nifi
Updated Branches:
  refs/heads/0.x 03c937623 -> 56dc8aefa


NIFI-2089: Ensure streams are closed before attempting to remove files

This closes #573

Signed-off-by: jpercivall 


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/56dc8aef
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/56dc8aef
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/56dc8aef

Branch: refs/heads/0.x
Commit: 56dc8aefac822454f2d4133e8cbde903a628ec5b
Parents: 03c9376
Author: Mark Payne 
Authored: Thu Jun 23 15:21:44 2016 -0400
Committer: jpercivall 
Committed: Thu Jun 23 18:29:10 2016 -0400

--
 .../controller/repository/FileSystemRepository.java| 10 ++
 .../repository/TestFileSystemRepository.java   | 13 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/56dc8aef/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
index ad8ff49..210fcca 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
@@ -628,6 +628,16 @@ public class FileSystemRepository implements 
ContentRepository {
 } catch (final ContentNotFoundException cnfe) {
 }
 
+// Ensure that we have no writable claim streams for this resource 
claim
+final ByteCountingOutputStream bcos = 
writableClaimStreams.remove(claim);
+if (bcos != null) {
+try {
+bcos.close();
+} catch (final IOException e) {
+LOG.warn("Failed to close Output Stream for {} due to {}", 
claim, e);
+}
+}
+
 final File file = path.toFile();
 if (!file.delete() && file.exists()) {
 LOG.warn("Unable to delete {} at path {}", new Object[] {claim, 
path});

http://git-wip-us.apache.org/repos/asf/nifi/blob/56dc8aef/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
index ed792a4..c00b91a 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
@@ -329,10 +329,11 @@ public class TestFileSystemRepository {
 @Test
 public void testExportToOutputStream() throws IOException {
 final ContentClaim claim = repository.create(true);
-final Path path = getPath(claim);
 
-Files.createDirectories(path.getParent());
-Files.copy(helloWorldFile.toPath(), path, 
StandardCopyOption.REPLACE_EXISTING);
+try (final OutputStream out = repository.write(claim)) {
+Files.copy(helloWorldFile.toPath(), out);
+}
+
 final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 repository.exportTo(claim, baos);
 final byte[] data = baos.toByteArray();
@@ -342,10 +343,10 @@ public class TestFileSystemRepository {
 @Test
 public void testExportToFile() throws IOException {
 final ContentClaim claim = repository.create(true);
-final Path path = getPath(claim);
+try (final OutputStream out = repository.write(claim)) {
+Files.copy(helloWorldFile.toPath(), out);
+}
 
-Files.createDirectories(path.getParent());
-Files.copy(helloWorldFile.toPath(), path, 
StandardCopyOption.REPLACE_EXISTING);
 final File outFile = new File("target/testExportToFile");
 final Path outPath = outFile.toPath();
 Files.de

[jira] [Commented] (NIFI-1554) Incorporate new Authorizer API

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347328#comment-15347328
 ] 

ASF GitHub Bot commented on NIFI-1554:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/567


> Incorporate new Authorizer API
> --
>
> Key: NIFI-1554
> URL: https://issues.apache.org/jira/browse/NIFI-1554
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
>Reporter: Matt Gilman
>Assignee: Matt Gilman
> Fix For: 1.0.0
>
>
> - Introduce checks on user actions using new Authorizer API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347326#comment-15347326
 ] 

ASF subversion and git services commented on NIFI-2089:
---

Commit 56dc8aefac822454f2d4133e8cbde903a628ec5b in nifi's branch refs/heads/0.x 
from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=56dc8ae ]

NIFI-2089: Ensure streams are closed before attempting to remove files

This closes #573

Signed-off-by: jpercivall 


> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


svn commit: r14117 - /release/nifi/KEYS

2016-06-23 Thread jpercivall
Author: jpercivall
Date: Thu Jun 23 22:33:05 2016
New Revision: 14117

Log:
Adding key for Joseph Percivall

Modified:
release/nifi/KEYS

Modified: release/nifi/KEYS
==
--- release/nifi/KEYS (original)
+++ release/nifi/KEYS Thu Jun 23 22:33:05 2016
@@ -377,3 +377,177 @@ nuvhNc4zXIEsLlmfyD91muPMcILL7ZGXQ2hA9u9+
 Ga09Iyl5frGdyh8xqg==
 =oTLB
 -END PGP PUBLIC KEY BLOCK-
+-BEGIN PGP PUBLIC KEY BLOCK-
+Version: GnuPG v1
+
+mQENBFP74wQBCADCKbvNYxUB6Ms0Qgfy4VYWMZ3t99rYDUoQvyknw4DLUXFZJ1XC
+hPfRkmF2yIQ1WkOE9eQ19iAJ3EBzMtJK5/C68G9sk1FWh5z4HqIkEhNi4pVKJOnj
+fz7KrbUUJ1AnmAK3yR+nTVDEo5CRsMK3KXporfch3GQDbSQy+/3tkFU8sGqn8SAd
+ILwfyo/YVtKWKfwOWPV/bYIMoTEn5stq9Y6EmkvFE5kZe6m1YyLaXcPaI77bwOXD
+WuuwbmjvTASTTdXknG3be/U9f3jtMV8aeRRPfBrWkjJW45/y4cFEwbL7KT/b1QvW
+jlRFWkOx67ghnbmvUrCRvOXLDrnWeV5i80lLABEBAAG0IEpvc2VwaCBXaXR0IDxq
+b2Uud2l0dEBnbWFpbC5jb20+iQE3BBMBAgAhAhsDAh4BAheABQJUdq/tBQsJCAcD
+BRUKCQgLBRYCAwEAAAoJEJCTv4VPgRoa5e4H/jCQqGetejbC7FwItc+HmrA9+7NP
+gYf5zPQUPrOndfCxDcAbiqp7A9L9J+84JoHqbamjTq1/j5gkMQiF7tvUWrHUqXjM
+thvEEe+FKYaDdUfDWay+cgyDoJR7kKtbG051+y2pEPzNZqvziLny8gro2cgZms/x
+WTRXR5zMzkAThESdPd86FCZ+FHByTe0llJE68Ug+qngcc3yMR+UdotvB81ukOf4N
+ZPVvM1If7sn4Yy5rBK/WdxAYfiHKvObECtuHXnPn232mQOAKYd1K+SeOnxkix0IB
+34kXOZk+nuRDnW77/oeKTvwhjAfiDWG9AJLkUi0R1kGQzjzod4Mq6v+ta3u0IEpv
+c2VwaCBXaXR0IDxqb2V3aXR0QGFwYWNoZS5vcmc+iQE5BBMBAgAjBQJUtwShAhsD
+BwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQkJO/hU+BGhr/eAgAj59xF3Ay
+gzJWhdev5ZTL35izJ816DocUpk4LrLHvd8F0fvfwuQaS22XNMuvMtyLn+KBdPeuH
+LHUOWZhLNwV5Q3qOiVFCk9DYwCaIVq2ZxsxlHOl5hf/4AFTFhCzhmUm/DbK1Ahcp
+eL6KuhkMYTRwRj92LtWwObnvhlvopiYv0jVzWTj/cMFWq07BV/vdRq+11NpndoJS
+JlWyKjUEfhEoYxa8SzsjVEqse55TI7VVgqsgWqQCIag71J8cZasMxbj/evtPL4ab
+566PnnmGbufSqptQ50/bWMbYsGDHV+gktHsimHtzg5fMvHy/4b0fIF4C+27MhHPK
+fQmcraXZ/tKcebkBDQRT++MEAQgAxODFekTd5GhRlM9lYqCpKFti8HW1q3fehM0I
+IHkWyhAbBO1vfcC9wJliaAl+tHgotzz0ZaMyuH7YJ98DQpQ/7nliaf5x+CdIjolQ
+eHqUjYY2c0M6beJ3569BgfrZ1tYnznGhvkvmUsIRhH8RTj39Iga4txBHhGLN6xzE
+j0AilHhT7TG2jr4x1Y1PnrRJfHamTVBlJ/4MbmcNbMWar/wLWYsQk+ygGwCqZmB+
+GN599dTKrzixobEKg6JoLgwXWPKzFbfLqvu9jTYf1EVg5BfvwxYPwnB7fCr52XgP
+1zD1EuSBl4eQDhbJ3yUkRDYrz0o8OsMD/FpiCVilv//tw5s08wARAQABiQEfBBgB
+AgAJBQJT++MEAhsMAAoJEJCTv4VPgRoa0BkH/jILuRXt0vrVMaQWWPfgdIXjqTge
+iAoG5tOBEUPu6IKi49Ed6p9Gp7+hq9uPiwxp5aTSaKUDReZYNol+NN+ow1YdMJxd
+PZwH/OxiqQH2lx/dwoXan6VVORkgpGdh8DW3Xm8sk5moMm76Osktj3rNnnI9Xmqg
+pXPJzANlwijNhaQPmHDYteybKsY5oU+guXuhWlOJ/5LLiOLdgYaF9TN75973bBW7
+6622Mm+KA+NrdbNAEZ6F2iVry6HWIXyBMRK9sD2nNEdqOTo3HX6Iz/FbG9KKz3qC
+jTV5DLe6QqCkuu5IrLDfU5lU1LyuQSYSBfhcUMMa5h1iPfsX2rL1c2MpYMeZAg0E
+V2xQbgEQANS8RaWMV8AU6+GIgy990BOtMqsxUBZ+YqWhPd5GGu42lvmxtwJjeQ8P
+46SkZKYKpfRwmf00e+duxOkFj6b4+Y3xTWrouIeD577fzT+i4Pna4MXSulY2sY2l
+yfbb2IijvtsBWecHTiLb3aD5LqSsgXjQRl4RhDAXS48ME1QsGuzKqZpiVuggglwt
+chjyAb3IlRFkRMYLTysZW96wAR+v5kmJ1PAZULTZyEkXl9Ws7KwGlQEM+MgfXwxf
+Gd+kWM2yHpoeBT+ceFbpzhejojavVjxJvxKouCI94GjqDAuUp94iPgSpSNKkTlcr
+WX+5WQDDf8xiBFbam5C5wFHQbev11GYUPVrCyyqALJ5EfZzT3/Tk54tqMLTA72gn
+XEfLSimDeP31jJktiTm0HPokorI8Xgi0ZUU2ZOD7pIE55dUPwSn/HswF/5csOBWB
+xlebh/FFnlmS1vuv8ZDhH1l2pHDYRARwYjCxcccf1A47wloY0EirgdUnbMEMUBAz
+2A7kb+EfmdjKdE8AphI13TWlnvUaS5AmTGmnp8mBA1jp2lX2BJbUNSPKz1x9ZhaW
+TgDaTNRrS1vFt1CuJCrZxFILncmu2GnW4wVMKUc+qnJL+jVEoh83MUEaOwAHkoJR
+Ka/ZsUvN78qjcM7zCZUPekHPLxWrar5LryjmFJ9ArokqOSt/nFjbABEBAAG0O0pv
+c2VwaCBQZXJjaXZhbGwgKENPREUgU0lHTklORyBLRVkpIDxqcGVyY2l2YWxsQGFw
+YWNoZS5vcmc+iQI3BBMBAgAhAhsDAh4BAheABQJXbFD6BQsJCAcDBRUKCQgLBRYC
+AwEAAAoJEDxtuv4iiG/uEt8P/iTXNqGEpXjorhxvkwHRekjxmbpBmXmzRpjh6x5W
+oRk34P9yAK3SAIM10Z5X7nu/B3XSk9LQNNlC4Ire7mAYVgboWPju2SRmEzfhcsUl
+f6TMo0+KhunaD3A00PiekrzahlKiAJQGwjmRghIQq9d4yB7sLz3Yg9E454UG+YXf
+779fhrFMNcdiH4S04XKefW0lk61gYRg82unOSxekK2I3oJv1eAkH6uRk26a924NE
+NXfUBzRJURCWjG+Rn6ZEvoBCoaWtrqPwDaZnHvR7+HvgjjpzakIKr9u/1g0bo3AZ
+v6d8XyrIhTKKoNmcTvH9/d0ry2qg4+bwYOCgdEWy6j+m9pqYaAP+wf9L3kFOZr+4
+8XXQNHPSaFWH9UfCGuNE42mjjH04XIj0lA2r8MssMWYHKzIdYVSXCIdx2DUx3RqZ
+YE9gCExWNtyD+gt9RSnQzfEiRd4EXecYPYxyJUv4tX6fDl25w8cR8QB3c2E//0da
+wXx/F9KFosPeD+xnneA7phEFUbhjpvnt85OIdvK1D2cD3MGyNa8sYePLhIZyREsB
+33YmMBPuhEEoR3n5AdPIplTaebeJK6iba3A5QOlK/Uy1Wb+JNh164DVuFB7ysOca
+4rOGwgqnZzl+09SCspI58HAuSakuNNGrNWf4fmsjy738rcJJP11iQx+AuREUpbds
+uz1FuQINBFdsUG4BEADEJHlPozwV4/09ybBJhP9XRyt6n9Y/O5/a8mi/j0ikG0Qt
+3eA8ZZe92OK1Qr0vVpF7adN8TrspofSXwnUA/n5jagLcSir+bxjCqxum0UOuRh87
+shUJOcQ9/qpo1ZENfLNqhR5Fn2Nf81hYh0siLoIzev85c9PmohHQqCOPxFRNz20d
+LIAN9owaoFYPQiyDE48OMQypNSNvfTXHQw7i+qEzksPbL2NIJaSXuMTCiL92hfeZ
+xHbEBOT6ciDgVjx6W10vRodN96TtPWEDtZb98KcWgbfOCAWspWJi6eeq77XB0ewh
+dmpDi6n7cDBCAN33BfMyTg/MY/dQmPG51CEfgS6T33gSLUeRyOQsqJ1bLe/PtljF
+01CGM/aLvH9hn6I4KWoJXG7nCi6SpV4V6nGbHdZC1+Gk0z9yMp4V3nphsIk3R96b
+qbAGtEgSYYSbQL1upUj///nIr1OapzyUb/xZ15Ge7YJTkHpzdLNVt+qn/ku77IvQ
+eWRtKzDCCOmkxTQsiTzW4+MZsuid4kVaqj8RCFnEML0WYwaDxtj2KuZ05EJwGTZe
+9LELdtcMsm9vML6AWkvvheWWehtbePa/VXWgMBr5qorNj/0NEmR04yHw4W1F0uQl
+/Ya0j14BcB2IZRp3UwPeRkASiGoNdHNMzlKsgYTsYhBBuf/nL6yakLEVR76t1QAR
+AQABiQIfBBgBAgAJBQJXbFBuAhsMAAoJEDxtuv4iiG/uQpkQANSRtF9uege9

[jira] [Created] (NIFI-2107) Other panels like 'content-viewer' still using old style

2016-06-23 Thread Joseph Witt (JIRA)
Joseph Witt created NIFI-2107:
-

 Summary: Other panels like 'content-viewer' still using old style
 Key: NIFI-2107
 URL: https://issues.apache.org/jira/browse/NIFI-2107
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Joseph Witt
 Fix For: 1.0.0






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


nifi git commit: NIFI-2089: Ensure streams are closed before attempting to remove files

2016-06-23 Thread jpercivall
Repository: nifi
Updated Branches:
  refs/heads/master f0811ca45 -> 8da571d6d


NIFI-2089: Ensure streams are closed before attempting to remove files

This closes #573

Signed-off-by: jpercivall 


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8da571d6
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8da571d6
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8da571d6

Branch: refs/heads/master
Commit: 8da571d6d67d0f6bd870a408210cadf9dae9f61e
Parents: f0811ca
Author: Mark Payne 
Authored: Thu Jun 23 15:21:44 2016 -0400
Committer: jpercivall 
Committed: Thu Jun 23 18:43:20 2016 -0400

--
 .../controller/repository/FileSystemRepository.java| 10 ++
 .../repository/TestFileSystemRepository.java   | 13 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/8da571d6/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
index ad8ff49..210fcca 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
@@ -628,6 +628,16 @@ public class FileSystemRepository implements 
ContentRepository {
 } catch (final ContentNotFoundException cnfe) {
 }
 
+// Ensure that we have no writable claim streams for this resource 
claim
+final ByteCountingOutputStream bcos = 
writableClaimStreams.remove(claim);
+if (bcos != null) {
+try {
+bcos.close();
+} catch (final IOException e) {
+LOG.warn("Failed to close Output Stream for {} due to {}", 
claim, e);
+}
+}
+
 final File file = path.toFile();
 if (!file.delete() && file.exists()) {
 LOG.warn("Unable to delete {} at path {}", new Object[] {claim, 
path});

http://git-wip-us.apache.org/repos/asf/nifi/blob/8da571d6/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
--
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
index ed792a4..c00b91a 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestFileSystemRepository.java
@@ -329,10 +329,11 @@ public class TestFileSystemRepository {
 @Test
 public void testExportToOutputStream() throws IOException {
 final ContentClaim claim = repository.create(true);
-final Path path = getPath(claim);
 
-Files.createDirectories(path.getParent());
-Files.copy(helloWorldFile.toPath(), path, 
StandardCopyOption.REPLACE_EXISTING);
+try (final OutputStream out = repository.write(claim)) {
+Files.copy(helloWorldFile.toPath(), out);
+}
+
 final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 repository.exportTo(claim, baos);
 final byte[] data = baos.toByteArray();
@@ -342,10 +343,10 @@ public class TestFileSystemRepository {
 @Test
 public void testExportToFile() throws IOException {
 final ContentClaim claim = repository.create(true);
-final Path path = getPath(claim);
+try (final OutputStream out = repository.write(claim)) {
+Files.copy(helloWorldFile.toPath(), out);
+}
 
-Files.createDirectories(path.getParent());
-Files.copy(helloWorldFile.toPath(), path, 
StandardCopyOption.REPLACE_EXISTING);
 final File outFile = new File("target/testExportToFile");
 final Path outPath = outFile.toPath();
 Fi

[jira] [Commented] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347375#comment-15347375
 ] 

ASF subversion and git services commented on NIFI-2089:
---

Commit 8da571d6d67d0f6bd870a408210cadf9dae9f61e in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=8da571d ]

NIFI-2089: Ensure streams are closed before attempting to remove files

This closes #573

Signed-off-by: jpercivall 


> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347377#comment-15347377
 ] 

ASF GitHub Bot commented on NIFI-2089:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/573


> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (NIFI-2089) NIFI-1824 causes failures on Windows

2016-06-23 Thread Joseph Percivall (JIRA)

 [ 
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joseph Percivall resolved NIFI-2089.

Resolution: Fixed

> NIFI-1824 causes failures on Windows
> 
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
>  Issue Type: Bug
>Reporter: Joseph Percivall
>Assignee: Mark Payne
>Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8. 
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f) 
> the test succeeds.
> Output:
> ---
>  T E S T S
> ---
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec - 
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in 
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec 
> <<< FAILURE! - in 
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.86 sec  <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.867 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
>   Time elapsed: 0.859 sec  <<< ERROR!
> java.nio.file.FileSystemException: 
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
>  The process cannot access the file because it is being used by another 
> process.
> at 
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at 
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at 
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at 
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (NIFI-2093) Clear state link on Component State window is hidden

2016-06-23 Thread Koji Kawamura (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347451#comment-15347451
 ] 

Koji Kawamura commented on NIFI-2093:
-

[~mcgilman] I looked at the Javascript codes and confirmed that only showState 
function for Processors is using supportsModification.
It may make sense to add comparable check for Controller Services and Reporting 
Tasks using supportsModification, however, if "Get" and "Clear" both require 
"WRITE" access, then it should be fine as it is. If one doesn't have WRITE 
access, they can't open the Component State window in the first place, because 
server throws AccessDeniedException.

Although Controller Services and Reporting Tasks don't use 
supportsModification, they check dataContext.accessPolicy whether to show 
controlling UI inputs including show status button:

{code:title=nf-controller-services.js and nf-settings.js}
if (dataContext.accessPolicy.canRead && dataContext.accessPolicy.canWrite) {
{code}

Overall, I think current implementation is enough to block unauthorized user 
clears state. Please let me know your thoughts.

> Clear state link on Component State window is hidden
> 
>
> Key: NIFI-2093
> URL: https://issues.apache.org/jira/browse/NIFI-2093
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core UI
>Affects Versions: 1.0.0
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
> Fix For: 1.0.0
>
> Attachments: ComponentState-ConsumeKafka.png
>
>
> It seems that ComponentStateEntity should have accessPolicy so that 
> CanvasUtis.supportsModification() can handle whether the link is active or 
> not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


  1   2   >