From 73b5cafc7f05b284d27e8ee5a87f06f84d445299 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 5 May 2025 08:07:39 -0400 Subject: [PATCH] Add support for JWKS URL. --- cups/testjwt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cups/testjwt.c b/cups/testjwt.c index 1d4c82d57b..3fbab61d9c 100644 --- a/cups/testjwt.c +++ b/cups/testjwt.c @@ -1,7 +1,7 @@ // // JWT API unit tests for CUPS. // -// Copyright © 2023-2024 by OpenPrinting. +// Copyright © 2023-2025 by OpenPrinting. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. @@ -387,7 +387,15 @@ main(int argc, // I - Number of command-line arguments for (i = 1; i < argc; i ++) { - if (!access(argv[i], R_OK)) + if (!strncmp(argv[i], "https://", 8)) + { + if ((jwks = cupsJSONImportURL(argv[i], NULL)) == NULL) + { + fprintf(stderr, "%s: %s\n", argv[i], cupsGetErrorString()); + return (1); + } + } + else if (!access(argv[i], R_OK)) { if ((jwks = cupsJSONImportFile(argv[i])) == NULL) { -- 2.47.3