Obtains and caches KIS access tokens and WebSocket approval keys with blocking requests; thread-safe.
More...
#include <algotradelib/src/brokers/kis/auth.hpp>
|
| | KisAuth (net::io_context &ioc, ssl::context &ctx, const KisConfig &config) |
| | Constructs the wrapper.
|
|
virtual | ~KisAuth ()=default |
| | Destroys the wrapper.
|
| std::string | accessToken () |
| | Returns a REST access token, requesting a new one if none is held or it expires within five minutes.
|
| std::string | accessWebsocket () |
| | Returns a WebSocket approval key, requesting a new one if none is held or it is a day old.
|
Obtains and caches KIS access tokens and WebSocket approval keys with blocking requests; thread-safe.
KisClient manages its own token; this is for code that calls KIS directly.
Definition at line 19 of file auth.hpp.
◆ KisAuth()
| algotradelib::kis::KisAuth::KisAuth |
( |
net::io_context & | ioc, |
|
|
ssl::context & | ctx, |
|
|
const KisConfig & | config ) |
|
inline |
Constructs the wrapper.
- Parameters
-
| ioc | The I/O context the requests run on; borrowed, and must outlive the wrapper. |
| ctx | The TLS context; borrowed, and must outlive the wrapper. |
| config | The credentials (copied). |
Definition at line 27 of file auth.hpp.
◆ accessToken()
| std::string algotradelib::kis::KisAuth::accessToken |
( |
| ) |
|
|
inline |
Returns a REST access token, requesting a new one if none is held or it expires within five minutes.
- Returns
- The token.
- Exceptions
-
| std::runtime_error | if the token request fails or its response cannot be read. |
| boost::system::system_error | on a transport failure. |
Definition at line 40 of file auth.hpp.
◆ accessWebsocket()
| std::string algotradelib::kis::KisAuth::accessWebsocket |
( |
| ) |
|
|
inline |
Returns a WebSocket approval key, requesting a new one if none is held or it is a day old.
- Returns
- The key.
- Exceptions
-
| std::runtime_error | if the request fails or its response cannot be read. |
| boost::system::system_error | on a transport failure. |
Definition at line 54 of file auth.hpp.
The documentation for this class was generated from the following file: