Skip to content

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Apr 6, 2021

7.6.0 (2021-04-06)

Bug fixes

  • [ #622 ] Pick first route when multiple non-GET routes of the same size are available (scottinet)

New features

  • [ #621 ] Secure WebSocket connection with cookie authentication (Shiranuit)
  • [ #613 ] Implement index:stats (Leodau)
  • [ #612 ] Implement security:getUserStrategies (Leodau)

Enhancements


Aschen and others added 10 commits March 9, 2021 10:00
Add a _source property containing the user custom content to match the API.
## What does this PR do?

As the title suggests, this **PR** implements the recently added [security:getUserStrategies](https://docs.kuzzle.io/core/2/api/controllers/security/get-user-strategies/) _(@ Kuzzle Backend)_
So it can be used directly, instead of having to use **query** to access it.

Closes #611
Closes #593 

## What does this PR do?
From now on, when developing with the SDK, you will see warning when using a deprecated action. You can disable this behavior by setting to false the deprecationWarning option on the kuzzle sdk object

### How should this be manually tested?
Use a deprecated action and observe the warning(s)

### Other changes
Updated doc and added tests
## What does this PR do?

Add support for ES suggesters (`suggest` keyword) 

See also kuzzleio/kuzzle#2019


### Other changes

  - reduce the bundle size by ignoring node packages for the web build `230KB => 137KB` (fix #616)
What does this PR do?

This PR implements the recently added index:stats (@ Kuzzle Backend v2.10.0)
So it can be used directly, instead of having to use query to access it.

Todo:

  Implementation
  Unit Testing
  Doc + Code Snippet
How should this be manually tested?

Launch a Kuzzle stack.
Directly use sdk.index.stats()
Verify that you get stats that make sense.
Closes #608

ℹ️ It seems that Codecov is not taking the latest commit? 🤦
## What does this PR do?

Add the  `kuzzleStack` property containing the original stacktrace from Kuzzle.

It will allow to display only the Kuzzle stacktrace when an error occurs (e.g. in Kourou the user does not care about the SDK stacktrace)
When Kuzzle exposes multiple HTTP routes for the same controller action, the SDK picks either the one with the shortest URL and, if there is a tie in URL lengths, it prefers the GET route to favor content caching.

But when multiple routes are available, all with the same size, and none are a GET route, the SDK picks... none of them. Resulting in some actions returning a "URL not found" when trying to use them.
This PR adds the support of cookie when using the websocket protocol. To do that, when Kuzzle cookieAuth option is true, Kuzzle will call the method enableCookieSupport from the given protocol. When called, this method will throw if outside the browser or if cookie are not supported by the protocol, otherwise this will change how the protocol behave.

For the HTTP protocol it's simple, when enableCookieSupport is called, the protocol will be changing if the request are made with withCredentials set to true or false depending if he should be able to receive cookies.

For the Websocket protocol, this is a bit more complex, when enableCookieSupport is called, the protocol, will be creating a instance of the HTTP Protocol, with the same option (host, port, ssl, ...) as the websocket protocol, after that, when a request auth:login, auth:logout or auth:refreshToken is made, the protocol will use the HTTP Protocol instead of the websocket client to make the request.
[ex: auth:login request is made -> websocket closes the connection -> then send the request with the http protocol -> when a response is received it reopens the connection -> then resolve the request]
@Aschen Aschen added the release label Apr 6, 2021
@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #624 (8beec6a) into master (99fd623) will decrease coverage by 0.52%.
The diff coverage is 81.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #624      +/-   ##
==========================================
- Coverage   86.83%   86.30%   -0.53%     
==========================================
  Files          33       34       +1     
  Lines        1519     1585      +66     
  Branches      269      279      +10     
==========================================
+ Hits         1319     1368      +49     
- Misses        145      159      +14     
- Partials       55       58       +3     
Impacted Files Coverage Δ
src/controllers/Base.ts 87.50% <ø> (ø)
src/Kuzzle.ts 83.45% <44.44%> (-2.49%) ⬇️
src/controllers/Index.ts 75.00% <66.66%> (-1.20%) ⬇️
src/core/searchResult/SearchResultBase.ts 77.58% <83.33%> (+0.39%) ⬆️
src/protocols/WebSocket.ts 79.82% <83.33%> (+0.70%) ⬆️
src/protocols/Http.ts 83.13% <89.47%> (-1.01%) ⬇️
src/KuzzleError.ts 100.00% <100.00%> (ø)
src/controllers/Security.js 95.00% <100.00%> (+0.07%) ⬆️
src/core/searchResult/Document.ts 100.00% <100.00%> (ø)
src/core/searchResult/Profile.ts 100.00% <100.00%> (ø)
... and 8 more

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 99fd623...8beec6a. Read the comment docs.

@Aschen Aschen merged commit 817fe2d into master Apr 7, 2021
@Aschen Aschen deleted the 7.6.0-proposal branch April 7, 2021 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants