@@ -296,3 +296,141 @@ class HeaderDeclaration extends DataFlow::Node {
296296 */
297297 DataFlow:: Node getValueArg ( ) { result = range .getValueArg ( ) }
298298}
299+
300+ /** Provides classes for modeling JWT encoding-related APIs. */
301+ module JWTEncoding {
302+ /**
303+ * A data-flow node that collects methods encoding a JWT token.
304+ *
305+ * Extend this class to model new APIs. If you want to refine existing API models,
306+ * extend `JWTEncoding` instead.
307+ */
308+ abstract class Range extends DataFlow:: Node {
309+ /**
310+ * Gets the argument containing the encoding payload.
311+ */
312+ abstract DataFlow:: Node getPayload ( ) ;
313+
314+ /**
315+ * Gets the argument containing the encoding key.
316+ */
317+ abstract DataFlow:: Node getKey ( ) ;
318+
319+ /**
320+ * Gets the argument for the algorithm used in the encoding.
321+ */
322+ abstract DataFlow:: Node getAlgorithm ( ) ;
323+
324+ /**
325+ * Gets a string representation of the algorithm used in the encoding.
326+ */
327+ abstract string getAlgorithmString ( ) ;
328+ }
329+ }
330+
331+ /**
332+ * A data-flow node that collects methods encoding a JWT token.
333+ *
334+ * Extend this class to refine existing API models. If you want to model new APIs,
335+ * extend `JWTEncoding::Range` instead.
336+ */
337+ class JWTEncoding extends DataFlow:: Node instanceof JWTEncoding:: Range {
338+ /**
339+ * Gets the argument containing the payload.
340+ */
341+ DataFlow:: Node getPayload ( ) { result = super .getPayload ( ) }
342+
343+ /**
344+ * Gets the argument containing the encoding key.
345+ */
346+ DataFlow:: Node getKey ( ) { result = super .getKey ( ) }
347+
348+ /**
349+ * Gets the argument for the algorithm used in the encoding.
350+ */
351+ DataFlow:: Node getAlgorithm ( ) { result = super .getAlgorithm ( ) }
352+
353+ /**
354+ * Gets a string representation of the algorithm used in the encoding.
355+ */
356+ string getAlgorithmString ( ) { result = super .getAlgorithmString ( ) }
357+ }
358+
359+ /** Provides classes for modeling JWT decoding-related APIs. */
360+ module JWTDecoding {
361+ /**
362+ * A data-flow node that collects methods decoding a JWT token.
363+ *
364+ * Extend this class to model new APIs. If you want to refine existing API models,
365+ * extend `JWTDecoding` instead.
366+ */
367+ abstract class Range extends DataFlow:: Node {
368+ /**
369+ * Gets the argument containing the encoding payload.
370+ */
371+ abstract DataFlow:: Node getPayload ( ) ;
372+
373+ /**
374+ * Gets the argument containing the encoding key.
375+ */
376+ abstract DataFlow:: Node getKey ( ) ;
377+
378+ /**
379+ * Gets the argument for the algorithm used in the encoding.
380+ */
381+ abstract DataFlow:: Node getAlgorithm ( ) ;
382+
383+ /**
384+ * Gets a string representation of the algorithm used in the encoding.
385+ */
386+ abstract string getAlgorithmString ( ) ;
387+
388+ /**
389+ * Gets the options Node used in the encoding.
390+ */
391+ abstract DataFlow:: Node getOptions ( ) ;
392+
393+ /**
394+ * Checks if the signature gets verified while decoding.
395+ */
396+ abstract predicate verifiesSignature ( ) ;
397+ }
398+ }
399+
400+ /**
401+ * A data-flow node that collects methods encoding a JWT token.
402+ *
403+ * Extend this class to refine existing API models. If you want to model new APIs,
404+ * extend `JWTDecoding::Range` instead.
405+ */
406+ class JWTDecoding extends DataFlow:: Node instanceof JWTDecoding:: Range {
407+ /**
408+ * Gets the argument containing the payload.
409+ */
410+ DataFlow:: Node getPayload ( ) { result = super .getPayload ( ) }
411+
412+ /**
413+ * Gets the argument containing the encoding key.
414+ */
415+ DataFlow:: Node getKey ( ) { result = super .getKey ( ) }
416+
417+ /**
418+ * Gets the argument for the algorithm used in the encoding.
419+ */
420+ DataFlow:: Node getAlgorithm ( ) { result = super .getAlgorithm ( ) }
421+
422+ /**
423+ * Gets a string representation of the algorithm used in the encoding.
424+ */
425+ string getAlgorithmString ( ) { result = super .getAlgorithmString ( ) }
426+
427+ /**
428+ * Gets the options Node used in the encoding.
429+ */
430+ DataFlow:: Node getOptions ( ) { result = super .getOptions ( ) }
431+
432+ /**
433+ * Checks if the signature gets verified while decoding.
434+ */
435+ predicate verifiesSignature ( ) { super .verifiesSignature ( ) }
436+ }
0 commit comments