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

Method applyPublicKeySet

fdbrpc/FlowTransport.actor.cpp:1536–1555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1534}
1535
1536void TransportData::applyPublicKeySet(StringRef jwkSetString) {
1537 auto jwks = JsonWebKeySet::parse(jwkSetString, {});
1538 if (!jwks.present())
1539 throw pkey_decode_error();
1540 const auto& keySet = jwks.get().keys;
1541 publicKeys.clear();
1542 int numPrivateKeys = 0;
1543 for (auto [keyName, key] : keySet) {
1544 // ignore private keys
1545 if (key.isPublic()) {
1546 publicKeys[keyName] = key.getPublic();
1547 } else {
1548 numPrivateKeys++;
1549 }
1550 }
1551 TraceEvent(SevInfo, "AuthzPublicKeySetApply").detail("NumPublicKeys", publicKeys.size());
1552 if (numPrivateKeys > 0) {
1553 TraceEvent(SevWarnAlways, "AuthzPublicKeySetContainsPrivateKeys").detail("NumPrivateKeys", numPrivateKeys);
1554 }
1555}
1556
1557ACTOR static Future<Void> multiVersionCleanupWorker(TransportData* self) {
1558 loop {

Callers 2

loadPublicKeyFileMethod · 0.80

Calls 9

TraceEventClass · 0.85
getPublicMethod · 0.80
detailMethod · 0.80
getMethod · 0.65
clearMethod · 0.65
parseFunction · 0.50
presentMethod · 0.45
isPublicMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected