Copilot commented on code in PR #5201: URL: https://github.com/apache/solr/pull/5201#discussion_r4486925599
########## solr/webapp/web/libs/scalar/scalar-init.js: ########## @@ -0,0 +1,30 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +Scalar.createApiReference("#app", { + url: "spec.json", Review Comment: Scalar requests bypass the Admin UI's Angular/superagent interceptors, and this configuration never forwards the credentials stored in `sessionStorage['auth.header']`. After logging in through the Admin UI with BasicAuth or JWT, “Test Request” therefore sends unauthenticated API calls, resulting in 401 responses or another browser authentication prompt. Use Scalar's `onBeforeRequest` hook to attach the current credentials and the UI's `X-Requested-With` header to same-origin requests, reading the credentials on each call so login/logout changes are respected. ########## solr/webapp/web/js/angular/app.js: ########## @@ -118,6 +118,10 @@ solrAdminApp.config([ templateUrl: 'partials/java-properties.html', controller: 'JavaPropertiesController' }). + when('/~api-explorer', { + templateUrl: 'partials/api-explorer.html', + controller: 'ApiExplorerController' Review Comment: No browser test opens `~api-explorer`; the added servlets only supply its assets, so bundle loading, spec rendering, and iframe navigation can fail without failing the suite. Add a Selenium test that enters the iframe, waits for an operation from the bundled spec, executes a read-only request, and navigates back to another Angular screen. Exercise this with the production Content-Security-Policy so the test also checks that framing is permitted. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
