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

remove jquery/reqwest httpRequesters #308

Merged
merged 2 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Breaking Changes

- [#308](https://github.com/okta/okta-auth-js/pull/308) - Removed `jquery` and `reqwest` httpRequesters

- [#309](https://github.com/okta/okta-auth-js/pull/309) - Removed `Q` library, now using standard Promise. IE11 will require a polyfill for the `Promise` object. Use of `Promise.prototype.finally` requires Node > 10.3 for server-side use.

- [#310](https://github.com/okta/okta-auth-js/pull/310)
Expand All @@ -12,6 +14,7 @@
- New method `closeSession` for XHR signout without redirect or reload.
- New method `revokeAccessToken`


### Other

## 2.12.0
Expand Down
40 changes: 1 addition & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ var OktaAuth = require('@okta/okta-auth-js');
var authClient = new OktaAuth(/* configOptions */);
```

If you're using a bundler like webpack or browserify, we have implementations for jquery and reqwest included. To use them, import the SDK like this:

```javascript
// reqwest
var OktaAuth = require('@okta/okta-auth-js/reqwest');

// jquery
var OktaAuth = require('@okta/okta-auth-js/jquery');
```

## Usage guide

For an overview of the client's features and authentication flows, check out [our developer docs](https://developer.okta.com/code/javascript/okta_auth_sdk). There, you will learn how to use the Auth SDK on a simple static page to:
Expand Down Expand Up @@ -297,7 +287,7 @@ If the user's browser does not support PKCE, an exception will be thrown. You ca

### `httpRequestClient`

The http request implementation. By default, this is implemented using [reqwest](https://github.com/ded/reqwest) for browser and [cross-fetch](https://github.com/lquixada/cross-fetch) for server. To provide your own request library, implement the following interface:
The http request implementation. By default, this is implemented using [cross-fetch](https://github.com/lquixada/cross-fetch). To provide your own request library, implement the following interface:

1. Must accept:
* method (http method)
Expand All @@ -322,34 +312,6 @@ var config = {
}
```

#### `ajaxRequest`

:warning: This parameter has been *deprecated*, please use [**httpRequestClient**](#httpRequestClient) instead.

The ajax request implementation. By default, this is implemented using [reqwest](https://github.com/ded/reqwest). To provide your own request library, implement the following interface:

1. Must accept:
* method (http method)
* url (target url)
* args (object containing headers and data)
2. Must return a Promise that resolves with a raw XMLHttpRequest response

```javascript
var config = {
url: 'https://{yourOktaDomain}',
ajaxRequest: function(method, url, args) {
// args is in the form:
// {
// headers: {
// headerName: headerValue
// },
// data: postBodyData
// }
return Promise.resolve(/* a raw XMLHttpRequest response */);
}
}
```

## API Reference

* [signIn](#signinoptions)
Expand Down
9 changes: 0 additions & 9 deletions THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,6 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

0. You just DO WHAT THE FUCK YOU WANT TO.


reqwest
Version (if any): 2.0.5
Brief Description: It's AJAX All over again. Includes support for
xmlHttpRequest, JSONP, CORS, and CommonJS Promises A.
License MIT

Copyright 2015 Dustin Diaz. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
Expand Down
17 changes: 0 additions & 17 deletions packages/okta-auth-js/jquery/index.js

This file was deleted.

37 changes: 0 additions & 37 deletions packages/okta-auth-js/jquery/jqueryRequest.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/okta-auth-js/lib/browser/browserIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

var fetchRequest = require('../../fetch/fetchRequest');
var fetchRequest = require('../fetch/fetchRequest');
var storageUtil = require('./browserStorage');

module.exports = require('./browser')(storageUtil, fetchRequest);
2 changes: 1 addition & 1 deletion packages/okta-auth-js/lib/server/serverIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

var fetchRequest = require('../../fetch/fetchRequest');
var fetchRequest = require('../fetch/fetchRequest');
var storageUtil = require('./serverStorage');

module.exports = require('./server')(storageUtil, fetchRequest);
15 changes: 0 additions & 15 deletions packages/okta-auth-js/none/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/okta-auth-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"cross-fetch": "^3.0.0",
"js-cookie": "2.2.0",
"node-cache": "^4.2.0",
"reqwest": "2.0.5",
"tiny-emitter": "1.1.0",
"xhr2": "0.1.3"
},
Expand All @@ -63,7 +62,6 @@
"jasmine-ajax": "^4.0.0",
"jest": "^24.9.0",
"jest-junit": "^9.0.0",
"jquery": "3.3.1",
"json-loader": "0.5.4",
"karma": "^4.1.0",
"karma-chrome-launcher": "^2.2.0",
Expand Down
17 changes: 0 additions & 17 deletions packages/okta-auth-js/reqwest/index.js

This file was deleted.

30 changes: 0 additions & 30 deletions packages/okta-auth-js/reqwest/reqwestRequest.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/okta-auth-js/test/spec/fetch-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('fetchRequest', function () {
return mockFetchObj.fetch.apply(null, arguments);
});

var fetchRequest = require('../../fetch/fetchRequest');
var fetchRequest = require('../../lib/fetch/fetchRequest');

beforeEach(function() {
/* global Map */
Expand Down
3 changes: 1 addition & 2 deletions packages/okta-auth-js/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* This config builds a minified version that can be imported
* anywhere without any dependencies. It packages the SDK
* with reqwest. It also preserves license comments.
* anywhere without any dependencies. It also preserves license comments.
*/
/* global __dirname */
var path = require('path');
Expand Down
10 changes: 0 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6501,11 +6501,6 @@ jest@24.9.0, jest@^24.9.0:
import-local "^2.0.0"
jest-cli "^24.9.0"

jquery@3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca"
integrity sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==

js-cookie@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.0.tgz#1b2c279a6eece380a12168b92485265b35b1effb"
Expand Down Expand Up @@ -9052,11 +9047,6 @@ requires-port@^1.0.0:
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=

reqwest@2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/reqwest/-/reqwest-2.0.5.tgz#00fb15ac4918c419ca82b43f24c78882e66039a1"
integrity sha1-APsVrEkYxBnKgrQ/JMeIguZgOaE=

resolve-cwd@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
Expand Down