Commit f817240
authored
* Added helper class and methods to track signature validation telemetry. Added tests
* Added a counter for signature validation. Updated ITelemetryClient interface and TelemetryClient to support the new telemetry. Added null telemetry client for no op
* Added telemetry to JWT and SAML/SAML2 handlers. Expanded catching of exceptions to identify the stage at which the signature validation failed.
* Added tests
* Addressed Copilot's feedback
* Reverted readonly changes to allow setting the telemetry client in tests
* Replaced lock with volatile modifier for immutable array, removed the hashset in favour of the array to avoid converting in the getter.
* Updated CryptoTelemetry's public API and tests
* Added benchmarks for signature validation telemetry
* Removed issuer caching from CryptoTelemetry signature validation telemetry. Updated tests
* Updated public API to match the updated enable telemetry method
* Addressed PR feedback
- Rename _telemetryClient to TelemetryClient in all token handlers and update all references accordingly.
- Simplify CryptoTelemetry.GetTrackedIssuerOrOther: now matches tracked issuers by substring (case-insensitive) instead of parsing host; remove ExtractHostFromIssuer.
- Update comments to clarify substring matching and its limitations.
- Remove TelemetryConfiguration enum from benchmarks; update benchmark attributes and tracked issuer values for consistency.
- Refactor and expand CryptoTelemetry tests: remove host extraction tests, consolidate key algorithm ID tests, and add more scenarios for tracked issuer matching and allowlist filtering.
- Update API documentation to reflect field renaming.
- Overall, unify telemetry client usage and streamline issuer tracking logic, with tests updated to match new behavior.
* Removed case insensitive comparison for telemetry issuer extraction based on PR feedback
(cherry picked from commit 61449b8)
1 parent bcd41b7 commit f817240
29 files changed
Lines changed: 2207 additions & 43 deletions
File tree
- benchmark/Microsoft.IdentityModel.Benchmarks
- src
- Microsoft.IdentityModel.JsonWebTokens
- Experimental
- Microsoft.IdentityModel.Tokens.Saml
- Saml2
- Experimental
- Saml
- Experimental
- Microsoft.IdentityModel.Tokens
- Telemetry
- System.IdentityModel.Tokens.Jwt
- test
- Microsoft.IdentityModel.JsonWebTokens.Tests
- Microsoft.IdentityModel.TestUtils
- Telemetry
- Microsoft.IdentityModel.Tokens.Saml.Tests/Telemetry
- Microsoft.IdentityModel.Tokens.Tests/Telemetry
Lines changed: 72 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
196 | 268 | | |
Lines changed: 44 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
129 | | - | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
218 | 225 | | |
219 | 226 | | |
220 | 227 | | |
221 | | - | |
| 228 | + | |
222 | 229 | | |
223 | 230 | | |
224 | 231 | | |
| |||
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
232 | 245 | | |
233 | 246 | | |
234 | 247 | | |
| |||
242 | 255 | | |
243 | 256 | | |
244 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
245 | 265 | | |
246 | 266 | | |
247 | 267 | | |
248 | 268 | | |
249 | 269 | | |
250 | 270 | | |
251 | 271 | | |
| 272 | + | |
252 | 273 | | |
253 | 274 | | |
254 | 275 | | |
| |||
262 | 283 | | |
263 | 284 | | |
264 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
265 | 292 | | |
266 | 293 | | |
267 | 294 | | |
268 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
269 | 303 | | |
270 | 304 | | |
271 | 305 | | |
272 | 306 | | |
273 | 307 | | |
274 | 308 | | |
| 309 | + | |
275 | 310 | | |
276 | 311 | | |
277 | 312 | | |
278 | 313 | | |
279 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
280 | 321 | | |
281 | 322 | | |
282 | 323 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
0 commit comments