@@ -14,14 +14,13 @@ Wrapper library for Topcoder Submission API
14
14
15
15
` ` ` javascript
16
16
const submissionApi = require(' topcoder-submission-api-wrapper' )
17
- const submissionApiClient = submissionApi(_.pick(config,
17
+ const submissionApiM2MClient = submissionApi(_.pick(config,
18
18
[' AUTH0_URL' , ' AUTH0_AUDIENCE' , ' TOKEN_CACHE_TIME' ,
19
19
' AUTH0_CLIENT_ID' , ' AUTH0_CLIENT_SECRET' , ' SUBMISSION_API_URL' ,
20
20
' AUTH0_PROXY_SERVER_URL' ]))
21
21
` ` `
22
22
23
- ** Configuration / Environment variables:**
24
-
23
+ ** M2M Authentication Configuration:**
25
24
- AUTH0_URL - the auth0 url
26
25
- AUTH0_AUDIENCE - the auth0 audience
27
26
- TOKEN_CACHE_TIME - (optional) the token cache time
@@ -33,6 +32,29 @@ Wrapper library for Topcoder Submission API
33
32
- PER_PAGE - the page size
34
33
- MAX_PAGE_SIZE - the max number of page size
35
34
35
+ ` ` ` javascript
36
+ const submissionApiUserCredentialsClient = submissionApi(_.pick(config,
37
+ [' USERNAME' , ' PASSWORD' , ' TC_AUTHN_URL' , ' TC_AUTHZ_URL' , ' TC_CLIENT_ID' ,
38
+ ' TC_CLIENT_V2CONNECTION' , ' SUBMISSION_API_URL' ]))
39
+ ` ` `
40
+
41
+ ** User Credentials Authentication Configuration:**
42
+ - USERNAME - Topcoder handle
43
+ - PASSWORD - Topcoder password
44
+ - TC_AUTHN_URL - OAUTH2 token URL, e.g. ` https://topcoder.auth0.com/oauth/ro` or for dev ` https://topcoder-dev.auth0.com/oauth/ro`
45
+ - TC_AUTHZ_URL - Topcoder API token URL, e.g. ` https://api.topcoder.com/v3/authorizations` or for dev ` https://api.topcoder-dev.com/v3/authorizations`
46
+ - TC_CLIENT_ID - OAUTH2 Client ID, e.g. ` 6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P` or for dev ` JFDo7HMkf0q2CkVFHojy3zHWafziprhT`
47
+ - TC_CLIENT_V2CONNECTION - The OAUTH2 Client data source, e.g. ` TC-User-Database`
48
+ - SUBMISSION_API_URL - Topcoder V5 Submission API URL. E.g. ` https://api.topcoder.com/v5` or for dev ` https://api.topcoder-dev.com/v5`
49
+
50
+ ` ` ` javascript
51
+ const submissionJwtMethodArgClient = submissionApi(_.pick(config,
52
+ [' SUBMISSION_API_URL' ]))
53
+ ` ` `
54
+
55
+ ** JWT Method Argument Authentication Configuration:**
56
+ - SUBMISSION_API_URL - Topcoder V5 Submission API URL. E.g. ` https://api.topcoder.com/v5` or for dev ` https://api.topcoder-dev.com/v5`
57
+
36
58
3. Every function in this wrapper will return a promise, Handling promises is at the caller end. Call the functions with appropriate arguments
37
59
38
60
E.g.
@@ -126,6 +148,13 @@ Following environment variables need to be set up before running the tests
126
148
- TEST_AUTH0_CLIENT_ID
127
149
- TEST_AUTH0_CLIENT_SECRET
128
150
- TEST_SUBMISSION_API_URL
151
+ - TEST_JWT
152
+ - TEST_USERNAME
153
+ - TEST_PASSWORD
154
+ - TEST_TC_AUTHN_URL
155
+ - TEST_TC_AUTHZ_URL
156
+ - TEST_TC_CLIENT_ID
157
+ - TEST_TC_CLIENT_V2CONNECTION
129
158
` ` `
130
159
131
160
Refer to Step # 2 in [this section](#how-to-use-this-wrapper) to learn more about the configuration variables.
0 commit comments