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

feat: ActiveDirectoryPassword and sqlpassword authentication support #707

Merged
merged 103 commits into from
Nov 21, 2018
Merged
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
6e2d073
feat: aad authentication support
Feb 8, 2018
8c971f8
chore: add linebreak
Feb 8, 2018
b4441fd
chore: lint fix
Feb 8, 2018
6cfa3cd
chore: fix else block indentations
Feb 13, 2018
4d91c4f
refactor: use error instead of assert
Feb 13, 2018
511338d
chore: merge branch master
Mar 1, 2018
1cad62c
refactor: remove authentication from connection class configs
Mar 12, 2018
9f691c9
test: add feature ext parser test
Mar 12, 2018
de5e3b8
refactor: export login7paylod by name
Mar 13, 2018
8a9b876
refactor: pass parsed data to callback
Mar 13, 2018
dd2bbc9
fix: add featureextack event to catch errors
Mar 13, 2018
4dd2b1f
test: add error cases for invalid aad auth
Mar 13, 2018
fc24867
test: add unit test for fedauth info parser
Mar 13, 2018
12a902f
chore: removed required flow
Mar 13, 2018
fe0122b
chore: rename Pos to offset
Mar 14, 2018
ce3eceb
test: writeuint32atoffset unittest
Mar 14, 2018
ce13bdc
chore: rename writeuin32leatpos to offset
Mar 15, 2018
c233c74
chore: edit the error messages
Mar 16, 2018
2cd3240
Merge branch 'master' into federated-auth
May 25, 2018
e36869a
ci: enable azure active directory testing in ci
May 25, 2018
036433d
ci: update travis configuration
arthurschreiber May 26, 2018
f6772bf
ci: fix a typo in the travis configuration
arthurschreiber May 26, 2018
1ad29ed
ci: tweak travis configuration a bit
arthurschreiber May 26, 2018
eba1623
ci: fix variable substitution
arthurschreiber May 26, 2018
49558e2
ci: don't run azure tests for pull requests
arthurschreiber May 26, 2018
eca2499
ci: update travis config to use the correct variables
arthurschreiber May 26, 2018
62a24fd
refactor: remove async times
Jun 5, 2018
ee2714b
fix: parse multiple featues
Jun 5, 2018
3e07782
refactor: test multiple features
Jun 5, 2018
8df7254
Merge branch master
Jun 5, 2018
0702b77
fix: store acks in map
Jun 7, 2018
eb71906
fix: check fedauth ack before transition to login7
Jun 14, 2018
800e9a4
chore: rename featureextack and preloginrequired
Jun 14, 2018
d63c358
fix: check for feature ext ack before login
Jun 14, 2018
244c05a
chore: fix linter issues
Jun 15, 2018
c7663fb
fix: connecting with sqlpassword and non ad user
Jun 15, 2018
80a9313
fix: undefined property error
Jul 13, 2018
6b4a86d
chore: Merge branch master
Jul 13, 2018
cc71fe9
Merge branch 'master' of github.com:tediousjs/tedious into federated-…
arthurschreiber Jul 14, 2018
aa4437e
Merge branch 'master' of github.com:pekim/tedious into federated-auth
arthurschreiber Jul 24, 2018
b2645cc
Merge branch 'master' of github.com:pekim/tedious into federated-auth
arthurschreiber Jul 24, 2018
c2168cd
test: update `Login7Payload` test cases
arthurschreiber Jul 24, 2018
ea96250
fix: fix failure using regular authentication
arthurschreiber Jul 24, 2018
1257d5b
ci: remove `SqlPassword` authentication type from Travis config
arthurschreiber Jul 25, 2018
d42004e
refactor: start working on a new `authentication` config option
arthurschreiber Jul 25, 2018
ca3aba5
Merge branch 'federated-auth' into federated-auth
Aug 22, 2018
78e9460
chore: merge branch master
Sep 24, 2018
0a28dd1
fix: config validations
Sep 27, 2018
ef3860d
chore: Merge branch 'master'
Sep 27, 2018
9759b65
fix: travis config
Sep 27, 2018
c183a1b
chore: fix linter issue
Sep 27, 2018
3f62dbd
fix: flow type
Sep 28, 2018
2da13de
chore: add missing fedauthinfo flag
Sep 28, 2018
7e9f341
fix: add removed fedauthreq flag
Sep 28, 2018
59e5386
chore: fix merge conflicts
Oct 23, 2018
d8c8f97
fix: buffer allocation, error handling
Oct 24, 2018
b212b29
chore: linter
Oct 24, 2018
8029edc
Merge branch 'master' of github.com:tediousjs/tedious into federated-…
arthurschreiber Oct 26, 2018
851630e
ci: update Travis config for Azure AD Auth
arthurschreiber Oct 26, 2018
16c8ae6
fix: authentication type check
arthurschreiber Nov 3, 2018
60e11a7
fix: check for authentication type
arthurschreiber Nov 3, 2018
5ec11aa
Merge branch 'master' of github.com:pekim/tedious into federated-auth
arthurschreiber Nov 3, 2018
34321da
chore: update `package-lock.json`
arthurschreiber Nov 3, 2018
6066810
refactor: remove unused property
arthurschreiber Nov 3, 2018
fc923e4
refactor: remove unused code
arthurschreiber Nov 3, 2018
4515d4c
refactor: remove `fedAuthLibrary` property
arthurschreiber Nov 3, 2018
2325bdb
refactor: small code cleanups
arthurschreiber Nov 3, 2018
79ab731
refactor: always signal federated authentication support
arthurschreiber Nov 3, 2018
db5dd73
refactor: move logic into the state
arthurschreiber Nov 3, 2018
078f384
refactor: remove `featureExtAckPending` property
arthurschreiber Nov 3, 2018
9b453c1
refactor: remove `requiredPreLoginResponse` property
arthurschreiber Nov 3, 2018
df4570e
refactor: get rid of `fedAuthInfo` property
arthurschreiber Nov 3, 2018
64324d5
refactor: simplify prelogin payload processing
arthurschreiber Nov 3, 2018
d658927
test: skip connection retry tests when authenticating via Azure AD
arthurschreiber Nov 3, 2018
e76668b
test: fix bad credential tests to support Azure AD authentication
arthurschreiber Nov 3, 2018
42dadb1
refactor: simplify offset tracking when writing to a buffer
arthurschreiber Nov 3, 2018
263cde1
fix: use `Buffer.alloc`
arthurschreiber Nov 3, 2018
3b65260
refactor: remove `return` statements
arthurschreiber Nov 3, 2018
c77cd55
refactor: remove unused code
arthurschreiber Nov 3, 2018
14d3d22
style: remove empty line
arthurschreiber Nov 3, 2018
7f602ab
test: fix checking for Azure AD authentication
arthurschreiber Nov 3, 2018
d393e7d
test: update prelogin payload tests
arthurschreiber Nov 3, 2018
60b64dd
test: drop tests for dropped function
arthurschreiber Nov 3, 2018
45921fc
refactor: simplify the FEDAUTHINFO token parser code
arthurschreiber Nov 3, 2018
f242402
fix: do not use the global ADAL authentication cache
arthurschreiber Nov 3, 2018
75e8ff4
refactor: simplify the feature ext ack parser code
arthurschreiber Nov 3, 2018
532b969
test: handle missing `CREATE XML SCHEMA COLLECTION` permissions
arthurschreiber Nov 3, 2018
544f2e1
test: assert connection was established correctly
arthurschreiber Nov 3, 2018
9c9ffa5
test: update feature ext parser tests
arthurschreiber Nov 3, 2018
cd388dc
test: update login7 payload tests
arthurschreiber Nov 3, 2018
fffa06a
test: skip TVP test cases when missing permissions
arthurschreiber Nov 4, 2018
a10055f
fix: use the global ADAL cache
arthurschreiber Nov 4, 2018
e7b1bb5
test: skip TVP tests on older TDS versions
arthurschreiber Nov 4, 2018
d39dfc1
test: fix skipping of tests
arthurschreiber Nov 4, 2018
2acfa02
test: use temporary procedures
arthurschreiber Nov 5, 2018
231962e
test: use temporary procedure
arthurschreiber Nov 5, 2018
2837053
test: handle setup failures more gracefully
arthurschreiber Nov 5, 2018
19be9f6
test: increase timeouts
arthurschreiber Nov 5, 2018
4face04
fix: rename `azure-active-directory` to `active-directory-password`
arthurschreiber Nov 18, 2018
e3a5a89
Merge branch 'master' of github.com:tediousjs/tedious into federated-…
arthurschreiber Nov 18, 2018
8a597f9
text: update tests for authentication type rename
arthurschreiber Nov 18, 2018
01a36f8
fix: rename config option back
arthurschreiber Nov 19, 2018
572e97b
Merge branch 'master' into federated-auth
arthurschreiber Nov 21, 2018
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
15 changes: 5 additions & 10 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Connection extends EventEmitter {
}

