Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 42d820b

Browse files
Merge pull request #36 from helloextend/feat/DEVOPS-547-update-ec-creds-login-to-catch-no-role-error
feat: [DEVOPS-547] Adding validation around SAML Object for AWS Login.
2 parents 17bb340 + 449bd33 commit 42d820b

File tree

4 files changed

+15
-43
lines changed

4 files changed

+15
-43
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This file is used to track notable changes to the codebase
44

55
## [Unreleased]
66

7+
## [0.0.14] - 2023-03-7
8+
9+
- Added SAML check for AWS login to see if you're actually getting something back.
10+
711
## [0.0.13] - 2020-10-2
812

913
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extaws",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"description": "Extend Okta Aws Authentication",
55
"main": "dist/index.js",
66
"files": [

src/lib/extaws.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,14 +583,14 @@ export class ExtAws {
583583
*/
584584
private async parseAssertionFromHtml(): Promise<void> {
585585
let rawAssertion = ''
586-
const handler = new htmlparser.DefaultHandler(function(err: Error | null, dom: unknown) {
587-
if (err) {
588-
console.error('Error: ' + err)
589-
} else {
590-
const samlObject = soup.select(dom, '#appForm')
591-
rawAssertion = samlObject[0].children[1].attribs.value
586+
const handler = new htmlparser.DefaultHandler(function(err, dom) {
587+
const samlObject = soup.select(dom, '#appForm')
588+
if (samlObject.length == 0) {
589+
throw new Error('SAML Object is empty. There are no valid roles for assertion.')
592590
}
591+
rawAssertion = samlObject[0].children[1].attribs.value
593592
})
593+
594594
const parser = new htmlparser.Parser(handler)
595595
parser.parseComplete(this.httpAssertion)
596596

yarn.lock

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
18201820
dependencies:
18211821
ms "2.1.2"
18221822

1823-
debuglog@*, debuglog@^1.0.1:
1823+
debuglog@^1.0.1:
18241824
version "1.0.1"
18251825
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
18261826
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -3001,7 +3001,7 @@ import-local@^3.0.2:
30013001
pkg-dir "^4.2.0"
30023002
resolve-cwd "^3.0.0"
30033003

3004-
imurmurhash@*, imurmurhash@^0.1.4:
3004+
imurmurhash@^0.1.4:
30053005
version "0.1.4"
30063006
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
30073007
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -4001,11 +4001,6 @@ lockfile@~1.0.3:
40014001
dependencies:
40024002
signal-exit "^3.0.2"
40034003

4004-
lodash._baseindexof@*:
4005-
version "3.1.0"
4006-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
4007-
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
4008-
40094004
lodash._baseuniq@~4.6.0:
40104005
version "4.6.0"
40114006
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
@@ -4014,33 +4009,11 @@ lodash._baseuniq@~4.6.0:
40144009
lodash._createset "~4.0.0"
40154010
lodash._root "~3.0.0"
40164011

4017-
lodash._bindcallback@*:
4018-
version "3.0.1"
4019-
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
4020-
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
4021-
4022-
lodash._cacheindexof@*:
4023-
version "3.0.2"
4024-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
4025-
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
4026-
4027-
lodash._createcache@*:
4028-
version "3.1.2"
4029-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
4030-
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
4031-
dependencies:
4032-
lodash._getnative "^3.0.0"
4033-
40344012
lodash._createset@~4.0.0:
40354013
version "4.0.3"
40364014
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
40374015
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
40384016

4039-
lodash._getnative@*, lodash._getnative@^3.0.0:
4040-
version "3.9.1"
4041-
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
4042-
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
4043-
40444017
lodash._root@~3.0.0:
40454018
version "3.0.1"
40464019
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
@@ -4056,11 +4029,6 @@ [email protected]:
40564029
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
40574030
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
40584031

4059-
lodash.restparam@*:
4060-
version "3.6.1"
4061-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
4062-
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
4063-
40644032
lodash.sortby@^4.7.0:
40654033
version "4.7.0"
40664034
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
@@ -5333,7 +5301,7 @@ readable-stream@~1.1.10:
53335301
isarray "0.0.1"
53345302
string_decoder "~0.10.x"
53355303

5336-
readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0:
5304+
readdir-scoped-modules@^1.0.0:
53375305
version "1.1.0"
53385306
resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309"
53395307
integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==
@@ -6634,7 +6602,7 @@ v8-to-istanbul@^5.0.1:
66346602
convert-source-map "^1.6.0"
66356603
source-map "^0.7.3"
66366604

6637-
validate-npm-package-license@*, validate-npm-package-license@^3.0.1:
6605+
validate-npm-package-license@^3.0.1:
66386606
version "3.0.4"
66396607
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
66406608
integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==

0 commit comments

Comments
 (0)