-
-
Notifications
You must be signed in to change notification settings - Fork 535
Description
Describe the Bug
Cannot create second resource on same domain with different path prefix and role (duplicate‑domain error)
Environment
- OS Type & Version: Debian 13 using Docker (v29.1.3)
- Pangolin Version: ee-postgresql-latest (1.14.1)
- Gerbil Version: 1.3.0
- Traefik Version: v3.6.6
- Newt Version: 1.8.1
To Reproduce
-
In Pangolin, ensure you have:
- A single domain configured, for example
example.com. - At least two roles / groups, for example:
adminsusers(non‑admin)
- A single domain configured, for example
-
In Pangolin, create a public resource (or application) using this domain:
- Domain:
example.com - Path prefix:
/(or leave as root) - Access / authorization: assign role/group
users - Save the resource – it is created successfully.
- Domain:
-
Attempt to create a second resource for the same domain, but scoped to an admin‑only path:
- Domain:
example.com - Path prefix:
/admin - Access / authorization: assign role/group
adminsonly - Try to save the new resource.
- Domain:
-
Observe that Pangolin refuses to create the second resource and displays an error similar to:
Error creating resource
Resource with that domain already
Expected Behavior
It should be possible to:
- Define multiple resources on the same domain as long as they have different path prefixes (for example
/and/admin). - Attach different roles / policies to different prefixes so that:
/(or other non‑privileged paths) can be accessible to generalusers./admin(or other admin paths) can be restricted toadminsonly, even though both are underexample.com.
In other words, the uniqueness constraint should apply to the (domain, path prefix) pair, not just the bare domain, so that separate resources can protect different path segments under the same host.
Actual Behavior
-
When creating the second resource for
example.comwith a different path prefix (e.g./admin) and a different role:-
Pangolin rejects the configuration and shows:
Error creating resource
Resource with that domain already
-
-
This effectively forces all traffic for that domain to be governed by a single resource and a single set of roles, which means:
- Either
/adminmust be left accessible to all roles assigned to the root resource, or - The entire domain has to be locked down to admins, which is not practical when admins and non‑admins share the same host.
- Either
Additional Context
Impact / Why This Is a Bug
Many real‑world applications host multiple areas under the same domain with different access requirements, such as:
/– public or general‑user area/admin– sensitive administrative UI
With the current behavior:
- It is not possible to express "allow only admins to
/admin, but allow all users to/" using separate resources, because the second resource is blocked by the duplicate‑domain check. - Administrators are forced to:
- Either expose
/adminto all users that can reachexample.com, or - Split the application across multiple domains/subdomains purely to work around the limitation.
- Either expose
Functionally, this feels like a bug / design oversight in the resource uniqueness logic rather than an intentional restriction, because:
- The UI and configuration model both support a path prefix field.
- Path prefixes are a natural place to apply separate authorization policies.
This limitation weakens security for shared domains and makes it harder to model common app layouts without restructuring DNS or the application itself.
Suggestions
- The error message is technically correct (a resource already exists for that domain), but in practice too strict, because:
- The second resource uses a different path prefix and different roles.
- A more flexible and intuitive model would:
- Allow multiple resources per domain as long as their path prefixes are not overlapping/conflicting, or
- At minimum allow two resources when one uses
/and the other uses a more specific prefix such as/admin.
- This would let administrators:
- Lock down
/admin(or any other sensitive path) to admins, - While keeping the rest of the site accessible to other roles/groups,
- Without introducing extra domains or subdomains solely for access control.
- Lock down
If any logs or config snippets would help troubleshoot, they can be provided as well.