Skip to content

Conversation

@alexandrebouthinon
Copy link
Member

What does this PR do?

Save Kuzzle API routes in a json file to permit the HTTP protocol to not have to performs request on Kuzzle to fetch all available vanilla routes.

How should this be manually tested?

Run Unit test and/or use HTTP protocol

@codecov-io
Copy link

codecov-io commented Feb 8, 2019

Codecov Report

Merging #370 into 6-dev will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##            6-dev    #370      +/-   ##
=========================================
+ Coverage   96.65%   96.7%   +0.05%     
=========================================
  Files          29      29              
  Lines        1434    1427       -7     
=========================================
- Hits         1386    1380       -6     
+ Misses         48      47       -1
Impacted Files Coverage Δ
src/protocols/http.js 93.58% <100%> (+0.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e1376d...c5d27eb. Read the comment docs.

return Promise.resolve();
}

return this._sendHttpRequest('GET', '/')
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not used anymore, you should remove this call because it may throw an error if the anonymous user does not have the server:info right

Copy link
Member Author

@alexandrebouthinon alexandrebouthinon Feb 14, 2019

Choose a reason for hiding this comment

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

Anonymous can use the HTTP protocol since this function will not reject in case of permissions issue. You'll still get a response from the server (with 403 status code yes but a response). This will rejects only in case of network or JSON parsing issue. 🙂

@alexandrebouthinon
Copy link
Member Author

alexandrebouthinon commented Feb 11, 2019

@scottinet : I put this PR on WIP. After quick talk with @Aschen, it sounds cool to have a new route in Kuzzle server controller to return plugins customs routes.

@scottinet
Copy link
Contributor

The issue resolved by this PR here is that, without rights to server:info, the HTTP part of the SDK is unable to perform correctly.
Creating a dedicating API route allowing kuzzle to send the available routes just moves the problem, it doesn't solve it.

Moreover, between server:info and the swagger routes, we should already be covered.

@alexandrebouthinon
Copy link
Member Author

@Aschen : Does the @scottinet's answer satisfied you?

To permit the HTTP protocol to not have to performs request on Kuzzle to
fetch all available `vanilla` routes.
@Aschen Aschen merged commit aa88cf7 into 6-dev Feb 18, 2019
@Aschen Aschen deleted the KZL-996-http-routes branch February 18, 2019 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants