Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin embedded sdk #253

Merged
merged 18 commits into from
Mar 25, 2019
Merged

Plugin embedded sdk #253

merged 18 commits into from
Mar 25, 2019

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Mar 7, 2019

What does this PR do?

Adds documentation about the embedded SDK for plugins

Other changes

  • prefix entries about plugin context content with Plugin context: <entry> (eg: Plugin context: accessors)

@Aschen Aschen self-assigned this Mar 7, 2019
@kuzzle
Copy link
Contributor

kuzzle commented Mar 7, 2019

Snippets tests reports

SDK Version Tests overview
v6 ✔️
v5 ✔️
v1 ✔️
v1 ✔️
v1 ✔️
v1 ✔️

Copy link
Contributor

@benoitvidis benoitvidis left a comment

Choose a reason for hiding this comment

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

Nice job.
I personally would try to impersonate the introduction a little (avoid we and you) to make it more neutral.

src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
src/plugins/1/essentials/getting-started/index.md Outdated Show resolved Hide resolved
src/plugins/1/essentials/getting-started/index.md Outdated Show resolved Hide resolved
src/plugins/1/essentials/getting-started/index.md Outdated Show resolved Hide resolved
src/plugins/1/essentials/getting-started/index.md Outdated Show resolved Hide resolved
alexandrebouthinon pushed a commit to kuzzleio/kuzzle that referenced this pull request Mar 20, 2019
Adds a method to use the original request user inside the requests sent by the embedded SDK.
The main purpose of this feature is to properly set Kuzzle metadata (author and updater) on documents.

Call to sdk.as(user) method will instantiate a new SDK with a FunnelProcotol that takes the user in the constructor and inject it in the request context before passing the request to theFunnel.

// This will create a document with `author` metadata to `null`
this.context.accessors.sdk.document.create(...); 

// This will create a document with `author` metadata to the original request user
this.context.accessors.sdk.as(request.context.user).document.create(...);

// This will throw a PluginImplementationError, no user impersonation for now
this.context.accessors.sdk.as({ user: { _id: 'gordon' } }).document.create(...);
Documentation: kuzzleio/documentation#253
src/plugins/1/accessors/sdk/index.md Outdated Show resolved Hide resolved
@benoitvidis benoitvidis merged commit 91e9d6b into 2-dev Mar 25, 2019
@scottinet scottinet mentioned this pull request Mar 26, 2019
scottinet added a commit that referenced this pull request Mar 26, 2019
# [2.1.0](https://github.com/kuzzleio/documentation/releases/tag/2.1.0) (2019-03-26)


#### Bug fixes

- [ [#251](#251) ] Fix ssl option name for android   ([jenow](https://github.com/jenow))

#### New features

- [ [#164](#164) ] KZL-861 Getting started with Webpack   ([xbill82](https://github.com/xbill82))

#### Enhancements

- [ [#252](#252) ] Add loading of fixtures mappings securities in admin controller   ([Aschen](https://github.com/Aschen))
- [ [#253](#253) ] Plugin embedded sdk   ([Aschen](https://github.com/Aschen))
- [ [#249](#249) ] Better example for SearchResult.next   ([Aschen](https://github.com/Aschen))

#### Others

- [ [#262](#262) ] [API] new auth:refreshToken API route documentation   ([scottinet](https://github.com/scottinet))
- [ [#257](#257) ] KZL-1054 Fix Node.js SDK Getting Started subscription   ([xbill82](https://github.com/xbill82))
- [ [#263](#263) ] [debug] Print standard output on an assertion error   ([scottinet](https://github.com/scottinet))
---
@scottinet scottinet deleted the plugin-embedded-sdk branch July 23, 2019 14:24
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.

4 participants