Constructor
(abstract) new ClientConfig(endpoint)
Client configuration constructor.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | server base URL that will be prepend to all server requests |
- Source:
Methods
disableAuthentication()
Disables authentication.
- Source:
getBasicAuthentication() → {boolean}
- Source:
Returns:
[basicAuth] if use Basic Auth
- Type
- boolean
getEndpoint() → {string}
Returns the server's endpoint URL.
- Source:
Returns:
the endpoint URL
- Type
- string
getGdbTokenAuthentication() → {boolean}
- Source:
Returns:
[gdbTokenAuth] if use Gdb Token Auth
- Type
- boolean
getHeaders() → {Object.<string, string>}
Returns the default headers for each HTTP request.
- Source:
Returns:
the default headers map
- Type
- Object.<string, string>
getKeepAlive() → {boolean}
- Source:
Returns:
if the user should be re-logged in after token expires
- Type
- boolean
getPass() → {string}
- Source:
Returns:
the user password
- Type
- string
getUsername() → {string}
- Source:
Returns:
the username
- Type
- string
setEndpoint(endpoint) → {this}
Sets the server's endpoint URL.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string | the endpoint URL |
- Source:
Returns:
the current config for method chaining
- Type
- this
setHeaders(headers) → {this}
Sets the default headers map for each HTTP request.
Parameters:
Name | Type | Description |
---|---|---|
headers |
Object.<string, string> | the default headers |
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this
setKeepAlive(keepAlive) → {this}
Parameters:
Name | Type | Description |
---|---|---|
keepAlive |
boolean |
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this
shouldAuthenticate() → {boolean}
Returns true
if basic or gdb token authentication
is enabled. false
otherwise.
- Source:
Returns:
is authentication enabled
- Type
- boolean
useBasicAuthentication(usernameopt, passopt) → {this}
Username and password for user logging setter. Sets basic authentication as client authentication type.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
username |
string |
<optional> |
|
pass |
string |
<optional> |
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this
useGdbTokenAuthentication(usernameopt, passopt) → {this}
Username and password for user logging setter. Sets gdb token authentication as client authentication type. *
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
username |
string |
<optional> |
|
pass |
string |
<optional> |
- Source:
Returns:
the concrete configuration config for method chaining
- Type
- this