Obtains and caches a Toss access token with blocking requests; thread-safe.
More...
#include <algotradelib/src/brokers/tossinvest/auth.hpp>
|
| | TossAuth (net::io_context &ioc, ssl::context &ctx, const TossConfig &config) |
| | Constructs the wrapper.
|
|
virtual | ~TossAuth ()=default |
| | Destroys the wrapper.
|
| std::string | accessToken () |
| | Returns an access token, requesting a new one if none is held or it expires within five minutes.
|
Obtains and caches a Toss access token with blocking requests; thread-safe.
TossClient manages its own token; this is for code that calls Toss directly.
Definition at line 18 of file auth.hpp.
◆ TossAuth()
| algotradelib::tossinvest::TossAuth::TossAuth |
( |
net::io_context & | ioc, |
|
|
ssl::context & | ctx, |
|
|
const TossConfig & | 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 26 of file auth.hpp.
◆ accessToken()
| std::string algotradelib::tossinvest::TossAuth::accessToken |
( |
| ) |
|
|
inline |
Returns an 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 39 of file auth.hpp.
The documentation for this class was generated from the following file:
- algotradelib/src/brokers/tossinvest/auth.hpp