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

Openapi update #147

Merged
merged 48 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d3f961a
updates integration tests for new openapi
swiftone May 8, 2020
3a2d2c0
updates licensing banners
swiftone May 11, 2020
8c9398b
updated generated code
swiftone May 11, 2020
dc98902
build from even updateder openapi
swiftone May 11, 2020
3860a63
chore: sync with openapi master
shuowu May 12, 2020
66245ea
fix: reference model data generation (#149)
shuowu May 12, 2020
32a365e
chore: sync with openapi master
shuowu May 12, 2020
b066c6c
chore: sync with openapi master
shuowu May 13, 2020
0344e81
chore: sync with openapi master
shuowu May 19, 2020
ac2c380
add integration tests for idp okta 288649 (#150)
shuowu May 20, 2020
1a0a963
test: add it for user type api - OKTA-288654 (#153)
shuowu May 20, 2020
20eff9b
Integration tests for linked object api okta 288651 (#152)
shuowu May 21, 2020
7e38963
test: add it for group api - OKTA-288652 (#154)
shuowu May 21, 2020
987c5e2
test: add integration tests for sms template - OKTA-288648 (#145)
shuowu May 22, 2020
9c0428d
integration tests for policy api okta 288650 (#151)
shuowu May 22, 2020
83eac7b
test: add it for user api - OKTA-288653 (#155)
shuowu May 28, 2020
8494d47
fix: support x-okta-multi-operation - OKTA-289242 (#156)
shuowu Jun 2, 2020
dbb660e
chore: sync with latest openapi master
shuowu Jun 3, 2020
daafa21
chore: sync with openapi master
shuowu Jun 8, 2020
f6ee0e7
chore: sync with openapi master
shuowu Jun 10, 2020
a1db957
fix: pass correct content type for publish csr - OKTA-288634 (#157)
shuowu Jun 10, 2020
25d2b81
test: add integration tests for event hook apis - OKTA-288645 (#164)
shuowu Jun 11, 2020
42e21d6
test: add ITs for auth server - OKTA-288644 (#163)
shuowu Jun 11, 2020
a4064a5
test: enable skipped factor test - OKTA-288643 (#162)
shuowu Jun 11, 2020
0621621
test: skip csr test suites (#159)
shuowu Jun 11, 2020
53928c0
test: add it for application - OKTA-288642 (#161)
shuowu Jun 11, 2020
987864c
chore: sync with latest openapi master
shuowu Jun 11, 2020
75bb458
test: add integration tests for feature api - OKTA-288647 (#166)
shuowu Jun 12, 2020
b07ce64
test: add integration tests for inline hook api - OKTA-288646 (#165)
shuowu Jun 12, 2020
9fa10f4
chore: sync with latest openapi
shuowu Jun 16, 2020
a65f024
test: add it for admin role - OKTA-288641 (#158)
shuowu Jun 17, 2020
f220f4c
chore: sync with latest openapi master
shuowu Jun 18, 2020
a451368
chore: drop support for node8 - OKTA-257574 (#167)
shuowu Jun 19, 2020
d67f0f8
doc: add changelog - OKTA-305277 (#169)
shuowu-okta Jun 25, 2020
f86d837
test: re-enable skipped key store tests
shuowu Jun 25, 2020
37bb1c0
test: refactor mock data with faker (#170)
shuowu Jun 25, 2020
0dd2774
chore: sync with openapi master
shuowu Jun 25, 2020
ff90e2f
chore: sync with openapi
shuowu Jun 25, 2020
5085f90
chore: rename case sensitive files
shuowu Jun 25, 2020
5fed437
test: fix link object fake names
shuowu Jun 26, 2020
df62634
test: use different user profiles on client-list-users test
shuowu Jun 26, 2020
96b87c0
chore: remove generated files before build (#172)
shuowu Jun 29, 2020
baf6f43
chore: update openapi version to latest in npm
shuowu Jun 29, 2020
2090d31
doc: add migration guide
shuowu Jun 30, 2020
2513fb9
doc: fix typo
shuowu Jun 30, 2020
282a515
doc: add more info in migration guide
shuowu Jul 6, 2020
329cf1a
chore: fix typo in banners
shuowu Jul 6, 2020
8fb0f35
docs: migration guide
shuowu Jul 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- '8'
- '10'
- '12'
sudo: false
Expand Down
418 changes: 418 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Then run the tests:

```bash
npm test
```
```
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Node.js API Client for the [Okta Platform API].

Requires Node.js version 6.9.0 or higher.
Requires Node.js version 10.0.0 or higher.

Need help? Contact [developers@okta.com](mailto:developers@okta.com) or use the [Okta Developer Forum].

Expand Down Expand Up @@ -93,6 +93,7 @@ The `privateKey` can be passed in the following ways:
* [Request Executor](#request-executor)
* [Default Request Executor](#default-request-executor)
* [Base Request Executor](#base-request-executor)
* [Migrating between versions](#migrating-between-versions)


## Examples
Expand Down Expand Up @@ -343,7 +344,7 @@ client.endSession(session.id)
To end all sessions for a user, you must know the ID of the user:

```javascript
client.endAllUserSessions(user.id)
client.clearUserSessions(user.id)
.then(() => {
console.log('All user sessions have ended');
});
Expand Down Expand Up @@ -770,6 +771,25 @@ const client = new okta.Client({
})
```

## Migrating between versions

### From 3.x to 4.0

The version 4.0 of this SDK dropped support for Node 8, which is EOL (End-of-Life) since 2019-12-31. Current supported minimum Node version is 10.0.0.

This version 4.0 release also updated APIs latest `@okta/openapi` (v2.0.0) that includes added, changed and deprecated factories/models/client methods. Change details are listed in [CHANGELOG.md](CHANGELOG.md#400). For each change item:

- `Add` stands for newly added factories/models/client methods.
- `Change` (**breaking changes**) stands for renamed factories/models/client methods.
- `Remove` (**breaking changes**) stands for deprecated factories/models/client methods.

#### Main breaking changes

- Renamed `Factor` related factories/models/client methods to `UserFactor`
- Renamed `client.endAllUserSessions` to `client.clearUserSessions`
- Model and Client methods change for `User` related operations
- Model and Client methods change for `Rule` related operations

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) if you would like to propose changes to this library.
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@okta/okta-sdk-nodejs",
"version": "3.4.0",
"version": "4.0.0",
"description": "Okta API wrapper for Node.js",
"engines": {
"node": ">=8.11"
"node": ">=10.0"
},
"files": [
"src/",
Expand All @@ -12,10 +12,11 @@
"main": "src/index.js",
"scripts": {
"banners": "./utils/maintain-banners.js",
"prebuild": "rimraf ./src/models ./src/factories ./src/generated-client.js",
"build": "okta-sdk-generator -t templates/ -o .",
"eslint": "eslint -c src/.eslintrc src/ && eslint -c test/.eslintrc test/it test/unit && eslint -c test/jest/.eslintrc test/jest/ && eslint -c src/.eslintrc utils/",
"jest": "jest --coverage test/jest/*.js",
"predocs": "rm -rf ./jsdocs && mkdir jsdocs/ && ./utils/make-jsdoc-readme.js > ./jsdocs/jsdoc-temp.md",
"predocs": "rimraf ./jsdocs && mkdir jsdocs/ && ./utils/make-jsdoc-readme.js > ./jsdocs/jsdoc-temp.md",
"docs": "./node_modules/.bin/jsdoc src/ -c ./docs/config.json -d ./jsdocs/ -P ./package.json -R ./jsdocs/jsdoc-temp.md -r",
"test:integration": "nyc --reporter=text --reporter=html mocha test/it/*.js --no-timeouts",
"test:unit": "nyc --reporter=text --reporter=html mocha test/unit/*.js --no-timeouts",
Expand All @@ -35,7 +36,7 @@
"rasha": "^1.2.5"
},
"devDependencies": {
"@okta/openapi": "^1.11.0",
"@okta/openapi": "^2.0.0",
"chai": "^3.5.0",
"eslint": "^3.19.0",
"eslint-plugin-jest": "^21.17.0",
Expand All @@ -48,6 +49,7 @@
"jsdoc": "^3.4.0",
"mocha": "^3.4.1",
"nyc": "^10.3.2",
"rimraf": "^3.0.2",
"sinon": "^7.3.1",
"speakeasy": "^2.0.0"
},
Expand All @@ -58,4 +60,4 @@
"jest-date-mock"
]
}
}
}
2 changes: 1 addition & 1 deletion src/api-error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/collection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/config-loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/default-cache-middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/default-request-executor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2018-present, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2018-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/factories/ApplicationFactory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/factories/BrowserPluginApplicationFactory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
4 changes: 3 additions & 1 deletion src/factories/PolicyFactory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand All @@ -21,6 +21,8 @@ const models = require('../models');
class PolicyFactory extends ModelResolutionFactory {
getMapping() {
return {
'IDP_DISCOVERY': models.IdentityProviderPolicy,
'OAUTH_AUTHORIZATION_POLICY': models.OAuthAuthorizationPolicy,
'OKTA_SIGN_ON': models.OktaSignOnPolicy,
'PASSWORD': models.PasswordPolicy,
};
Expand Down
2 changes: 1 addition & 1 deletion src/factories/PolicyRuleFactory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand All @@ -18,19 +18,20 @@ const ModelResolutionFactory = require('../resolution-factory');
const factories = require('./');
const models = require('../models');

class FactorFactory extends ModelResolutionFactory {
class UserFactorFactory extends ModelResolutionFactory {
getMapping() {
return {
'call': models.CallFactor,
'email': models.EmailFactor,
'push': models.PushFactor,
'question': models.SecurityQuestionFactor,
'sms': models.SmsFactor,
'token': models.TokenFactor,
'token:hardware': models.HardwareFactor,
'token:software:totp': models.TotpFactor,
'u2f': models.U2fFactor,
'web': models.WebFactor,
'call': models.CallUserFactor,
'email': models.EmailUserFactor,
'push': models.PushUserFactor,
'question': models.SecurityQuestionUserFactor,
'sms': models.SmsUserFactor,
'token': models.TokenUserFactor,
'token:hardware': models.HardwareUserFactor,
'token:software:totp': models.TotpUserFactor,
'u2f': models.U2fUserFactor,
'web': models.WebUserFactor,
'webauthn': models.WebAuthnUserFactor,
};
}

Expand All @@ -39,4 +40,4 @@ class FactorFactory extends ModelResolutionFactory {
}
}

module.exports = FactorFactory;
module.exports = UserFactorFactory;
4 changes: 2 additions & 2 deletions src/factories/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2017-2018, Okta, Inc. and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2020, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Expand All @@ -16,6 +16,6 @@
/** @ignore */
exports.Application = require('./ApplicationFactory');
exports.BrowserPluginApplication = require('./BrowserPluginApplicationFactory');
exports.Factor = require('./FactorFactory');
exports.Policy = require('./PolicyFactory');
exports.PolicyRule = require('./PolicyRuleFactory');
exports.UserFactor = require('./UserFactorFactory');
Loading