Skip to content

Implement OAuth JWT bearer assertions (RFC 7521, RFC 7523)#2643

Merged
jviotti merged 3 commits into
mainfrom
oauth-assertions
Jul 21, 2026
Merged

Implement OAuth JWT bearer assertions (RFC 7521, RFC 7523)#2643
jviotti merged 3 commits into
mainfrom
oauth-assertions

Conversation

@jviotti

@jviotti jviotti commented Jul 21, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

jviotti added 2 commits July 20, 2026 21:55
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Details
Benchmark suite Current: 601c97c Previous: 0ec882d Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.627416083418813 ns/iter 2.452098707674927 ns/iter 1.07
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.4807018963249963 ns/iter 2.3973479577719465 ns/iter 1.03
Regex_Period_Asterisk 2.6974898164160255 ns/iter 2.17087438680407 ns/iter 1.24
Regex_Group_Period_Asterisk_Group 2.200243312397596 ns/iter 2.203029329184512 ns/iter 1.00
Regex_Period_Plus 2.941839380960397 ns/iter 2.8283360011261194 ns/iter 1.04
Regex_Period 3.0915795415755913 ns/iter 2.4365562546208164 ns/iter 1.27
Regex_Caret_Period_Plus_Dollar 2.911031041795306 ns/iter 2.616862305940616 ns/iter 1.11
Regex_Caret_Group_Period_Plus_Group_Dollar 2.870269889352017 ns/iter 2.5013912949519317 ns/iter 1.15
Regex_Caret_Period_Asterisk_Dollar 2.2428038075079564 ns/iter 2.2287821303302557 ns/iter 1.01
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.3841061541730517 ns/iter 2.857060502742832 ns/iter 0.83
Regex_Caret_X_Hyphen 9.524115461718674 ns/iter 8.50317712657623 ns/iter 1.12
Regex_Period_Md_Dollar 29.960258830211036 ns/iter 29.882025855344914 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 6.429679157840018 ns/iter 8.90657902623821 ns/iter 0.72
Regex_Caret_Period_Range_Dollar 3.3145902843979234 ns/iter 3.0187107086047957 ns/iter 1.10
Regex_Nested_Backtrack 39.717543830036036 ns/iter 39.1242026955946 ns/iter 1.02
JSON_Array_Of_Objects_Unique 560.9161390233419 ns/iter 532.1181250000109 ns/iter 1.05
JSON_Parse_1 12633.230308281109 ns/iter 11443.00356236618 ns/iter 1.10
JSON_Parse_Real 10560.748119704493 ns/iter 11019.727670464503 ns/iter 0.96
JSON_Parse_Decimal 10483.172286505187 ns/iter 11135.110089815447 ns/iter 0.94
JSON_Parse_Schema_ISO_Language 5198992.91999991 ns/iter 6373731.924527891 ns/iter 0.82
JSON_Parse_Integer 6457.7243405740555 ns/iter 7054.748811910988 ns/iter 0.92
JSON_Parse_String_NonSSO_Plain 10343.385216416813 ns/iter 14218.255177485027 ns/iter 0.73
JSON_Parse_String_SSO_Plain 4470.2593199701805 ns/iter 4648.641208062409 ns/iter 0.96
JSON_Parse_String_Escape_Heavy 27659.58767118114 ns/iter 31996.227625058073 ns/iter 0.86
JSON_Parse_Object_Short_Keys 10206.74937116318 ns/iter 13316.272809937089 ns/iter 0.77
JSON_Parse_Object_Scalar_Properties 5298.165334796102 ns/iter 7490.763317019893 ns/iter 0.71
JSON_Parse_Object_Array_Properties 7813.507222098339 ns/iter 11566.657484941681 ns/iter 0.68
JSON_Parse_Object_Object_Properties 8157.119766180464 ns/iter 13254.045371788345 ns/iter 0.62
JSON_Parse_Nested_Containers 64961.71663737573 ns/iter 87323.27332834879 ns/iter 0.74
JSON_From_String_Copy 24.023862253810673 ns/iter 34.26630207893668 ns/iter 0.70
JSON_From_String_Temporary 19.171790117042683 ns/iter 23.981771459426234 ns/iter 0.80
JSON_Number_To_Double 45.4957123740959 ns/iter 40.8502745427385 ns/iter 1.11
JSON_Object_At_Last_Key/8 5.011509956297826 ns/iter 6.198596770523864 ns/iter 0.81
JSON_Object_At_Last_Key/32 16.651551527103564 ns/iter 16.57863183046372 ns/iter 1.00
JSON_Object_At_Last_Key/128 78.42542244025329 ns/iter 82.75466548762932 ns/iter 0.95
JSON_Object_At_Last_Key/512 255.68922414662924 ns/iter 278.4554124300852 ns/iter 0.92
JSON_Fast_Hash_Helm_Chart_Lock 64.22118746675943 ns/iter 76.51461142688821 ns/iter 0.84
JSON_Equality_Helm_Chart_Lock 147.12729264972765 ns/iter 204.15186744051508 ns/iter 0.72
JSON_Divisible_By_Decimal 187.673454770932 ns/iter 213.90274659481133 ns/iter 0.88
JSON_String_Equal/10 7.448537419822185 ns/iter 9.700672003512127 ns/iter 0.77
JSON_String_Equal/100 7.163755697504904 ns/iter 9.454233380386942 ns/iter 0.76
JSON_String_Equal_Small_By_Perfect_Hash/10 0.36070224994925515 ns/iter 0.4253188082762014 ns/iter 0.85
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.736600343475172 ns/iter 5.053968268410708 ns/iter 0.74
JSON_String_Fast_Hash/10 2.933841171187331 ns/iter 3.7047377532173824 ns/iter 0.79
JSON_String_Fast_Hash/100 2.2670007828123975 ns/iter 2.9267160466184428 ns/iter 0.77
JSON_String_Key_Hash/10 1.788851988140705 ns/iter 2.268881232370643 ns/iter 0.79
JSON_String_Key_Hash/100 2.4434194368922415 ns/iter 2.7449889199854156 ns/iter 0.89
JSON_Object_Defines_Miss_Same_Length 3.2760904918455758 ns/iter 3.7915241701818627 ns/iter 0.86
JSON_Object_Defines_Miss_Too_Small 3.052840291398287 ns/iter 3.5193679982171004 ns/iter 0.87
JSON_Object_Defines_Miss_Too_Large 2.983605946256597 ns/iter 3.518766561193746 ns/iter 0.85
Pointer_Object_Traverse 29.626916258054358 ns/iter 31.140658695852256 ns/iter 0.95
Pointer_Object_Try_Traverse 25.94391477250847 ns/iter 28.111777817334993 ns/iter 0.92
Pointer_Push_Back_Pointer_To_Weak_Pointer 198.76189834142676 ns/iter 231.21686846529389 ns/iter 0.86
Pointer_Walker_Schema_ISO_Language 3195099.8285714267 ns/iter 3852395.3201972065 ns/iter 0.83
Pointer_Maybe_Tracked_Deeply_Nested/0 1361385.8381501755 ns/iter 1868348.3628509517 ns/iter 0.73
Pointer_Maybe_Tracked_Deeply_Nested/1 1110174.2484176448 ns/iter 1795661.842364438 ns/iter 0.62
Pointer_Position_Tracker_Get_Deeply_Nested 367.84294784891165 ns/iter 544.3490950985023 ns/iter 0.68
JSONPath_Descendant_Filter_Nested 1553.561687071858 ns/iter 2133.4591271428117 ns/iter 0.73
URITemplateRouter_Create 30725.97407392424 ns/iter 36628.14202575957 ns/iter 0.84
URITemplateRouter_Match 172.92033230442038 ns/iter 203.7119682552932 ns/iter 0.85
URITemplateRouter_Match_BasePath 207.05820625707062 ns/iter 246.49196740065904 ns/iter 0.84
URITemplateRouterView_Restore 10915.096753679807 ns/iter 16513.239248720845 ns/iter 0.66
URITemplateRouterView_Match 145.32590689373578 ns/iter 227.2773635179582 ns/iter 0.64
URITemplateRouterView_Match_BasePath 164.2934548919823 ns/iter 206.09525007231622 ns/iter 0.80
URITemplateRouterView_Arguments 582.8178505142208 ns/iter 659.5800720427305 ns/iter 0.88
JSONL_Parse_Large 11284423.269841233 ns/iter 14442544.884614196 ns/iter 0.78
JSONL_Parse_Large_GZIP 12932483.173076348 ns/iter 15654069.767442495 ns/iter 0.83
JSONLD_Catalog_Annotation_List_Populate 958396.8470098589 ns/iter 1136411.9918699374 ns/iter 0.84
JSONLD_Catalog_Materialize 4955237.394736251 ns/iter 7111181.686046927 ns/iter 0.70
HTML_Build_Table_100000 39668335.52631574 ns/iter 57980791.666674726 ns/iter 0.68
HTML_Render_Table_100000 2141884.148648777 ns/iter 2201035.335999677 ns/iter 0.97
GZIP_Compress_ISO_Language_Set_3_Locations 28764267.045455035 ns/iter 33227579.695651755 ns/iter 0.87
GZIP_Decompress_ISO_Language_Set_3_Locations 3635836.3874345673 ns/iter 4359191.770186609 ns/iter 0.83
GZIP_Compress_ISO_Language_Set_3_Schema 2026773.499999933 ns/iter 1984805.232558132 ns/iter 1.02
GZIP_Decompress_ISO_Language_Set_3_Schema 286444.26046110137 ns/iter 324688.44891638006 ns/iter 0.88
JOSE_VerifySignature_RS256 26432.43534826911 ns/iter 29440.21263731632 ns/iter 0.90
JOSE_VerifySignature_ES512 1201103.3743220414 ns/iter 1561763.4332647496 ns/iter 0.77

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Details
Benchmark suite Current: 601c97c Previous: 0ec882d Ratio
JOSE_VerifySignature_RS256 22216.53464014325 ns/iter 22417.22708057893 ns/iter 0.99
JOSE_VerifySignature_ES512 577548.7524751967 ns/iter 575927.2612313157 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Locations 36505757.73683852 ns/iter 36811843.789468855 ns/iter 0.99
GZIP_Decompress_ISO_Language_Set_3_Locations 4234748.163636334 ns/iter 4375953.993788594 ns/iter 0.97
GZIP_Compress_ISO_Language_Set_3_Schema 2038114.8023255682 ns/iter 2034432.2674417777 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 375652.6060118132 ns/iter 376546.7068316843 ns/iter 1.00
HTML_Build_Table_100000 63885023.27273603 ns/iter 64426503.45454901 ns/iter 0.99
HTML_Render_Table_100000 1789640.3350513557 ns/iter 1880975.1490513936 ns/iter 0.95
JSONLD_Catalog_Annotation_List_Populate 1307506.9345795698 ns/iter 1307939.376163985 ns/iter 1.00
JSONLD_Catalog_Materialize 6671578.257143145 ns/iter 6751454.352380886 ns/iter 0.99
JSONL_Parse_Large 13192457.490566446 ns/iter 13475685.730768945 ns/iter 0.98
JSONL_Parse_Large_GZIP 14512323.770832816 ns/iter 14787886.0212765 ns/iter 0.98
URITemplateRouter_Create 30449.79049592237 ns/iter 30495.616611065667 ns/iter 1.00
URITemplateRouter_Match 151.32160564215076 ns/iter 152.6515570022703 ns/iter 0.99
URITemplateRouter_Match_BasePath 175.2462802136641 ns/iter 172.64448949022685 ns/iter 1.02
URITemplateRouterView_Restore 8255.703701118915 ns/iter 8205.922269060247 ns/iter 1.01
URITemplateRouterView_Match 122.22782841679351 ns/iter 123.26958567586178 ns/iter 0.99
URITemplateRouterView_Match_BasePath 143.35303652158447 ns/iter 146.0479160667751 ns/iter 0.98
URITemplateRouterView_Arguments 477.0725760800997 ns/iter 474.8938568582175 ns/iter 1.00
JSONPath_Descendant_Filter_Nested 1664.5979758617773 ns/iter 1726.0913048559487 ns/iter 0.96
Pointer_Object_Traverse 32.426445852470025 ns/iter 32.44391930318466 ns/iter 1.00
Pointer_Object_Try_Traverse 25.795989559332718 ns/iter 25.90630980426934 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 157.14633823641628 ns/iter 163.4108387070245 ns/iter 0.96
Pointer_Walker_Schema_ISO_Language 2710317.065636821 ns/iter 2818619.6784315375 ns/iter 0.96
Pointer_Maybe_Tracked_Deeply_Nested/0 1856142.442048595 ns/iter 1830604.1027026488 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/1 1732592.110565032 ns/iter 1721532.0682924623 ns/iter 1.01
Pointer_Position_Tracker_Get_Deeply_Nested 411.94832875766116 ns/iter 446.57914180374723 ns/iter 0.92
JSON_Array_Of_Objects_Unique 466.9566926605822 ns/iter 459.59296653247765 ns/iter 1.02
JSON_Parse_1 9428.878986777188 ns/iter 9788.68323571856 ns/iter 0.96
JSON_Parse_Real 7922.745656965534 ns/iter 8123.109323342207 ns/iter 0.98
JSON_Parse_Decimal 12937.532582402786 ns/iter 12983.841015573453 ns/iter 1.00
JSON_Parse_Schema_ISO_Language 6629685.254717154 ns/iter 6579179.7102802545 ns/iter 1.01
JSON_Parse_Integer 6496.099202990972 ns/iter 5910.12096203109 ns/iter 1.10
JSON_Parse_String_NonSSO_Plain 11834.537360836974 ns/iter 12083.41919252744 ns/iter 0.98
JSON_Parse_String_SSO_Plain 5253.845662154763 ns/iter 5259.546988801398 ns/iter 1.00
JSON_Parse_String_Escape_Heavy 25557.4813949259 ns/iter 25863.646485531965 ns/iter 0.99
JSON_Parse_Object_Short_Keys 13413.66342446107 ns/iter 13597.391646782888 ns/iter 0.99
JSON_Parse_Object_Scalar_Properties 6851.117814378338 ns/iter 7057.715664109694 ns/iter 0.97
JSON_Parse_Object_Array_Properties 11942.731805928288 ns/iter 11864.227177700643 ns/iter 1.01
JSON_Parse_Object_Object_Properties 11900.236225028211 ns/iter 12015.92221329687 ns/iter 0.99
JSON_Parse_Nested_Containers 98436.2749189321 ns/iter 99860.80929899718 ns/iter 0.99
JSON_From_String_Copy 17.77531082722639 ns/iter 17.81191810688018 ns/iter 1.00
JSON_From_String_Temporary 15.04243292334963 ns/iter 15.37740476167165 ns/iter 0.98
JSON_Number_To_Double 20.65888809069044 ns/iter 20.595337896202974 ns/iter 1.00
JSON_Object_At_Last_Key/8 3.8346618000381616 ns/iter 3.8127588183866004 ns/iter 1.01
JSON_Object_At_Last_Key/32 11.892021702963497 ns/iter 11.87790962510811 ns/iter 1.00
JSON_Object_At_Last_Key/128 48.65269541050568 ns/iter 48.661385888809015 ns/iter 1.00
JSON_Object_At_Last_Key/512 356.39616014555475 ns/iter 360.2484893763341 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 75.14610442591932 ns/iter 75.2116700104861 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 153.07293037859407 ns/iter 149.94332482101774 ns/iter 1.02
JSON_Divisible_By_Decimal 251.5842941953005 ns/iter 250.52122072068286 ns/iter 1.00
JSON_String_Equal/10 5.374829083400475 ns/iter 5.389447450159594 ns/iter 1.00
JSON_String_Equal/100 5.99821200105493 ns/iter 5.996735533909301 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.6234662916385789 ns/iter 0.6235251943312652 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 25.213123690172754 ns/iter 25.2043265736578 ns/iter 1.00
JSON_String_Fast_Hash/10 2.569302562338372 ns/iter 2.569519240178051 ns/iter 1.00
JSON_String_Fast_Hash/100 2.5702282923981437 ns/iter 2.5699112735388265 ns/iter 1.00
JSON_String_Key_Hash/10 1.2531852943894106 ns/iter 1.2462121385471208 ns/iter 1.01
JSON_String_Key_Hash/100 12.448302198846486 ns/iter 12.4436129018893 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.114786643077374 ns/iter 3.1148256439629183 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.1136377157020787 ns/iter 3.136251682800873 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Large 3.1137104151106496 ns/iter 3.111975002012388 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 0.6231646669374469 ns/iter 0.622849700230109 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.6254826735886897 ns/iter 0.6245251095126566 ns/iter 1.00
Regex_Period_Asterisk 0.6234653917679319 ns/iter 0.622739004567369 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 0.6241402680619902 ns/iter 0.6233639855161821 ns/iter 1.00
Regex_Period_Plus 0.6228409732929265 ns/iter 0.622781095834656 ns/iter 1.00
Regex_Period 0.622710691970741 ns/iter 0.6232823829736569 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 0.6227015999069149 ns/iter 0.6269688381557681 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 0.6224801108586142 ns/iter 0.6232108865781099 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 0.6228602406958688 ns/iter 0.6229712381206841 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.6229623048416836 ns/iter 0.6234601766756104 ns/iter 1.00
Regex_Caret_X_Hyphen 3.7399097745351324 ns/iter 3.7380876133139593 ns/iter 1.00
Regex_Period_Md_Dollar 28.092163046157204 ns/iter 31.776935533190926 ns/iter 0.88
Regex_Caret_Slash_Period_Asterisk 4.0455342532928995 ns/iter 4.04830114620512 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 1.2461066109320118 ns/iter 1.2465717542359827 ns/iter 1.00
Regex_Nested_Backtrack 37.77341072030791 ns/iter 40.36805895419614 ns/iter 0.94

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Details
Benchmark suite Current: 601c97c Previous: 0ec882d Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.250170983319458 ns/iter 2.814698532730483 ns/iter 0.44
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.2707714767787424 ns/iter 2.463111462273315 ns/iter 0.52
Regex_Period_Asterisk 1.1642352512603333 ns/iter 2.4628461441609906 ns/iter 0.47
Regex_Group_Period_Asterisk_Group 1.2012806085291492 ns/iter 2.815423320420717 ns/iter 0.43
Regex_Period_Plus 1.330908526487346 ns/iter 4.223759964368633 ns/iter 0.32
Regex_Period 1.3501847444333068 ns/iter 3.869087346717119 ns/iter 0.35
Regex_Caret_Period_Plus_Dollar 1.3344243583966924 ns/iter 3.871826980195968 ns/iter 0.34
Regex_Caret_Group_Period_Plus_Group_Dollar 1.44334546832241 ns/iter 4.223634289914031 ns/iter 0.34
Regex_Caret_Period_Asterisk_Dollar 1.157029987228044 ns/iter 3.1686593845310354 ns/iter 0.37
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.1537974929446677 ns/iter 2.813943318527426 ns/iter 0.41
Regex_Caret_X_Hyphen 2.3448727232720254 ns/iter 7.034776019008429 ns/iter 0.33
Regex_Period_Md_Dollar 16.603959200655137 ns/iter 26.359811399151827 ns/iter 0.63
Regex_Caret_Slash_Period_Asterisk 2.549695262476994 ns/iter 7.722515164134994 ns/iter 0.33
Regex_Caret_Period_Range_Dollar 1.4919885668127422 ns/iter 4.221191105963631 ns/iter 0.35
Regex_Nested_Backtrack 25.186612444435067 ns/iter 38.85575274503716 ns/iter 0.65
JSON_Array_Of_Objects_Unique 267.41434063831537 ns/iter 445.69262146904055 ns/iter 0.60
JSON_Parse_1 3273.738911825833 ns/iter 4815.863116354585 ns/iter 0.68
JSON_Parse_Real 3461.97637803155 ns/iter 5308.697843638849 ns/iter 0.65
JSON_Parse_Decimal 5315.059723322746 ns/iter 7725.637890083315 ns/iter 0.69
JSON_Parse_Schema_ISO_Language 2222566.000000008 ns/iter 3629336.05670127 ns/iter 0.61
JSON_Parse_Integer 2454.8219642645313 ns/iter 3971.4005587003207 ns/iter 0.62
JSON_Parse_String_NonSSO_Plain 3582.3233285015053 ns/iter 5182.022348746463 ns/iter 0.69
JSON_Parse_String_SSO_Plain 1651.3271834786735 ns/iter 2935.637907406785 ns/iter 0.56
JSON_Parse_String_Escape_Heavy 11319.995393857595 ns/iter 15289.628192812028 ns/iter 0.74
JSON_Parse_Object_Short_Keys 4868.091934886201 ns/iter 8246.27974854043 ns/iter 0.59
JSON_Parse_Object_Scalar_Properties 2660.297702559253 ns/iter 4187.557120538392 ns/iter 0.64
JSON_Parse_Object_Array_Properties 3707.945891968956 ns/iter 5697.995309317402 ns/iter 0.65
JSON_Parse_Object_Object_Properties 3532.288334113068 ns/iter 5548.659504393565 ns/iter 0.64
JSON_Parse_Nested_Containers 29761.02889054926 ns/iter 45497.92787397722 ns/iter 0.65
JSON_From_String_Copy 14.508039413766024 ns/iter 22.917974026113374 ns/iter 0.63
JSON_From_String_Temporary 12.434269991961711 ns/iter 20.762598200258722 ns/iter 0.60
JSON_Number_To_Double 16.270350891378712 ns/iter 22.888077289164947 ns/iter 0.71
JSON_Object_At_Last_Key/8 2.7095683523160714 ns/iter 4.225002904535963 ns/iter 0.64
JSON_Object_At_Last_Key/32 9.624862819528476 ns/iter 13.433483822652573 ns/iter 0.72
JSON_Object_At_Last_Key/128 44.071935842956314 ns/iter 56.00938482866521 ns/iter 0.79
JSON_Object_At_Last_Key/512 149.83374484043978 ns/iter 373.5477809331105 ns/iter 0.40
JSON_Fast_Hash_Helm_Chart_Lock 41.753940092846214 ns/iter 74.94698485883688 ns/iter 0.56
JSON_Equality_Helm_Chart_Lock 96.03398734630721 ns/iter 165.9182714506006 ns/iter 0.58
JSON_Divisible_By_Decimal 176.12704561734898 ns/iter 250.4323958251783 ns/iter 0.70
JSON_String_Equal/10 2.266172500375105 ns/iter 5.63062834395773 ns/iter 0.40
JSON_String_Equal/100 3.1534241878751548 ns/iter 6.333953345390674 ns/iter 0.50
JSON_String_Equal_Small_By_Perfect_Hash/10 0.5162063218789104 ns/iter 1.0554095573395428 ns/iter 0.49
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 8.097570846455888 ns/iter 12.441269042544626 ns/iter 0.65
JSON_String_Fast_Hash/10 1.1471065316604405 ns/iter 2.8186193047771626 ns/iter 0.41
JSON_String_Fast_Hash/100 1.1379585099979632 ns/iter 2.8154074436976835 ns/iter 0.40
JSON_String_Key_Hash/10 1.0847880917074497 ns/iter 2.466113072877377 ns/iter 0.44
JSON_String_Key_Hash/100 5.95538605647421 ns/iter 7.735128717552138 ns/iter 0.77
JSON_Object_Defines_Miss_Same_Length 1.5271478678639796 ns/iter 3.87341582075269 ns/iter 0.39
JSON_Object_Defines_Miss_Too_Small 1.531183663039716 ns/iter 3.200175681844704 ns/iter 0.48
JSON_Object_Defines_Miss_Too_Large 1.515347828639956 ns/iter 2.9455528494642533 ns/iter 0.51
Pointer_Object_Traverse 18.11334699386027 ns/iter 33.29702301050479 ns/iter 0.54
Pointer_Object_Try_Traverse 24.87984786694142 ns/iter 36.99758189056203 ns/iter 0.67
Pointer_Push_Back_Pointer_To_Weak_Pointer 148.76955677629067 ns/iter 177.01809733191706 ns/iter 0.84
Pointer_Walker_Schema_ISO_Language 1881343.2058822217 ns/iter 2755129.8210113924 ns/iter 0.68
Pointer_Maybe_Tracked_Deeply_Nested/0 864539.108074524 ns/iter 1295657.342007469 ns/iter 0.67
Pointer_Maybe_Tracked_Deeply_Nested/1 1185830.0521885175 ns/iter 1653716.3708921936 ns/iter 0.72
Pointer_Position_Tracker_Get_Deeply_Nested 519.8827693114613 ns/iter 727.0638692239389 ns/iter 0.72
JSONPath_Descendant_Filter_Nested 1008.0393868536945 ns/iter 1598.7736180474876 ns/iter 0.63
URITemplateRouter_Create 21281.13516056888 ns/iter 31279.914313752808 ns/iter 0.68
URITemplateRouter_Match 157.3760003426879 ns/iter 178.11032208388275 ns/iter 0.88
URITemplateRouter_Match_BasePath 196.9243123910745 ns/iter 213.86363772510938 ns/iter 0.92
URITemplateRouterView_Restore 2649.724310833041 ns/iter 9872.0254221908 ns/iter 0.27
URITemplateRouterView_Match 93.01483193868616 ns/iter 147.5687900969941 ns/iter 0.63
URITemplateRouterView_Match_BasePath 103.93604610548616 ns/iter 168.07401700396068 ns/iter 0.62
URITemplateRouterView_Arguments 337.34203976214826 ns/iter 478.3823772514579 ns/iter 0.71
JSONL_Parse_Large 6539893.284403502 ns/iter 9411829.945945924 ns/iter 0.69
JSONL_Parse_Large_GZIP 7669974.652174005 ns/iter 11114586.142857734 ns/iter 0.69
JSONLD_Catalog_Annotation_List_Populate 893943.8512194689 ns/iter 1269089.179673284 ns/iter 0.70
JSONLD_Catalog_Materialize 2944500.616033824 ns/iter 4328533.4161494505 ns/iter 0.68
HTML_Build_Table_100000 61412506.58332827 ns/iter 71079249.1999996 ns/iter 0.86
HTML_Render_Table_100000 6504886.171717661 ns/iter 4775456.404109713 ns/iter 1.36
GZIP_Compress_ISO_Language_Set_3_Locations 25813975.965516437 ns/iter 36142172.47368407 ns/iter 0.71
GZIP_Decompress_ISO_Language_Set_3_Locations 3317148.435406921 ns/iter 4261605.84756123 ns/iter 0.78
GZIP_Compress_ISO_Language_Set_3_Schema 1430708.1480730101 ns/iter 2137968.492354816 ns/iter 0.67
GZIP_Decompress_ISO_Language_Set_3_Schema 281572.61208576476 ns/iter 276396.9187475068 ns/iter 1.02
JOSE_VerifySignature_RS256 44324.73453804776 ns/iter 63766.74209999215 ns/iter 0.70
JOSE_VerifySignature_ES512 1734710.711111297 ns/iter 2638098.6490567187 ns/iter 0.66

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Details
Benchmark suite Current: 601c97c Previous: 0ec882d Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.0709732142857025 ns/iter 5.3978619999998045 ns/iter 0.94
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 4.96196160714289 ns/iter 5.042711000000963 ns/iter 0.98
Regex_Period_Asterisk 4.974179999999251 ns/iter 5.180434000001242 ns/iter 0.96
Regex_Group_Period_Asterisk_Group 4.9587320000000545 ns/iter 5.048718000000463 ns/iter 0.98
Regex_Period_Plus 4.602977019203083 ns/iter 5.048679999999877 ns/iter 0.91
Regex_Period 4.641781541215234 ns/iter 5.417909999998756 ns/iter 0.86
Regex_Caret_Period_Plus_Dollar 4.637754309070633 ns/iter 5.026257000001806 ns/iter 0.92
Regex_Caret_Group_Period_Plus_Group_Dollar 4.626529697827305 ns/iter 5.358501999999135 ns/iter 0.86
Regex_Caret_Period_Asterisk_Dollar 4.974263999999948 ns/iter 5.377458928569873 ns/iter 0.93
Regex_Caret_Group_Period_Asterisk_Group_Dollar 4.95841817074979 ns/iter 5.03010599999925 ns/iter 0.99
Regex_Caret_X_Hyphen 7.89259374999978 ns/iter 8.489258928572648 ns/iter 0.93
Regex_Period_Md_Dollar 52.753290000009656 ns/iter 44.679865895713576 ns/iter 1.18
Regex_Caret_Slash_Period_Asterisk 7.431013392855996 ns/iter 7.926998883928909 ns/iter 0.94
Regex_Caret_Period_Range_Dollar 5.345754464286756 ns/iter 6.196491071427041 ns/iter 0.86
Regex_Nested_Backtrack 65.67462499999368 ns/iter 59.97022000001379 ns/iter 1.10
JSON_Array_Of_Objects_Unique 773.5093750000033 ns/iter 608.6816964286511 ns/iter 1.27
JSON_Parse_1 9656.841710529265 ns/iter 8910.391471466868 ns/iter 1.08
JSON_Parse_Real 17874.039053917964 ns/iter 16286.462053573456 ns/iter 1.10
JSON_Parse_Decimal 11187.410714285306 ns/iter 11866.931250001046 ns/iter 0.94
JSON_Parse_Schema_ISO_Language 8091882.666667515 ns/iter 7678380.000000592 ns/iter 1.05
JSON_Parse_Integer 5910.8017857149825 ns/iter 6155.6482142849845 ns/iter 0.96
JSON_Parse_String_NonSSO_Plain 7896.242187498562 ns/iter 7835.641741072509 ns/iter 1.01
JSON_Parse_String_SSO_Plain 3720.819962821153 ns/iter 3688.075448063382 ns/iter 1.01
JSON_Parse_String_Escape_Heavy 21572.268750006173 ns/iter 21957.709374994753 ns/iter 0.98
JSON_Parse_Object_Short_Keys 13304.039937322359 ns/iter 13423.023214284869 ns/iter 0.99
JSON_Parse_Object_Scalar_Properties 6824.333705355608 ns/iter 6905.377678571816 ns/iter 0.99
JSON_Parse_Object_Array_Properties 11682.279687502018 ns/iter 11311.028125000177 ns/iter 1.03
JSON_Parse_Object_Object_Properties 11794.24821428451 ns/iter 11580.099999999253 ns/iter 1.02
JSON_Parse_Nested_Containers 81586.65178571921 ns/iter 80392.09821428171 ns/iter 1.01
JSON_From_String_Copy 62.242982142858445 ns/iter 63.97660714286855 ns/iter 0.97
JSON_From_String_Temporary 86.89374999999444 ns/iter 59.30908035714261 ns/iter 1.47
JSON_Number_To_Double 138.8463085336864 ns/iter 121.89971428572984 ns/iter 1.14
JSON_Object_At_Last_Key/8 7.4619352678568465 ns/iter 7.2677533482133425 ns/iter 1.03
JSON_Object_At_Last_Key/32 25.81988076057293 ns/iter 23.53608790696524 ns/iter 1.10
JSON_Object_At_Last_Key/128 93.42481725782554 ns/iter 91.27176339284964 ns/iter 1.02
JSON_Object_At_Last_Key/512 429.06445852384735 ns/iter 424.09925153336115 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 130.55730357141977 ns/iter 104.77798437499074 ns/iter 1.25
JSON_Equality_Helm_Chart_Lock 204.41788149920012 ns/iter 232.38064370751286 ns/iter 0.88
JSON_Divisible_By_Decimal 380.1780928252821 ns/iter 300.1045423990604 ns/iter 1.27
JSON_String_Equal/10 10.266141071428235 ns/iter 10.985703125001578 ns/iter 0.93
JSON_String_Equal/100 11.36713749999834 ns/iter 12.300559374999409 ns/iter 0.92
JSON_String_Equal_Small_By_Perfect_Hash/10 2.1355418749998023 ns/iter 2.55820285714289 ns/iter 0.83
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.907419642852615 ns/iter 14.431692792719014 ns/iter 1.10
JSON_String_Fast_Hash/10 6.416836607144204 ns/iter 6.77509910714288 ns/iter 0.95
JSON_String_Fast_Hash/100 6.380916071429559 ns/iter 6.768700892855353 ns/iter 0.94
JSON_String_Key_Hash/10 4.989314285714792 ns/iter 5.651470000000244 ns/iter 0.88
JSON_String_Key_Hash/100 11.003328124999712 ns/iter 11.995155357141128 ns/iter 0.92
JSON_Object_Defines_Miss_Same_Length 3.8936484375007296 ns/iter 3.875611064508739 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 4.415981381955936 ns/iter 4.189533346343588 ns/iter 1.05
JSON_Object_Defines_Miss_Too_Large 3.8943688616071324 ns/iter 4.058787404371947 ns/iter 0.96
Pointer_Object_Traverse 78.96289062497682 ns/iter 72.90906249998334 ns/iter 1.08
Pointer_Object_Try_Traverse 69.23564732141635 ns/iter 72.02799107144386 ns/iter 0.96
Pointer_Push_Back_Pointer_To_Weak_Pointer 176.88216517853002 ns/iter 185.11221105661105 ns/iter 0.96
Pointer_Walker_Schema_ISO_Language 14140579.999998407 ns/iter 11838951.562499033 ns/iter 1.19
Pointer_Maybe_Tracked_Deeply_Nested/0 2429357.1969701247 ns/iter 2555194.77911592 ns/iter 0.95
Pointer_Maybe_Tracked_Deeply_Nested/1 3708996.089385462 ns/iter 3888358.333333198 ns/iter 0.95
Pointer_Position_Tracker_Get_Deeply_Nested 581.5282366070968 ns/iter 518.5651000001599 ns/iter 1.12
JSONPath_Descendant_Filter_Nested 2594.3453571423042 ns/iter 2434.5357142855 ns/iter 1.07
URITemplateRouter_Create 38601.95532221542 ns/iter 41458.03652141938 ns/iter 0.93
URITemplateRouter_Match 215.57106250000402 ns/iter 235.086469298393 ns/iter 0.92
URITemplateRouter_Match_BasePath 251.509107142819 ns/iter 276.8942499999736 ns/iter 0.91
URITemplateRouterView_Restore 24288.0107142826 ns/iter 37557.300544213256 ns/iter 0.65
URITemplateRouterView_Match 170.21290648746117 ns/iter 186.32336515561005 ns/iter 0.91
URITemplateRouterView_Match_BasePath 195.26080314829068 ns/iter 209.84512009620968 ns/iter 0.93
URITemplateRouterView_Arguments 599.152767857244 ns/iter 557.1093000000928 ns/iter 1.08
JSONL_Parse_Large 32906028.57142793 ns/iter 33668729.99999942 ns/iter 0.98
JSONL_Parse_Large_GZIP 33436938.095238 ns/iter 34665289.99999809 ns/iter 0.96
JSONLD_Catalog_Annotation_List_Populate 2739371.4859439326 ns/iter 2816790.7630513106 ns/iter 0.97
JSONLD_Catalog_Materialize 9891984.374998942 ns/iter 8423165.555553976 ns/iter 1.17
HTML_Build_Table_100000 92529485.71429442 ns/iter 90218299.99998468 ns/iter 1.03
HTML_Render_Table_100000 8204740.0000010375 ns/iter 7203548.888891318 ns/iter 1.14
GZIP_Compress_ISO_Language_Set_3_Locations 37837644.44444337 ns/iter 37190149.99998965 ns/iter 1.02
GZIP_Decompress_ISO_Language_Set_3_Locations 10642740.624998482 ns/iter 9666559.999999056 ns/iter 1.10
GZIP_Compress_ISO_Language_Set_3_Schema 2310682.943143821 ns/iter 2126105.3124995045 ns/iter 1.09
GZIP_Decompress_ISO_Language_Set_3_Schema 587209.0178572518 ns/iter 631171.3169641868 ns/iter 0.93
JOSE_VerifySignature_RS256 23743.529648111333 ns/iter 21836.033079988167 ns/iter 1.09
JOSE_VerifySignature_ES512 1522739.062499921 ns/iter 1544091.5178567749 ns/iter 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti
jviotti marked this pull request as ready for review July 21, 2026 11:58
@augmentcode

