Declare C++17 in CMake and implement scitokens-verify --profile - #225
Open
djw8605 wants to merge 2 commits into
Open
Declare C++17 in CMake and implement scitokens-verify --profile#225djw8605 wants to merge 2 commits into
djw8605 wants to merge 2 commits into
Conversation
The build declared cxx_std_11, but the sources use C++17 features: structured bindings in scitokens_internal.cpp (json_to_claim_map) and std::make_unique (C++14) in the background refresh manager. The project only compiled because modern compilers default to gnu++17; on a toolchain where the compile feature actually pins -std=c++11 the build fails. Declare cxx_std_17 to match reality. scitokens-verify parsed a --profile option and documented it as 'Profile to enforce', but never used the value. Wire it up through scitoken_set_deserialize_profile / scitoken_deserialize_v2 so the tool actually restricts the accepted token profile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two small correctness cleanups:
CMake declares C++11, the code is C++17
target_compile_features(SciTokens PUBLIC cxx_std_11)— but the sources use structured bindings (json_to_claim_mapinscitokens_internal.cpp, C++17) andstd::make_unique(C++14). The project only compiles because modern compilers default tognu++17; on a toolchain where the compile feature actually pins-std=c++11, the build fails. Declarecxx_std_17to match reality (CMake minimum here is 3.10, which supports it).scitokens-verify --profilewas parsed but ignoredThe tool documents
-p | --profile Profile to enforce (wlcg, scitokens1, scitokens2, atjwt)and stores the value — then never uses it: every token was accepted under COMPAT rules regardless. Wire it up viascitoken_set_deserialize_profile+scitoken_deserialize_v2, with an error for unknown profile names.Testing
make(library, CLI tools, tests) andctestunit/env_config/monitoring suites pass.scitokens-verify -p bogusnow reportsunknown token profile; valid profile names flow through deserialization.🤖 Generated with Claude Code