10Duke Scale C++ Client
Loading...
Searching...
No Matches
FakeJWKSParser.h
1#ifndef TENDUKE_TEST_MOCKS_JWKSPARSERFAKE_H
2#define TENDUKE_TEST_MOCKS_JWKSPARSERFAKE_H
3
4#include "jwk/JWKSParser.h"
5
6namespace tenduke { namespace test { namespace mocks {
7
9{
10public:
11 FakeJWKSParser() : JWKSParser(nullptr, nullptr) {}
12
13 std::unique_ptr<tenduke::jwk::JWKS> from(const std::string &jwksDocument)
14 const override
15 {
16 std::unique_ptr<tenduke::jwk::JWKS> jwks(new tenduke::jwk::JWKS());
17 if (returnValue != nullptr) {
18 jwks->merge(*returnValue);
19 }
20 return jwks;
21 }
22
23 std::shared_ptr<tenduke::jwk::JWKS> returnValue;
24
25 static std::shared_ptr<FakeJWKSParser> createShared()
26 {
27 return std::make_shared<FakeJWKSParser>();
28 }
29};
30
31}}}
32
33#endif //TENDUKE_TEST_MOCKS_JWKSPARSERFAKE_H
Parses JSON Web Key Set (JWKS)-document.
Definition JWKSParser.h:20
JWKSParser(const std::shared_ptr< const tenduke::json::JSONParser > &jsonParser, const std::shared_ptr< const tenduke::jwk::JWKParser > &jwkParser)
Constructs new instance.
Definition JWKSParser.cpp:10
JSON Web Key Set, a container for one or more tenduke::jwk::JWKs, indexed by the JWK key ID.
Definition JWKS.h:17
Definition FakeJWKSParser.h:9
std::unique_ptr< tenduke::jwk::JWKS > from(const std::string &jwksDocument) const override
Parses JWKS-document and returns the keys as a list.
Definition FakeJWKSParser.h:13
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7