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

Function makeRandomTokenSpec

fdbrpc/TokenSign.cpp:194–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194TokenRef makeRandomTokenSpec(Arena& arena, IRandom& rng) {
195 auto token = TokenRef{};
196 token.expiresAt = timer_monotonic() * (0.5 + rng.random01());
197 const auto numTenants = rng.randomInt(1, 3);
198 for (auto i = 0; i < numTenants; i++) {
199 token.tenants.push_back(arena, genRandomAlphanumStringRef(arena, rng, MinTenantNameLen, MaxTenantNameLenPlus1));
200 }
201 return token;
202}
203
204} // namespace authz::flatbuffers
205

Callers 2

TokenSign.cppFile · 0.85

Calls 7

timer_monotonicFunction · 0.85
random01Method · 0.80
getMethod · 0.65
randomIntMethod · 0.45
push_backMethod · 0.45
timerMethod · 0.45

Tested by

no test coverage detected