Add validation on the API link in the footer #1366

Closed
opened 2025-12-29 16:31:49 +01:00 by adam · 3 comments
Owner

Originally created by @AnythingOverIP on GitHub (Oct 31, 2017).

Issue type

[ x ] Feature request

Environment

  • Python version: 3.5.4
  • NetBox version: 2.2.1

Description

On the login page, the API link in the footer ( /api/docs/ ) returns the following error in the swagger interface due to user not logged in:

400 : ["The schema generator did not return a schema Document"] https://FQDN/ipshack/api/docs/?format=openapi

I believe it would be fairly simple to fix by either:

  • Hide this link on the login page
  • Display either a warning to remember the user this is unavailable but not broken, instead of forwarding to the swagger interface;
  • Removing the footer on the login page. This is a simple fix and for us it would be the best of the 3 suggestions as providing the platform version & other information (like the host name, as we deliver NetBox behind a reverse proxy) to unauthorized users is not considered best practice. It can be used against the system. (Yeah I know, I am a freak ;) )
Originally created by @AnythingOverIP on GitHub (Oct 31, 2017). ### Issue type [ x ] Feature request ### Environment * Python version: 3.5.4 * NetBox version: 2.2.1 ### Description On the login page, the API link in the footer ( /api/docs/ ) returns the following error in the swagger interface due to user not logged in: `400 : ["The schema generator did not return a schema Document"] https://FQDN/ipshack/api/docs/?format=openapi` I believe it would be fairly simple to fix by either: * Hide this link on the login page * Display either a warning to remember the user this is unavailable but not broken, instead of forwarding to the swagger interface; * Removing the footer on the login page. This is a simple fix and for us it would be the best of the 3 suggestions as providing the platform version & other information (like the host name, as we deliver NetBox behind a reverse proxy) to unauthorized users is not considered best practice. It can be used against the system. (Yeah I know, I am a freak ;) )
adam closed this issue 2025-12-29 16:31:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 31, 2017):

Not able to reproduce this. Going to /api/docs/ renders Swagger normally, both with and without a BASE_PATH set, with and without logging in.

@jeremystretch commented on GitHub (Oct 31, 2017): Not able to reproduce this. Going to `/api/docs/` renders Swagger normally, both with and without a `BASE_PATH` set, with and without logging in.
Author
Owner

@AnythingOverIP commented on GitHub (Nov 3, 2017):

It might be an issue with Swagger or how it's configured...
( https://github.com/marcgibbons/django-rest-swagger/issues/649 )

I've tested without our reverse proxy, to ensure it's not caused by it.
I will have to look deeper into it... but I have the feeling it's out of my expertise field...

@AnythingOverIP commented on GitHub (Nov 3, 2017): It might be an issue with Swagger or how it's configured... ( https://github.com/marcgibbons/django-rest-swagger/issues/649 ) I've tested without our reverse proxy, to ensure it's not caused by it. I will have to look deeper into it... but I have the feeling it's out of my expertise field...
Author
Owner

@jeremystretch commented on GitHub (Nov 6, 2017):

I'm going to close this out for now, but please comment again if you're able to reproduce it on a stock installation.

@jeremystretch commented on GitHub (Nov 6, 2017): I'm going to close this out for now, but please comment again if you're able to reproduce it on a stock installation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1366