From: Michael R Sweet Date: Mon, 5 May 2025 12:07:39 +0000 (-0400) Subject: Add support for JWKS URL. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73b5cafc7f05b284d27e8ee5a87f06f84d445299;p=thirdparty%2Fcups.git Add support for JWKS URL. --- 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) {