1#ifndef TENDUKE_SE_STATEFULAPIREQUEST_H
2#define TENDUKE_SE_STATEFULAPIREQUEST_H
4#include "./APIRequest.h"
5#include "http/Unauthorized.h"
7#include "oidc/session/OIDCSession.h"
11namespace tenduke {
namespace se {
36 const std::shared_ptr<::tenduke::oidc::OIDCSession> &oidc
46 if (oidc ==
nullptr) {
53 oidc->ensureValidSession();
72 ::tenduke::log::info(
"StatefulAPIRequest::execute() ... OIDC session re-established. Re-executing original request ...");
82 const std::shared_ptr<::tenduke::se::APIRequest<R>> request;
83 const std::shared_ptr<::tenduke::oidc::OIDCSession> oidc;
Interface for 10Duke Scale API-requests.
Definition APIRequest.h:12
A tenduke::se::APIRequest, which uses tenduke::oidc::OIDCSession to maintain request authorization.
Definition StatefulAPIRequest.h:27
StatefulAPIRequest(const std::shared_ptr<::tenduke::se::APIRequest< R > > &request, const std::shared_ptr<::tenduke::oidc::OIDCSession > &oidc)
Constructs new instance.
Definition StatefulAPIRequest.h:34
R execute() override
Execute the request synchronously.
Definition StatefulAPIRequest.h:42
Thrown when 10Duke Scale backend responds with HTTP 401.
Definition Unauthorized.h:12
void debug(const char *message)
Write message to global logger at DEBUG-level.
Definition log.cpp:15
void warning(const char *message)
Write message to global logger at WARNING-level.
Definition log.cpp:55
void info(const char *message)
Write message to global logger at INFO-level.
Definition log.cpp:35
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7