bcgov / bcgov/gwa-api

Users can't create private routes by default

Open
#111 0 comments 0 reactions 0 assignees View on GitHub
bug jira
Dominant language
Python
Stars
5
Forks
4
Avg merge
3d 4h
Merged PRs (30d)
9

Description

By default, users can't create private routes (where route hosts end in `.cluster.local` which creates a route `.svc.cluster.local`). As is, it is necessary to go into keycloak authz and add `.svc.cluster.local` to `perm-domains`.

The issue likely lies in `validate_hosts()` here - https://github.com/bcgov/gwa-api/blob/0e2ff4dbf89b644950caf0744d301a448c964912/microservices/gatewayApi/v1/routes/gateway.py#L538

Resolution could include adding `.svc.cluster.local` to the default list of `allowed_domains` or otherwise modifying the function logic.

I have a note from a conversation with Aidan that the issue may be a misplaced if statement (should be else) following the if statement checking if it’s a valid local route, but I'm not soo sure about this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in microservices/gatewayApi/v1/routes/gateway.py at validate_hosts() around line 538, and inspect how local routes and allowed_domains are handled. Verify the behavior for hosts ending in .cluster.local, then confirm that the resulting .svc.cluster.local route can be created without manually adding that domain to Keycloak authz perm-domains.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.