this.fedAuthInfo = {
fedAuthLibrary: undefined,
requiredPreLoginResponse: false,
fedAuthInfoRequested: false,
responsePending: false,
Expand Down Expand Up @@ -739,17 +738,14 @@ class Connection extends EventEmitter {
if (!this.fedAuthInfo.fedAuthInfoRequested) {
this.loginError = ConnectionError('Did not request Active Directory authentication, but received the acknowledgment');
this.loggedIn = false;
}
switch (this.fedAuthInfo.fedAuthLibrary) {
case FEDAUTH_OPTIONS.LIBRARY_ADAL:
Copy link
Author

Choose a reason for hiding this comment

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

we should keep adal library check and FEDAUTH_OPTIONS and ADAL LIBRARY as we'll expand the feature to other auth types

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here as well, I'd rather have this as separate authentication types, instead of mixing this all together into one type with a large set of options.

} else {
const { authentication } = this.config;
if (authentication.type === 'azure-active-directory') {
if (0 !== fedAuthAck.length) {
this.loginError = ConnectionError(`Active Directory authentication acknowledgment for ${this.config.authentication.type} authentication method includes extra data`);
this.loginError = ConnectionError(`Active Directory authentication acknowledgment for ${authentication.type} authentication method includes extra data`);
this.loggedIn = false;
}
break;
default:
this.loginError = ConnectionError('Attempting to use unknown Active Directory authentication library');
this.loggedIn = false;
}
}
}
else {
Expand Down Expand Up @@ -1195,7 +1191,6 @@ class Connection extends EventEmitter {
switch (authentication.type) {
case 'azure-active-directory':
this.fedAuthInfo.fedAuthInfoRequested = true;
this.fedAuthInfo.fedAuthLibrary = FEDAUTH_OPTIONS.LIBRARY_ADAL;
payload.fedAuth = {
type: 'ADAL',
echo: this.fedAuthInfo.requiredPreLoginResponse,
Expand Down