10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
LicenseTokenParser.h
1#ifndef TENDUKE_EE_LICENSING_IMPL_DEFAULTLICENSETOKENPARSER_H
2#define TENDUKE_EE_LICENSING_IMPL_DEFAULTLICENSETOKENPARSER_H
3
4#include "Lease.h"
5#include "LicensingError.h"
6#include "json/JSONParser.h"
7#include "jwt/JWTParser.h"
8#include <memory>
9#include <set>
10#include <string>
11#include <utility>
12
13namespace tenduke { namespace ee { namespace licensing { namespace impl {
14
54
59{
60public:
65 explicit LicenseTokenParser(const std::shared_ptr<const tenduke::jwt::JWTParser> &parseJwt);
66
67public:
73 virtual LeaseOrError from(const std::string &licenseToken) const;
74
75protected:
82 virtual bool isLicensedItemName(
83 const std::string &claimName,
84 const std::string &claimValue
85 ) const;
86
87private:
88 const std::shared_ptr<const tenduke::jwt::JWTParser> parseJWT;
89
90 static std::set<std::string> wellknownClaimNames;
91};
92
93}}}}
94
95#endif //TENDUKE_EE_LICENSING_IMPL_DEFAULTLICENSETOKENPARSER_H
Describes checked out licensed item.
Definition Lease.h:21
Describes an error returned from the API.
Definition LicensingError.h:18
Describes whether given token is a lease or an error.
Definition LicenseTokenParser.h:22
LeaseOrError(tenduke::ee::licensing::Lease lease, tenduke::ee::licensing::LicensingError error, bool isError)
Constructs new instance.
Definition LicenseTokenParser.h:30
bool isError
If true, this is an error.
Definition LicenseTokenParser.h:50
bool isLease() const
If true, this is a lease.
Definition LicenseTokenParser.h:52
tenduke::ee::licensing::Lease lease
Lease?
Definition LicenseTokenParser.h:45
tenduke::ee::licensing::LicensingError error
Or an error?
Definition LicenseTokenParser.h:47
LeaseOrError()
No-arg constructs new instance.
Definition LicenseTokenParser.h:40
Parses license token into tenduke::ee::licensing::Lease (or into tenduke::ee::licensing::LicensingErr...
Definition LicenseTokenParser.h:59
virtual LeaseOrError from(const std::string &licenseToken) const
Parses the token.
Definition LicenseTokenParser.cpp:68
virtual bool isLicensedItemName(const std::string &claimName, const std::string &claimValue) const
Checks if given value is a licensed item name.
Definition LicenseTokenParser.cpp:211
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4