augmentcode Bot commented Jul 21, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds first-class support for OAuth 2.0 JWT bearer assertions per RFC 7521 / RFC 7523.

Changes:

  • Introduces new OAuth assertion APIs to build JWT bearer assertions and client authentication assertions.
  • Adds helpers to append RFC 7521/7523 form parameters (`client_assertion_type`, `client_assertion`, `grant_type`, `assertion`, optional `scope`).
  • Implements assertion verification with configurable allowed JWS algorithms, audience/issuer/subject checks, and clock-skew tolerance.
  • Optionally integrates replay detection using a replay store keyed by `jti` plus audience.
  • Exports the new API via the umbrella oauth.h include and wires the new module into the OAuth library CMake target.
  • Adds a comprehensive unit test suite covering building, verification errors, algorithm policies, clock skew handling, and replay detection.

Technical Notes: Verification delegates signature and registered-claim validation to the JOSE JWT verifier and reports failures using a dedicated OAuthAssertionError enum.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

const auto identifier{token.token_id()};
const auto expiration{token.expires_at()};
if (identifier.has_value() && expiration.has_value()) {
const auto remaining{std::chrono::duration_cast<std::chrono::seconds>(

@augmentcode augmentcode Bot Jul 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/core/oauth/oauth_assertion.cc:108-113: The replay window uses options.clock_skew directly, but jwt_check_claims clamps skew to a non-negative bounded range; a negative or extremely large skew could make replay tracking shorter than the acceptance window or overflow now + window in the replay store.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

const auto window{remaining > std::chrono::seconds{0}
? remaining
: std::chrono::seconds{0}};
if (!options.replay_store->check_and_insert(identifier.value(), *match,

@augmentcode augmentcode Bot Jul 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/core/oauth/oauth_assertion.cc:114-115: OAuthDPoPReplayStore::check_and_insert normalizes the target URI (and strips query/fragment), but JWT bearer audiences are specified as Simple String Comparison without normalization; this can make replay scoping differ from the audience-matching semantics and potentially reject distinct audience strings as Replay.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

options.allowed_algorithms = ALLOWED;
EXPECT_FALSE(
sourcemeta::core::oauth_verify_client_assertion(
assertion.value(), AUDIENCES, "", keys.value(), FIXED_TIME, options)

@augmentcode augmentcode Bot Jul 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test/oauth/oauth_assertion_test.cc:141-148: This test calls assertion.value()/keys.value() without first asserting has_value(), so a parse/sign failure can surface as bad_optional_access instead of a clear test assertion failure.

Severity: low

Other Locations
  • test/oauth/oauth_assertion_test.cc:163
  • test/oauth/oauth_assertion_test.cc:183
  • test/oauth/oauth_assertion_test.cc:201
  • test/oauth/oauth_assertion_test.cc:270
  • test/oauth/oauth_assertion_test.cc:288
  • test/oauth/oauth_assertion_test.cc:345

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/core/oauth/include/sourcemeta/core/oauth_assertion.h">

<violation number="1" location="src/core/oauth/include/sourcemeta/core/oauth_assertion.h:166">
P2: Accepted assertions and replay protection use different interpretations of `clock_skew`: negative values can bypass replay detection, while very large values can produce undefined overflow. Normalizing or rejecting the option once and using the same bounded non-negative value for both claim checks and replay retention would keep the security checks consistent.</violation>

<violation number="2" location="src/core/oauth/include/sourcemeta/core/oauth_assertion.h:203">
P2: The verifier accepts malformed `aud` arrays when one string matches and another element has a non-string type. Validating that the claim is a string or an array containing only strings before accepting the assertion would preserve the JWT claim-type requirement.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/core/oauth/oauth_assertion.cc
/// ```
[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_verify_client_assertion(
const std::string_view assertion,
const std::span<const std::string_view> expected_audiences,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The verifier accepts malformed aud arrays when one string matches and another element has a non-string type. Validating that the claim is a string or an array containing only strings before accepting the assertion would preserve the JWT claim-type requirement.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/oauth/include/sourcemeta/core/oauth_assertion.h, line 203:

<comment>The verifier accepts malformed `aud` arrays when one string matches and another element has a non-string type. Validating that the claim is a string or an array containing only strings before accepting the assertion would preserve the JWT claim-type requirement.</comment>

<file context>
@@ -0,0 +1,243 @@
+/// ```
+[[nodiscard]] SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_verify_client_assertion(
+    const std::string_view assertion,
+    const std::span<const std::string_view> expected_audiences,
+    const std::string_view request_client_id, const JWKS &keys,
+    const std::chrono::system_clock::time_point now,
</file context>

/// storage must outlive the verification (RFC 7523 Section 5).
std::span<const JWSAlgorithm> allowed_algorithms{};
/// The tolerance applied to the expiration, not-before, and issue times.
std::chrono::seconds clock_skew{std::chrono::seconds{0}};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Accepted assertions and replay protection use different interpretations of clock_skew: negative values can bypass replay detection, while very large values can produce undefined overflow. Normalizing or rejecting the option once and using the same bounded non-negative value for both claim checks and replay retention would keep the security checks consistent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/oauth/include/sourcemeta/core/oauth_assertion.h, line 166:

<comment>Accepted assertions and replay protection use different interpretations of `clock_skew`: negative values can bypass replay detection, while very large values can produce undefined overflow. Normalizing or rejecting the option once and using the same bounded non-negative value for both claim checks and replay retention would keep the security checks consistent.</comment>

<file context>
@@ -0,0 +1,243 @@
+  /// storage must outlive the verification (RFC 7523 Section 5).
+  std::span<const JWSAlgorithm> allowed_algorithms{};
+  /// The tolerance applied to the expiration, not-before, and issue times.
+  std::chrono::seconds clock_skew{std::chrono::seconds{0}};
+  /// The store tracking assertion identifiers to reject a replay, ignored when
+  /// null or when the assertion carries no identifier (RFC 7523 Section 3
</file context>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit 5b95922 into main Jul 21, 2026
12 checks passed
@jviotti
jviotti deleted the oauth-assertions branch July 21, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant