Skip to content

Commit 74a1374

Browse files
committed
Update Token based authentication tests
1 parent edd31ab commit 74a1374

File tree

5 files changed

+226
-194
lines changed

5 files changed

+226
-194
lines changed

doc/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6554,7 +6554,7 @@ This method can be used to set an access token and private key after pool
65546554
creation. It is useful if the token is known to have expired, and you are not
65556555
using [`accessTokenCallback`](#createpoolpoolattrsaccesstokencallback).
65566556

6557-
It can also be useful in tests to set an invalid token so that token expiry
6557+
It can also be useful in tests to set an expired token so that token expiry
65586558
code paths can be tested.
65596559

65606560
See [Explicitly Refreshing Pool Access Tokens](#settingpooltokens) for an example.

test/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ Set the following environment variables to provide credentials for the test suit
108108

109109
* `NODE_ORACLEDB_QA`. This boolean environment variable serves as the toggle switch of certain tests. Some tests, such as `callTimeout.js`, use hard-coded variables as assertion condition. The test results may be inconsistent in different network situations.
110110

111-
* `NODE_ORACLEDB_ACCESS_TOKEN_LOC` provides the directory path where the Oracle Identity and Access Manager (IAM) database token and private key files are. These files are generated by the Oracle Cloud Infrastructure Command Line Interface (OCI-CLI) command oci iam db-token get. This is required in token based authentication.
111+
* `NODE_ORACLEDB_ACCESS_TOKEN_LOC` provides the directory path where the valid Oracle Identity and Access Manager (IAM) database token and private key files are. These files are generated by the Oracle Cloud Infrastructure Command Line Interface (OCI-CLI) command oci iam db-token get. This is required in token based authentication.
112+
113+
* `NODE_ORACLEDB_EXPIRED_ACCESS_TOKEN_LOC` provides the directory path where expired Oracle Identity and Access Manager (IAM) database token and private key files are. These files are generated by the Oracle Cloud Infrastructure Command Line Interface (OCI-CLI) command oci iam db-token get. This is required in token based authentication testing.
112114

113115
Note: the test suite requires the schema to have these privileges: CREATE TABLE, CREATE SESSION,
114116
CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER, and CREATE TYPE.

test/list.txt

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5314,54 +5314,56 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
53145314
264.1 check for methodName getConnection
53155315

53165316
265. tokenbasedAuthentication.js
5317-
265.1. pool
5318-
265.1.1. create pool connection
5319-
265.1.2. acquire multiple sessions from pool
5320-
265.1.3. acquire multiple sessions from multiple pool
5321-
265.1.4. query execution
5322-
265.1.5. homogeneous should be true
5323-
265.1.6. externalAuth should be false
5324-
265.1.7. token should be set in accessToken
5325-
265.1.8. token length should be not be 0 in accessToken
5326-
265.1.9. privateKey should be set in accessToken
5327-
265.1.10. privateKey length should not be 0 in accessToken
5328-
265.1.11. with callback having valid token
5329-
265.1.12. with no callback and expired token
5330-
265.1.13. with callback having invalid token
5331-
265.1.14. with callback having missing token
5332-
265.1.15. with callback having 0 length token
5333-
265.1.16. with callback having missing privateKey
5334-
265.1.17. with callback having 0 length privateKey
5335-
265.1.18. user/password without tokens with externalAuth set to true
5336-
265.1.19. user/password with tokens
5337-
265.1.20. invalidate tokens using setAccessToken with missing token
5338-
265.1.21. invalidate tokens using setAccessToken with empty token
5339-
265.1.22. invalidate tokens using setAccessToken with empty privateKey
5340-
265.1.23. invalidate tokens using setAccessToken with missing privateKey
5341-
265.1.24. with callback having valid tokens in multiple pool
5342-
265.1.25. with callback having valid and invalid tokens in multiple pool
5343-
265.1.26. acquiring released session after token expiry
5344-
265.1.27. acquiring released session with existing tag, with token expiry
5345-
265.1.28. acquiring released session without existing tag, with token expiry
5346-
265.1.29. user/password without tokens with externalAuth set to false
5347-
265.1.30. token and private key should be private
5348-
265.1.31. token and private key value should not be shown in logs
5349-
265.1.32. not readable token and private key value
5350-
265.1.33. pool creation with 0 connection
5351-
265.1.34. token expires before creating connection
5352-
265.1.35. undefined token and private key value
5353-
265.1.36. user/password with accessTokenCallback
5354-
5355-
265.2. standalone
5356-
265.2.1. create standalone connection
5357-
265.2.2. standalone connection with invalid data
5358-
265.2.3. standalone connection with missing data
5359-
265.2.4. standalone connection with missing data
5360-
265.2.5. standalone connection with empty data
5361-
265.2.6. standalone connection with empty data
5362-
265.2.7. externalAuth must be set to true
5363-
265.2.8. user/password with tokens
5364-
265.2.9. user/password without tokens
5365-
265.2.10. standalone connection with undefined private key and token
5366-
265.2.11. standalone connection with not readable data
5367-
265.2.12. token and private key are private
5317+
265.1 pool
5318+
265.1.1 create pool connection
5319+
265.1.2 acquire multiple sessions from pool
5320+
265.1.3 acquire multiple sessions from multiple pool
5321+
265.1.4 query execution
5322+
265.1.5 homogeneous should be true
5323+
265.1.6 externalAuth should be false
5324+
265.1.7 token should be set in accessToken
5325+
265.1.8 token length should be not be 0 in accessToken
5326+
265.1.9 privateKey should be set in accessToken
5327+
265.1.10 privateKey length should not be 0 in accessToken
5328+
265.1.11 with callback having valid token
5329+
265.1.12 with no callback and expired token
5330+
265.1.13 with callback having invalid token
5331+
265.1.14 with callback having missing token
5332+
265.1.15 with callback having 0 length token
5333+
265.1.16 with callback having missing privateKey
5334+
265.1.17 with callback having 0 length privateKey
5335+
265.1.18 user/password without tokens with externalAuth set to true
5336+
265.1.19 user/password with tokens
5337+
265.1.20 invalidate tokens using setAccessToken with missing token
5338+
265.1.21 invalidate tokens using setAccessToken with empty token
5339+
265.1.22 invalidate tokens using setAccessToken with empty privateKey
5340+
265.1.23 invalidate tokens using setAccessToken with missing privateKey
5341+
265.1.24 with callback having valid tokens in multiple pool
5342+
265.1.25 with callback having valid and invalid tokens in multiple pool
5343+
265.1.26 acquiring released session after token expiry
5344+
265.1.27 acquiring released session with existing tag, with token expiry
5345+
265.1.28 acquiring released session without existing tag, with token expiry
5346+
265.1.29 user/password without tokens with externalAuth set to false
5347+
265.1.30 token and private key should be private
5348+
265.1.31 token and private key value should not be shown in logs
5349+
265.1.32 not readable token and private key value
5350+
265.1.33 pool creation with 0 connection
5351+
265.1.34 token expires before creating connection
5352+
265.1.35 undefined token and private key value
5353+
265.1.36 user/password with accessTokenCallback
5354+
265.1.37 create pool connection using expired token
5355+
5356+
265.2 standalone
5357+
265.2.1 create standalone connection
5358+
265.2.2 standalone connection with invalid data
5359+
265.2.3 standalone connection with missing data
5360+
265.2.4 standalone connection with missing data
5361+
265.2.5 standalone connection with empty data
5362+
265.2.6 standalone connection with empty data
5363+
265.2.7 externalAuth must be set to true
5364+
265.2.8 user/password with tokens
5365+
265.2.9 user/password without tokens
5366+
265.2.10 standalone connection with undefined private key and token
5367+
265.2.11 standalone connection with not readable data
5368+
265.2.12 token and private key are private
5369+
265.2.13 standalone connection with expired token

0 commit comments

Comments
 (0)