mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-15 19:31:21 -05:00
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/1522
Author: @jln-brtn
Created: 9/22/2025
Status: ✅ Merged
Merged: 10/6/2025
Merged by: @oschwartz10612
Base:
main← Head:feature-header-authentication📝 Commits (6)
850e9a7Adding HTTP Header Authentication6105eeaFix rebase23f05d7Add translations to EN2c46a37Include in hybride121dd0Add to blueprints5a3bf2fFix import issue📊 Changes
17 files changed (+596 additions, -49 deletions)
View changed files
📝
messages/en-US.json(+17 -3)📝
server/auth/actions.ts(+1 -1)📝
server/db/pg/schema.ts(+9 -0)📝
server/db/queries/verifySessionQueries.ts(+9 -1)📝
server/db/sqlite/schema.ts(+11 -0)📝
server/lib/blueprints/proxyResources.ts(+52 -2)📝
server/lib/blueprints/types.ts(+4 -0)📝
server/routers/badger/verifySession.ts(+71 -33)📝
server/routers/external.ts(+7 -0)📝
server/routers/integration.ts(+9 -3)📝
server/routers/private/hybrid.ts(+10 -2)📝
server/routers/resource/getResourceAuthInfo.ts(+26 -2)📝
server/routers/resource/index.ts(+1 -0)➕
server/routers/resource/setResourceHeaderAuth.ts(+101 -0)📝
src/app/[orgId]/settings/resources/[niceId]/authentication/page.tsx(+81 -2)📝
src/components/PermissionsSelectBox.tsx(+1 -0)➕
src/components/SetResourceHeaderAuthForm.tsx(+186 -0)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content.
Description
This feature introduces support for the 'Basic' HTTP Authentication Scheme (RFC 7617) to allow access to a protected resource. As described in #226 and #937, the primary goal is to provide an alternative to Pangolin's standard SSO authentication, which requires user interaction with a graphical interface. Supporting header-based authentication enables third-party systems and headless clients to bypass the interactive login flow by providing credentials directly in the request header.
Currently, when an unauthenticated user tries to access a resource managed by Pangolin (e.g., a Jellyfin server at https://play.example.com), they are redirected to a login page. This flow is incompatible with headless clients, such as the Jellyfin mobile application, which cannot render the web login page.
The existing workaround involves creating filtering rules to allow specific URL paths to bypass authentication. This approach is insecure, as it exposes endpoints publicly, and brittle, as it requires maintaining an exhaustive list of all necessary API routes.
This feature allows users to enable Basic Authentication for a resource through the management interface. When configuring the resource, the user can add header-based authentication by specifying a username and password.
Once configured, a client can authenticate by embedding the credentials in the URL (e.g., https://user:password@play.example.com) or by providing them in the Authorization header. Pangolin will identify and validate these credentials, allowing the request to proceed to the backend resource without any GUI interaction.
How to test?
curl -u "username:password" https://play.example.com. The request should be successful (e.g., HTTP 200 OK) and the resource content should be returned.curl -u "username:wrongpassword" https://play.example.com. The request should be redirected to the standard pangolin login page.Points of attention
While it's my first contribution to this project, some minor point should be check :
Huge thanks to @AstralDestiny which help me to set up the local development environment
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.