3.0.2 • Published 11 months ago

@mimik/oauth-helper v3.0.2

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
11 months ago

Modules

Typedefs

oauth-helper

Example

const oauthHelper = require('@mimik/oauth-helper');

oauth-helper~rpAuth(type, options) ⇒ Promise

Make an authorized request.

Kind: inner method of oauth-helper
Returns: Promise - .
Category: async
Throws:

The property token may be added to options, in order to set up how the token is retrieved from the token manager. The structure is:

{
   "retry": "object to specify how the retry to the token manager will be done. similar to rp-retry retry property",
   "customerName": "name of the customer for which the token is entended for, see mST API",
   "cluster": "to set the token to be a cluster token"
}

The property metrics may be added to options, in order to setup metrics about calls made to other microservice. The structure is:

{
    "HTTPrequestDuration": "prom-client function to label and record the elapsed time",
    "url": "url to be displayed for the metrics. If not present the url of the options will be used"
}

Requires: module:@mimik/sumologic-winston-logger
Fulfil: object - Response of the request-promise request.

ParamTypeDescription
typestringType of micro service to request.
optionsobjectOptions for the request. Similar to request-promise options.

oauth-helper~authProfile(method, id, correlationId, options) ⇒ Promise

Make an authProfile request to mID.

Kind: inner method of oauth-helper
Returns: Promise - .
Category: async
Throws:

  • Promise Will throw a rich error is the request fails or an error if the id is not identified

Requires: module:@mimik/sumologic-winston-logger
Fulfil: object The response of the request made to mID.

ParamTypeDescription
methodstringMethod (GET, DELETE) of the request to be made.
idstringUserId to associated witht the request.
correlationIdUUID.<string>CorrelationId to associated with the request.
optionsobjectOptions to be added to the request. metrics can then be added to the options.

requestCallback : function

This callback is displayed as a global member.

Kind: global typedef

ParamTypeDescription
eitherobjectnull or an error.
3.0.2

11 months ago

3.0.1

2 years ago

3.0.0

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

1.10.2

3 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.6

4 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago