10Duke Scale C++ Client
Loading...
Searching...
No Matches
Lease.h
1#ifndef TENDUKE_SE_LICENSING_LICENSECHECKOUTRESPONSEITEM_H
2#define TENDUKE_SE_LICENSING_LICENSECHECKOUTRESPONSEITEM_H
3
4#include <cstdint>
5#include <map>
6#include <string>
7#include <vector>
8
9namespace tenduke { namespace se { namespace licensing {
10
16class Lease
17{
18public:
22 Lease();
23
52 Lease(std::string id
53 , std::int64_t expiresEpochS
54 , std::int64_t issuedAtEpochS
55 , std::int64_t timeOfEventEpochS
56 , std::string status
57 , std::string leaseId
58 , std::string oldLeaseId
59 , std::int64_t heartbeatNotBeforeEpochS
60 , std::string productName
61 , std::string productConfigurationName
62 , std::string licenseId
63 , std::string type
64 , int64_t preallocatedQuantity
65 , int64_t verifiedQuantity
66 , std::string quantityDimension
67 , const std::vector<std::string> &features
68 , std::string licenseConsumerId
69 , std::string licenseConsumerEmail
72 , const std::map<std::string, std::string> &clientClaims
73 , std::string token
74 , std::string licenseKey
75 , bool metered
76 , std::string keyId
77 );
78
79public:
84 bool neverExpires() const;
85
87 static const std::int64_t NEVER_EXPIRES_EPOCH_S_MAGIC = INT64_MIN;
88
89public:
90 // Standard + additional JWT claims
91
93 const std::string id;
95 const std::int64_t expiresEpochS;
97 const std::int64_t issuedAtEpochS;
99 const std::int64_t timeOfEventEpochS;
100
101 // 10Duke specific JWT claims
103 const std::string status;
105 const std::string leaseId;
107 const std::string oldLeaseId;
109 const std::int64_t heartbeatNotBeforeEpochS;
111 const std::string productName;
113 const std::string productConfigurationName;
115 const std::string licenseId;
117 const std::string type;
119 const std::int64_t preallocatedQuantity;
121 const std::int64_t verifiedQuantity;
123 const std::string quantityDimension;
125 const std::vector<std::string> features;
127 const std::string licenseConsumerId;
129 const std::string licenseConsumerEmail;
135 const std::map<std::string, std::string> clientClaims;
136
137 // Additional fields describing the lease
138
140 const std::string token;
142 const std::string licenseKey;
144 const bool metered;
146 const std::string keyId;
147
148};
149
150}}}
151
152#endif //TENDUKE_SE_LICENSING_LICENSECHECKOUTRESPONSEITEM_H
Lease of a license.
Definition Lease.h:17
Lease()
No-arg constructs new instance.
Definition Lease.cpp:14
bool neverExpires() const
Returns true if the lease never expires.
Definition Lease.cpp:7
const std::string licenseConsumerId
“licenseConsumerId” Identifier of the license consumer that checked out the licenses.
Definition Lease.h:127
const std::map< std::string, std::string > clientClaims
“clientClaims” A map echoing back the claims used by the client application to checkout the license.
Definition Lease.h:135
const std::string leaseId
"leaseId" Unique identifier of the current license checkout.
Definition Lease.h:105
const std::string licenseConsumerExternalReference
“licenseConsumerExternalReference” External reference identifier of the license consumer that checked...
Definition Lease.h:131
const std::string licenseConsumerEmail
“licenseConsumerEmail” Email of the license consumer that checked out the licenses.
Definition Lease.h:129
const std::string status
"status" Status flag: “success” or “error” indicating if the checkout succeeded or failed
Definition Lease.h:103
const std::string oldLeaseId
"oldLeaseId" Heartbeats generate new lease id.
Definition Lease.h:107
const std::int64_t issuedAtEpochS
“iat” Issued At: marks the time the License Token was issued.
Definition Lease.h:97
const std::string productConfigurationName
"productConfigurationName" Name of the product configuration used to create the license.
Definition Lease.h:113
const std::string keyId
JWT validation key id (claim "jki" from the JWT header).
Definition Lease.h:146
const std::string quantityDimension
“qtyDimension” Describes the quantity dimension of the licenses.
Definition Lease.h:123
const std::int64_t verifiedQuantity
“qtyVerified” Quantity that has been verified to be used.
Definition Lease.h:121
const std::string id
"jti" JWT ID: unique id of the license token, you may use this in the client application to prevent t...
Definition Lease.h:93
const std::string licenseConsumerConnectedIdentityId
“licenseConsumerConnectedIdentityId” Connected identity id of the license consumer that checked out t...
Definition Lease.h:133
const std::vector< std::string > features
“features” An array specifying what features the license enables.
Definition Lease.h:125
const std::int64_t timeOfEventEpochS
"toe” Time of Event: the checkout / last heartbeat timestamp recorded for the license checkout
Definition Lease.h:99
const std::string licenseId
Id of the license.
Definition Lease.h:115
const std::string token
Full token text from which this lease was parsed.
Definition Lease.h:140
const std::int64_t preallocatedQuantity
“qtyPrealloc” Quantity that was preallocated at time of checkout, applicable for use count and use ti...
Definition Lease.h:119
const std::int64_t heartbeatNotBeforeEpochS
"hbnbf" Heartbeat not before: the earliest allowed time when a checkout can be heartbeat.
Definition Lease.h:109
const std::string licenseKey
License key used to checkout this lease.
Definition Lease.h:142
static const std::int64_t NEVER_EXPIRES_EPOCH_S_MAGIC
Magic value for "expiresEpochS" which indicates that the lease never expires.
Definition Lease.h:87
const std::string type
"type" License type: DYNAMIC_PRODUCT or PRECONFIGURED_PRODUCT.
Definition Lease.h:117
const std::int64_t expiresEpochS
“exp” Expiration Time: marks the expiration time of the License and License Token as epoch seconds
Definition Lease.h:95
const std::string productName
"productName" Name of the product that the license allows to use.
Definition Lease.h:111
const bool metered
Was this lease checked out as metered?.
Definition Lease.h:144
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7