10Duke Scale C++ Client
All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
DeserializeStateFromJSON.h
1#ifndef TENDUKE_SE_DESERIALIZESTATEFROMJSON_H
2#define TENDUKE_SE_DESERIALIZESTATEFROMJSON_H
3
4#include "./ClientState.h"
5#include "../licensing/api/MutableLeases.h"
6#include "crypto/KeyFactory.h"
7#include "json/JSONArray.h"
8#include "json/JSONParser.h"
9#include "jwk/JWKS.h"
10#include "jwt/JWTParserFactory.h"
11#include "oauth/OAuthConfiguration.h"
12#include "oidc/OIDCConfiguration.h"
13#include "oidc/OIDCState.h"
14
15#include <memory>
16
17namespace tenduke { namespace se {
18
23{
24public:
32 const std::shared_ptr<const ::tenduke::jwt::JWTParserFactory> &newJwtParser,
33 const std::shared_ptr<const ::tenduke::json::JSONParser> &parseJson,
34 const std::shared_ptr<const ::tenduke::crypto::KeyFactory> &parsePublicKey
35 );
36
37public:
43 ::tenduke::se::ClientState from(const std::string &stateSerializedAsJSON) const;
44
45protected:
51 std::shared_ptr<::tenduke::jwk::JWKS> deserializeLicenseTokenValidationKeys(const ::tenduke::json::JSONObject * keys) const;
52
59 std::shared_ptr<::tenduke::se::licensing::MutableLeases> deserializeLeases(
60 const ::tenduke::json::JSONArray * leases,
61 const std::shared_ptr<::tenduke::jwk::JWKS>& jwks
62 ) const;
63
69 std::shared_ptr<::tenduke::oidc::OIDCConfiguration> deserializeOIDCConfiguration(const ::tenduke::json::JSONObject *oidcCfg) const;
70
77 std::shared_ptr<::tenduke::oidc::OIDCState> deserializeOIDCState(
78 const ::tenduke::json::JSONObject *oidcSession,
79 const std::shared_ptr<const ::tenduke::oidc::OIDCConfiguration>& oidcConfiguration
80 ) const;
81
87 std::shared_ptr<::tenduke::oauth::OAuthConfiguration> deserializeOAuthConfiguration(const ::tenduke::json::JSONObject *oauthCfg) const;
88
89private:
90 const std::shared_ptr<const ::tenduke::jwt::JWTParserFactory> newJWTParser;
91 const std::shared_ptr<const ::tenduke::json::JSONParser> parseJSON;
92 const std::shared_ptr<const ::tenduke::crypto::KeyFactory> parsePublicKey;
93};
94
95}}
96
97#endif //TENDUKE_SE_DESERIALIZESTATEFROMJSON_H
Service for deserializing client state from JSON.
Definition DeserializeStateFromJSON.h:23
std::shared_ptr<::tenduke::oauth::OAuthConfiguration > deserializeOAuthConfiguration(const ::tenduke::json::JSONObject *oauthCfg) const
Deserializes OAuth-configruration.
Definition DeserializeStateFromJSON.cpp:192
std::shared_ptr<::tenduke::jwk::JWKS > deserializeLicenseTokenValidationKeys(const ::tenduke::json::JSONObject *keys) const
Deserializes license token validation keys.
Definition DeserializeStateFromJSON.cpp:95
std::shared_ptr<::tenduke::oidc::OIDCState > deserializeOIDCState(const ::tenduke::json::JSONObject *oidcSession, const std::shared_ptr< const ::tenduke::oidc::OIDCConfiguration > &oidcConfiguration) const
Deserializes OIDC state.
Definition DeserializeStateFromJSON.cpp:157
std::shared_ptr<::tenduke::se::licensing::MutableLeases > deserializeLeases(const ::tenduke::json::JSONArray *leases, const std::shared_ptr<::tenduke::jwk::JWKS > &jwks) const
Deserializes leases.
Definition DeserializeStateFromJSON.cpp:114
DeserializeStateFromJSON(const std::shared_ptr< const ::tenduke::jwt::JWTParserFactory > &newJwtParser, const std::shared_ptr< const ::tenduke::json::JSONParser > &parseJson, const std::shared_ptr< const ::tenduke::crypto::KeyFactory > &parsePublicKey)
Constructs new instance.
Definition DeserializeStateFromJSON.cpp:210
::tenduke::se::ClientState from(const std::string &stateSerializedAsJSON) const
Deserializes the state from JSON.
Definition DeserializeStateFromJSON.cpp:45
std::shared_ptr<::tenduke::oidc::OIDCConfiguration > deserializeOIDCConfiguration(const ::tenduke::json::JSONObject *oidcCfg) const
Deserializes OIDC configuration.
Definition DeserializeStateFromJSON.cpp:143
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7
Container for client state.
Definition ClientState.h:18