Skip to content

Commit

Permalink
Introduce headersProvider and paramsProvider to auth options (#639)
Browse files Browse the repository at this point in the history
Bump to version 7.6.0

Co-authored-by: Pusher CI <[email protected]>
  • Loading branch information
sonologico and pusher-ci authored Dec 15, 2022
1 parent ebc3aa7 commit f00289c
Show file tree
Hide file tree
Showing 35 changed files with 588 additions and 78 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 7.6.0

- [ADDED] Introduce and to channel authorization and user authentication in order to allow for changing header and param values after the Pusher object is initialized.

## 7.5.0

- [ADDED] Watchlist Online Status
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ var presenceChannel: PusherTypes.PresenceChannel;

### React Native

> **⚠️ Important notice**
> **⚠️ Important notice**
>
> React Native support has been **deprecated** and soon will be removed from this repository.
>
> React Native support has been **deprecated** and soon will be removed from this repository.
>
> Please, use our official [React Native SDK](https://github.com/pusher/pusher-websocket-react-native) instead.
### Web Workers
Expand Down Expand Up @@ -232,6 +232,10 @@ Object containing the configuration for user authentication. Valid keys are:

* `headers` (Object) - Only applied when using `ajax` as authentication transport. Provides the ability to pass additional HTTP Headers to the user authentication endpoint. This can be useful with some web application frameworks that guard against CSRF CSRF (Cross-site request forgery).

* `paramsProvider` (Function) - When present, this function is called to get additional parameters to be sent when the user authentication endpoint is called. This is equivalent to passing them on the params key, but allows for the parameters to be retrieved dynamically at the time of the request.

* `headersProvider` (Function) - When present, this function is called to get additional headers to be sent when the user authentication endpoint is called. This is equivalent to passing them on the headers key, but allows for the headers to be retrieved dynamically at the time of the request.

* `customHandler` (Function) - When present, this function is called instead of a request being made to the endpoint specified by `userAuthentication.endpoint`.


Expand All @@ -252,6 +256,10 @@ Object containing the configuration for user authorization. Valid keys are:

* `headers` (Object) - Only applied when using `ajax` as authorizing transport. Provides the ability to pass additional HTTP Headers to the user authorization endpoint. This can be useful with some web application frameworks that guard against CSRF CSRF (Cross-site request forgery).

* `paramsProvider` (Function) - When present, this function is called to get additional parameters to be sent when the user authentication endpoint is called. This is equivalent to passing them on the params key, but allows for the parameters to be retrieved dynamically at the time of the request.

* `headersProvider` (Function) - When present, this function is called to get additional headers to be sent when the user authentication endpoint is called. This is equivalent to passing them on the headers key, but allows for the headers to be retrieved dynamically at the time of the request.

* `customHandler` (Function) - When present, this function is called instead of a request being made to the endpoint specified by `channelAuthorization.endpoint`.


Expand Down
42 changes: 34 additions & 8 deletions dist/node/pusher.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/node/pusher.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/react-native/pusher.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-native/pusher.js.map

Large diffs are not rendered by default.

45 changes: 36 additions & 9 deletions dist/web/pusher-with-encryption.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web/pusher-with-encryption.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web/pusher-with-encryption.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/web/pusher-with-encryption.min.js.map

Large diffs are not rendered by default.

45 changes: 36 additions & 9 deletions dist/web/pusher.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web/pusher.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web/pusher.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/web/pusher.min.js.map

Large diffs are not rendered by default.

42 changes: 34 additions & 8 deletions dist/worker/pusher-with-encryption.worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/worker/pusher-with-encryption.worker.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/worker/pusher-with-encryption.worker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/worker/pusher-with-encryption.worker.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit f00289c

Please sign in to comment.