10Duke Scale C++ Client
Loading...
Searching...
No Matches
JWKSDownloader.h
1#ifndef TENDUKE_JWK_JWKSDOWNLOADER_H
2#define TENDUKE_JWK_JWKSDOWNLOADER_H
3
4#include "http/HTTPClient.h"
5#include "http/HTTPResponseToException.h"
6#include "jwk/JWKS.h"
7#include "jwk/JWKSParser.h"
8#include <memory>
9#include <string>
10
11namespace tenduke { namespace jwk {
12
17{
18public:
19 virtual ~JWKSDownloader() = default;
20
28 const std::shared_ptr<const tenduke::http::HTTPClient> &http,
29 const std::shared_ptr<const tenduke::jwk::JWKSParser> &parseJwks,
30 const std::shared_ptr<const tenduke::http::HTTPResponseToException> &throwException
31 );
32
39 virtual std::unique_ptr<tenduke::jwk::JWKS> from(const std::string &url) const;
40
41protected:
47 virtual std::string download(const std::string &url) const;
48
49private:
50 const std::shared_ptr<const tenduke::http::HTTPClient> http;
51 const std::shared_ptr<const tenduke::jwk::JWKSParser> parseJWKS;
52 const std::shared_ptr<const tenduke::http::HTTPResponseToException> throwException;
53};
54
55}}
56
57#endif //TENDUKE_JWK_JWKSDOWNLOADER_H
Service to download and parse JSON Web Key Set (JWKS).
Definition JWKSDownloader.h:17
virtual std::string download(const std::string &url) const
Downloads content of given URL and returns the payload as string.
Definition JWKSDownloader.cpp:12
virtual std::unique_ptr< tenduke::jwk::JWKS > from(const std::string &url) const
Downloads and parses the JWKS-document.
Definition JWKSDownloader.cpp:6
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7