Repository: nifi Updated Branches: refs/heads/NIFI-655 5e341214a -> 7f9807f46
NIFI-655: - Making nf-storage available in the login page. - Requiring use of local storage. - Ignoring security for GET requests when obtaining the login configuration. Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/7f9807f4 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/7f9807f4 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/7f9807f4 Branch: refs/heads/NIFI-655 Commit: 7f9807f461be110e051ce367569b690787b5e5b6 Parents: 5e34121 Author: Matt Gilman <matt.c.gil...@gmail.com> Authored: Mon Nov 2 22:55:57 2015 -0500 Committer: Matt Gilman <matt.c.gil...@gmail.com> Committed: Mon Nov 2 22:55:57 2015 -0500 ---------------------------------------------------------------------- .../web/NiFiWebApiSecurityConfiguration.java | 3 +- .../nifi-framework/nifi-web/nifi-web-ui/pom.xml | 11 +- .../resources/filters/bulletin-board.properties | 1 + .../main/resources/filters/canvas.properties | 2 +- .../main/resources/filters/cluster.properties | 1 + .../main/resources/filters/counters.properties | 1 + .../main/resources/filters/history.properties | 1 + .../src/main/resources/filters/login.properties | 1 + .../resources/filters/provenance.properties | 1 + .../main/resources/filters/summary.properties | 1 + .../main/resources/filters/templates.properties | 1 + .../src/main/resources/filters/users.properties | 1 + .../WEB-INF/partials/canvas/canvas-header.jsp | 7 +- .../js/nf/bulletin-board/nf-bulletin-board.js | 2 + .../src/main/webapp/js/nf/canvas/nf-storage.js | 139 ------------------- .../src/main/webapp/js/nf/cluster/nf-cluster.js | 2 + .../main/webapp/js/nf/counters/nf-counters.js | 2 + .../src/main/webapp/js/nf/history/nf-history.js | 2 + .../src/main/webapp/js/nf/login/nf-login.js | 6 +- .../src/main/webapp/js/nf/nf-storage.js | 103 ++++++++++++++ .../webapp/js/nf/provenance/nf-provenance.js | 2 + .../src/main/webapp/js/nf/summary/nf-summary.js | 2 + .../main/webapp/js/nf/templates/nf-templates.js | 2 + .../src/main/webapp/js/nf/users/nf-users.js | 2 + 24 files changed, 149 insertions(+), 147 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiWebApiSecurityConfiguration.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiWebApiSecurityConfiguration.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiWebApiSecurityConfiguration.java index b004ff0..e30f812 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiWebApiSecurityConfiguration.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiWebApiSecurityConfiguration.java @@ -33,6 +33,7 @@ import org.apache.nifi.web.security.x509.ocsp.OcspCertificateValidator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; @@ -68,7 +69,7 @@ public class NiFiWebApiSecurityConfiguration extends WebSecurityConfigurerAdapte @Override public void configure(WebSecurity webSecurity) throws Exception { - webSecurity.ignoring().antMatchers("/controller/login/config"); + webSecurity.ignoring().antMatchers(HttpMethod.GET, "/controller/login/config"); } @Override http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml index 93a36f6..7f16ed0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml @@ -275,7 +275,7 @@ <include>${staging.dir}/js/nf/canvas/nf-canvas-utils.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> <include>${staging.dir}/js/nf/nf-shell.js</include> - <include>${staging.dir}/js/nf/canvas/nf-storage.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/canvas/nf-snippet.js</include> <include>${staging.dir}/js/nf/canvas/nf-canvas-toolbox.js</include> <include>${staging.dir}/js/nf/canvas/nf-custom-ui.js</include> @@ -328,6 +328,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/history/nf-history.js</include> <include>${staging.dir}/js/nf/history/nf-history-table.js</include> <include>${staging.dir}/js/nf/history/nf-history-model.js</include> @@ -340,6 +341,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/provenance/nf-provenance.js</include> <include>${staging.dir}/js/nf/provenance/nf-provenance-table.js</include> </includes> @@ -351,6 +353,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/nf-processor-details.js</include> <include>${staging.dir}/js/nf/nf-connection-details.js</include> <include>${staging.dir}/js/nf/summary/nf-summary.js</include> @@ -365,6 +368,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/counters/nf-counters.js</include> <include>${staging.dir}/js/nf/counters/nf-counters-table.js</include> </includes> @@ -376,6 +380,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/templates/nf-templates.js</include> <include>${staging.dir}/js/nf/templates/nf-templates-table.js</include> </includes> @@ -387,6 +392,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/cluster/nf-cluster.js</include> <include>${staging.dir}/js/nf/cluster/nf-cluster-table.js</include> </includes> @@ -398,6 +404,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/users/nf-users.js</include> <include>${staging.dir}/js/nf/users/nf-users-table.js</include> </includes> @@ -409,6 +416,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/bulletin-board/nf-bulletin-board.js</include> </includes> </aggregation> @@ -419,6 +427,7 @@ <include>${staging.dir}/js/nf/nf-client.js</include> <include>${staging.dir}/js/nf/nf-common.js</include> <include>${staging.dir}/js/nf/nf-dialog.js</include> + <include>${staging.dir}/js/nf/nf-storage.js</include> <include>${staging.dir}/js/nf/login/nf-login.js</include> </includes> </aggregation> http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/bulletin-board.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/bulletin-board.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/bulletin-board.properties index 55df244..96a550f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/bulletin-board.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/bulletin-board.properties @@ -16,6 +16,7 @@ nf.bulletin.board.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/bulletin-board/nf-bulletin-board.js?${project.version}"></script> nf.bulletin.board.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ <link rel="stylesheet" href="css/main.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties index fd5b7f2..bf61846 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties @@ -19,7 +19,7 @@ nf.canvas.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js? <script type="text/javascript" src="js/nf/canvas/nf-canvas-utils.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-shell.js?${project.version}"></script>\n\ -<script type="text/javascript" src="js/nf/canvas/nf-storage.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/canvas/nf-snippet.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/canvas/nf-canvas-toolbox.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/canvas/nf-custom-ui.js?${project.version}"></script>\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/cluster.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/cluster.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/cluster.properties index f1481d8..9327be6 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/cluster.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/cluster.properties @@ -16,6 +16,7 @@ nf.cluster.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/cluster/nf-cluster.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/cluster/nf-cluster-table.js?${project.version}"></script> nf.cluster.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/counters.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/counters.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/counters.properties index 8b07e57..be22f55 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/counters.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/counters.properties @@ -16,6 +16,7 @@ nf.counters.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/counters/nf-counters.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/counters/nf-counters-table.js?${project.version}"></script> nf.counters.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/history.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/history.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/history.properties index 818ee58..9bbe640 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/history.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/history.properties @@ -16,6 +16,7 @@ nf.history.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/history/nf-history.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/history/nf-history-table.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/history/nf-history-model.js?${project.version}"></script> http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/login.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/login.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/login.properties index 5b36c17..28ff4b9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/login.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/login.properties @@ -15,6 +15,7 @@ nf.login.script.tags=<script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/login/nf-login.js?${project.version}"></script> nf.login.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ <link rel="stylesheet" href="css/main.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/provenance.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/provenance.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/provenance.properties index 655d3bf..daa7c43 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/provenance.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/provenance.properties @@ -16,6 +16,7 @@ nf.provenance.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/provenance/nf-provenance.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/provenance/nf-provenance-table.js?${project.version}"></script> nf.provenance.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/summary.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/summary.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/summary.properties index 90d35d9..2417ade 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/summary.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/summary.properties @@ -16,6 +16,7 @@ nf.summary.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-processor-details.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-connection-details.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/summary/nf-summary.js?${project.version}"></script>\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/templates.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/templates.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/templates.properties index 79c59e7..007bd69 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/templates.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/templates.properties @@ -16,6 +16,7 @@ nf.templates.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/templates/nf-templates.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/templates/nf-templates-table.js?${project.version}"></script> nf.templates.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/users.properties ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/users.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/users.properties index a4e586a..9824a8b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/users.properties +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/users.properties @@ -16,6 +16,7 @@ nf.users.script.tags=<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-common.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/nf-dialog.js?${project.version}"></script>\n\ +<script type="text/javascript" src="js/nf/nf-storage.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/users/nf-users.js?${project.version}"></script>\n\ <script type="text/javascript" src="js/nf/users/nf-users-table.js?${project.version}"></script> nf.users.style.tags=<link rel="stylesheet" href="css/reset.css?${project.version}" type="text/css" />\n\ http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp index 153ed21..54f6811 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/canvas-header.jsp @@ -44,15 +44,16 @@ </div> <div id="header-links-container"> <ul> + <li id="login-link-container"> + <span id="current-user" class="hidden"></span> + <span id="login-link" class="link">login</span> + </li> <li> <span id="help-link" class="link">help</span> </li> <li> <span id="about-link" class="link">about</span> </li> - <li id="login-link-container"> - <span id="login-link" class="link">login</span> - </li> </ul> </div> </div> http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js index 656755e..55d0a9d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js @@ -417,6 +417,8 @@ nf.BulletinBoard = (function () { * Initializes the bulletin board page. */ init: function () { + nf.Storage.init(); + initializePage().done(function () { start(); }); http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-storage.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-storage.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-storage.js deleted file mode 100644 index 3937970..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-storage.js +++ /dev/null @@ -1,139 +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. - */ - -/* global nf, d3 */ - -nf.Storage = (function () { - - // Store items for two days before being eligible for removal. - var TWO_DAYS = 86400000 * 2; - - // alternative to local storage thats used when localStorage isn't available - var alternativeStorage; - - // determine if this browser supports local storage - var SUPPORTS_LOCAL_STORAGE = (function () { - var test = 'test'; - try { - localStorage.setItem(test, test); - localStorage.removeItem(test); - return true; - } catch (e) { - return false; - } - }()); - - return { - /** - * Initializes the storage. When the browser supports localStorage, - * the items will be persisted for two days. Once the scripts runs - * thereafter, all eligible items will be removed. If localStorage - * is not supported, a data structure will be used to hold items. - * This strategy does not support persistence. - */ - init: function () { - // if we support local storage, see if anything can be removed - if (SUPPORTS_LOCAL_STORAGE) { - for (var i = 0; i < localStorage.length; i++) { - try { - // get the next item - var key = localStorage.key(i); - var entry = JSON.parse(localStorage.getItem(key)); - - // get the expiration - var expires = new Date(entry.expires); - var now = new Date(); - - // if the expiration date has passed, remove it - if (expires.valueOf() < now.valueOf()) { - localStorage.removeItem(key); - } - } catch (e) { - // likely unable to parse the item - } - } - } else { - alternativeStorage = d3.map(); - } - }, - - /** - * Stores the specified item. If supported, will be persisted - * in localStorage. - * - * @param {type} key - * @param {type} item - */ - setItem: function (key, item) { - if (SUPPORTS_LOCAL_STORAGE) { - // calculate the expiration - var expires = new Date().valueOf() + TWO_DAYS; - - // create the entry - var entry = { - expires: expires, - item: item - }; - - // store the item - localStorage.setItem(key, JSON.stringify(entry)); - } else { - alternativeStorage.set(key, item); - } - }, - - /** - * Gets the item with the specified key. If an item with this key does - * not exist, null is returned. If an item exists but cannot be parsed - * or is malformed/unrecognized, null is returned. - * - * @param {type} key - */ - getItem: function (key) { - if (SUPPORTS_LOCAL_STORAGE) { - try { - // parse the entry - var entry = JSON.parse(localStorage.getItem(key)); - - // ensure the entry and item are present - if (nf.Common.isDefinedAndNotNull(entry) && nf.Common.isDefinedAndNotNull(entry.item)) { - return entry.item; - } else { - return null; - } - } catch (e) { - return null; - } - } else { - return alternativeStorage.get(key); - } - }, - - /** - * Removes the item with the specified key. - * - * @param {type} key - */ - removeItem: function (key) { - if (SUPPORTS_LOCAL_STORAGE) { - localStorage.removeItem(key); - } else { - alternativeStorage.remove(key); - } - } - }; -}()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js index 5f00e2c..1eafa67 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js @@ -123,6 +123,8 @@ nf.Cluster = (function () { * Initializes the counters page. */ init: function () { + nf.Storage.init(); + // load the users authorities loadAuthorities().done(function () { // create the counters table http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js index cbfe336..6af3d20 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js @@ -123,6 +123,8 @@ nf.Counters = (function () { * Initializes the counters page. */ init: function () { + nf.Storage.init(); + // load the users authorities loadAuthorities().done(function () { // create the counters table http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js index 516507c..8f749c0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js @@ -124,6 +124,8 @@ nf.History = (function () { * Initializes the status page. */ init: function () { + nf.Storage.init(); + // load the users authorities loadAuthorities().done(function () { // create the history table http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js index 1630683..695a11c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js @@ -46,7 +46,7 @@ nf.Login = (function () { // handle login click $('#login-button').on('click', function () { login().done(function (response) { - console.log(response); + }); }); @@ -55,7 +55,7 @@ nf.Login = (function () { } // if this nifi supports registration, render the registration form - if (config.supportsRegistration === false) { + if (config.supportsRegistration === true) { initializeUserRegistration(); // automatically include support for nifi registration @@ -130,6 +130,8 @@ nf.Login = (function () { * Initializes the login page. */ init: function () { + nf.Storage.init(); + var needsLogin = false; var needsNiFiRegistration = false; http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js new file mode 100644 index 0000000..2b642ef --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js @@ -0,0 +1,103 @@ +/* + * 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. + */ + +/* global nf, d3 */ + +nf.Storage = (function () { + + // Store items for two days before being eligible for removal. + var TWO_DAYS = 86400000 * 2; + + return { + /** + * Initializes the storage. Items will be persisted for two days. Once the scripts runs + * thereafter, all eligible items will be removed. This strategy does not support persistence. + */ + init: function () { + for (var i = 0; i < localStorage.length; i++) { + try { + // get the next item + var key = localStorage.key(i); + var entry = JSON.parse(localStorage.getItem(key)); + + // get the expiration + var expires = new Date(entry.expires); + var now = new Date(); + + // if the expiration date has passed, remove it + if (expires.valueOf() < now.valueOf()) { + localStorage.removeItem(key); + } + } catch (e) { + // likely unable to parse the item + } + } + }, + + /** + * Stores the specified item. + * + * @param {type} key + * @param {type} item + */ + setItem: function (key, item) { + // calculate the expiration + var expires = new Date().valueOf() + TWO_DAYS; + + // create the entry + var entry = { + expires: expires, + item: item + }; + + // store the item + localStorage.setItem(key, JSON.stringify(entry)); + }, + + /** + * Gets the item with the specified key. If an item with this key does + * not exist, null is returned. If an item exists but cannot be parsed + * or is malformed/unrecognized, null is returned. + * + * @param {type} key + */ + getItem: function (key) { + try { + // parse the entry + var entry = JSON.parse(localStorage.getItem(key)); + + // ensure the entry and item are present + if (nf.Common.isDefinedAndNotNull(entry) && nf.Common.isDefinedAndNotNull(entry.item)) { + return entry.item; + } else { + return null; + } + } catch (e) { + return null; + } + }, + + /** + * Removes the item with the specified key. + * + * @param {type} key + */ + removeItem: function (key) { + localStorage.removeItem(key); + } + }; +}()); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js index 0edbe08..876e06d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js @@ -174,6 +174,8 @@ nf.Provenance = (function () { * Initializes the status page. */ init: function () { + nf.Storage.init(); + // load the users authorities and detect if the NiFi is clustered $.when(loadControllerConfig(), loadAuthorities(), detectedCluster()).done(function () { // create the provenance table http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js index 97f8626..4f06662 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js @@ -128,6 +128,8 @@ nf.Summary = (function () { * Initializes the status page. */ init: function () { + nf.Storage.init(); + // intialize the summary table initializeSummaryTable().done(function () { // load the table http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js index b55bee2..678e352 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js @@ -204,6 +204,8 @@ nf.Templates = (function () { * Initializes the templates page. */ init: function () { + nf.Storage.init(); + // load the users authorities loadAuthorities().done(function () { http://git-wip-us.apache.org/repos/asf/nifi/blob/7f9807f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js index 96f73a5..9364aec 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js @@ -116,6 +116,8 @@ nf.Users = (function () { * Initializes the counters page. */ init: function () { + nf.Storage.init(); + // load the users authorities loadAuthorities().done(function () { // create the counters table