MCPcopy Create free account
hub / github.com/apple/foundationdb / toStringRef

Method toStringRef

fdbrpc/TokenSign.cpp:229–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229StringRef TokenRef::toStringRef(Arena& arena) {
230 auto buf = fmt::memory_buffer();
231 fmt::format_to(std::back_inserter(buf), "alg={} kid={}", getAlgorithmName(algorithm), keyId.toStringView());
232 appendField(buf, "iss", issuer);
233 appendField(buf, "sub", subject);
234 appendField(buf, "aud", audience);
235 appendField(buf, "iat", issuedAtUnixTime);
236 appendField(buf, "exp", expiresAtUnixTime);
237 appendField(buf, "nbf", notBeforeUnixTime);
238 appendField(buf, "jti", tokenId);
239 appendField(buf, "tenants", tenants);
240 auto str = new (arena) uint8_t[buf.size()];
241 memcpy(str, buf.data(), buf.size());
242 return StringRef(str, buf.size());
243}
244
245template <class FieldType, class Writer>
246void putField(Optional<FieldType> const& field, Writer& wr, const char* fieldName) {

Callers 10

sendLocalFunction · 0.45
signTokenFunction · 0.45
TokenSign.cppFile · 0.45
applyChangesMethod · 0.45
encryptMethod · 0.45
decryptMethod · 0.45
encryptMethod · 0.45
decryptMethod · 0.45

Calls 8

getAlgorithmNameFunction · 0.85
appendFieldFunction · 0.85
memcpyFunction · 0.85
toStringViewMethod · 0.80
format_toFunction · 0.50
StringRefClass · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected