Add keycache load, metadata, and delete APIs #194
Merged
+514
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds three keycache management APIs addressing gaps in the current API surface:
API Additions
keycache_load_jwks(): Retrieves JWKS from cache, triggering refresh only if pastnext_updatetime. Fills gap betweenkeycache_get_cached_jwks()(never refreshes) andkeycache_refresh_jwks()(always refreshes).keycache_get_jwks_metadata(): Returns cache entry metadata as JSON:{ "expires": 1765830626, "next_update": 1765485626, "extra": {} }The
extrafield allows future extensibility without breaking the API.keycache_delete_jwks(): Removes cache entry. Idempotent - succeeds even if entry doesn't exist.Implementation Notes
scitokens_cache.cppfollow existing patternsremove_issuer_entry)4 * 3600replaced with named constantDEFAULT_NEXT_UPDATE_OFFSET_SExample Usage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
demo.scitokens.org./test/scitokens-gtest ./test/scitokens-gtest --gtest_filter=KeycacheTest.LoadJwksTest:KeycacheTest.GetMetadataTest:KeycacheTest.DeleteJwksTest:KeycacheTest.DeleteJwksNonExistentTest:KeycacheTest.GetMetadataMissingTest:KeycacheTest.LoadJwksMissingTest(dns block)./test/scitokens-gtest ./test/scitokens-gtest --gtest_filter=KeycacheTest.* CMakeFiles/scitokens-gtest.dir/main.cpp.o /tmp/ccAOLmHV.s conf�� lude --local /usr/bin/git credential.helpeas(dns block)./test/scitokens-gtest ./test/scitokens-gtest ev/null || true;-I t.cpp.o me/REDACTED/work/s-I conf�� E cmake_depends "Unix Makefiles" /home/REDACTED/work/scitokens-cpp/scitokens-cpp /home/REDACTED/work/scitokens-cpp/scitokens-cpp /home/REDACTED/work/scitokens-cpp/scitokens-cpp/buil --local /home/REDACTED/.do-o user.name(dns block)esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https -dumpbase CMakeCXXCompilerId.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection(dns block)invalid-issuer-negative-cache-1765484953.example.com./test/scitokens-gtest ./test/scitokens-gtest --gtest_filter=KeycacheTest.* CMakeFiles/scitokens-gtest.dir/main.cpp.o /tmp/ccAOLmHV.s conf�� lude --local /usr/bin/git credential.helpeas(dns block)invalid-issuer-negative-cache-1765484964.example.com./test/scitokens-gtest ./test/scitokens-gtest ev/null || true;-I t.cpp.o me/REDACTED/work/s-I conf�� E cmake_depends "Unix Makefiles" /home/REDACTED/work/scitokens-cpp/scitokens-cpp /home/REDACTED/work/scitokens-cpp/scitokens-cpp /home/REDACTED/work/scitokens-cpp/scitokens-cpp/buil --local /home/REDACTED/.do-o user.name(dns block)invalid-issuer-negative-cache-1765485277.example.com./test/scitokens-gtest ./test/scitokens-gtest --gtest_filter=KeycacheTest.*(dns block)invalid-issuer-negative-cache-1765485335.example.com./test/scitokens-gtest ./test/scitokens-gtest c/verify.cpp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.