You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/02/13 22:28:58 UTC

[GitHub] [nifi-registry] thenatog opened a new pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

thenatog opened a new pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r382738485
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry.js
 ##########
 @@ -71,9 +71,11 @@ NfRegistry.prototype = {
      * Invalidate old tokens and route to login page
      */
     logout: function () {
+        this.nfRegistryApi.deleteToLogout().subscribe(function () {
+
+        });
         delete this.nfRegistryService.currentUser.identity;
 
 Review comment:
   ```suggestion
           
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] alopresto commented on issue #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
alopresto commented on issue #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#issuecomment-589823856
 
 
   Ran `contrib-check` and all tests pass. +1, merging. Thanks Nathan and Scott. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] thenatog commented on issue #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
thenatog commented on issue #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#issuecomment-589165845
 
 
   > @thenatog : looks good in my opinion, and I think the test failure is unrelated, could you confirm?
   > 
   > ```
   > Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 12.151 sec <<< FAILURE! - in org.apache.nifi.registry.web.api.BucketsIT
   > testCreateBucketGetBucket(org.apache.nifi.registry.web.api.BucketsIT)  Time elapsed: 0.124 sec  <<< ERROR!
   > javax.ws.rs.ClientErrorException: HTTP 409 Conflict
   > 	at org.glassfish.jersey.client.JerseyInvocation.createExceptionForFamily(JerseyInvocation.java:1122)
   > 	at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1105)
   > 	at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:883)
   > 	at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:767)
   > 	at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
   > 	at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
   > 	at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
   > 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)
   > 	at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:765)
   > 	at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:456)
   > 	at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:357)
   > 	at org.apache.nifi.registry.web.api.BucketsIT.testCreateBucketGetBucket(BucketsIT.java:127)
   > ```
   
   I'm not seeing this error when I run the tests on my machine. Someone should confirm this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r382738573
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry.js
 ##########
 @@ -71,9 +71,11 @@ NfRegistry.prototype = {
      * Invalidate old tokens and route to login page
      */
     logout: function () {
+        this.nfRegistryApi.deleteToLogout().subscribe(function () {
+
+        });
         delete this.nfRegistryService.currentUser.identity;
         delete this.nfRegistryService.currentUser.anonymous;
 
 Review comment:
   ```suggestion
           
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r382737469
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry.js
 ##########
 @@ -71,9 +71,11 @@ NfRegistry.prototype = {
      * Invalidate old tokens and route to login page
      */
     logout: function () {
+        this.nfRegistryApi.deleteToLogout().subscribe(function () {
 
 Review comment:
   ```suggestion
           var self = this;
           this.nfRegistryApi.deleteToLogout().subscribe(
           function () {
                // next call
           },
           function () {
                // error callback
           },
           function () {
                 // complete callback... clean up and navigate on complete only
                 self.nfStorage.removeItem('jwt');
                 delete self.nfRegistryService.currentUser.identity;
                 delete self.nfRegistryService.currentUser.anonymous;
                 self.router.navigateByUrl('login');
           });
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] alopresto commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
alopresto commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r381660853
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry.js
 ##########
 @@ -71,9 +71,11 @@ NfRegistry.prototype = {
      * Invalidate old tokens and route to login page
      */
     logout: function () {
+        this.nfRegistryApi.deleteToLogout().subscribe(function () {
 
 Review comment:
   @mcgilman @scottyaslan can you please review this and provide an answer? Thank you. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] thenatog commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
thenatog commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r380980086
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry.js
 ##########
 @@ -71,9 +71,11 @@ NfRegistry.prototype = {
      * Invalidate old tokens and route to login page
      */
     logout: function () {
+        this.nfRegistryApi.deleteToLogout().subscribe(function () {
 
 Review comment:
   Do I need to do this subscribe? Or do I just called deleteToLogout()?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] asfgit closed pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r382738306
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js
 ##########
 @@ -725,6 +725,37 @@ NfRegistryApi.prototype = {
         );
     },
 
+    /**
+     * Logout a user.
+     *
+     * @returns {*}
+     */
+    deleteToLogout: function () {
+        var self = this;
+        var options = {
+            headers: headers,
+            withCredentials: true,
+            responseType: 'text'
+        };
+
+        return this.http.delete('../nifi-registry-api/access/logout', options).pipe(
+            map(function (response) {
+                // remove the token from local storage
+                self.nfStorage.removeItem('jwt');
 
 Review comment:
   ```suggestion
                  
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi-registry] scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.

Posted by GitBox <gi...@apache.org>.
scottyaslan commented on a change in pull request #259: NIFIREG-361 - Improved handling of the /access/logout endpoint.
URL: https://github.com/apache/nifi-registry/pull/259#discussion_r382738637
 
 

 ##########
 File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry.js
 ##########
 @@ -71,9 +71,11 @@ NfRegistry.prototype = {
      * Invalidate old tokens and route to login page
      */
     logout: function () {
+        this.nfRegistryApi.deleteToLogout().subscribe(function () {
+
+        });
         delete this.nfRegistryService.currentUser.identity;
         delete this.nfRegistryService.currentUser.anonymous;
-        this.nfStorage.removeItem('jwt');
         this.router.navigateByUrl('login');
 
 Review comment:
   ```suggestion
           
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services