Skip to content

Commit 782d860

Browse files
authored
Merge pull request #35 from duncanmmacleod/jwt-cpp-0.4.0
Update to jwt-cpp-0.4.0
2 parents 6870564 + d75cc61 commit 782d860

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/scitokens.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int scitoken_set_claim_string(SciToken token, const char *key, const char *value
5656
return -1;
5757
}
5858
try {
59-
real_token->set_claim(key, std::string(value));
59+
real_token->set_claim(key, jwt::claim(std::string(value)));
6060
} catch (std::exception &exc) {
6161
if (err_msg) {
6262
*err_msg = strdup(exc.what());

src/scitokens_cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#ifndef PICOJSON_USE_INT64
1212
#define PICOJSON_USE_INT64
1313
#endif
14-
#include <jwt-cpp/picojson.h>
14+
#include <picojson/picojson.h>
1515
#include <sqlite3.h>
1616

1717
#include "scitokens_internal.h"

src/scitokens_internal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <curl/curl.h>
66
#include <jwt-cpp/base.h>
77
#include <jwt-cpp/jwt.h>
8-
#include <jwt-cpp/picojson.h>
8+
#include <picojson/picojson.h>
99
#include <openssl/bn.h>
1010
#include <openssl/ec.h>
1111

src/scitokens_internal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,19 @@ friend class scitokens::Validator;
203203
uuid_generate(uuid);
204204
char uuid_str[37];
205205
uuid_unparse_lower(uuid, uuid_str);
206-
m_claims["jti"] = std::string(uuid_str);
206+
m_claims["jti"] = jwt::claim(std::string(uuid_str));
207207

208208
if (m_serialize_profile == Profile::SCITOKENS_2_0) {
209-
m_claims["ver"] = std::string("scitokens:2.0");
209+
m_claims["ver"] = jwt::claim(std::string("scitokens:2.0"));
210210
auto iter = m_claims.find("aud");
211211
if (iter == m_claims.end()) {
212-
m_claims["aud"] = std::string("ANY");
212+
m_claims["aud"] = jwt::claim(std::string("ANY"));
213213
}
214214
} else if (m_serialize_profile == Profile::WLCG_1_0) {
215-
m_claims["wlcg.ver"] = std::string("1.0");
215+
m_claims["wlcg.ver"] = jwt::claim(std::string("1.0"));
216216
auto iter = m_claims.find("aud");
217217
if (iter == m_claims.end()) {
218-
m_claims["aud"] = std::string("https://wlcg.cern.ch/jwt/v1/any");
218+
m_claims["aud"] = jwt::claim(std::string("https://wlcg.cern.ch/jwt/v1/any"));
219219
}
220220
}
221221

0 commit comments

Comments
 (0)