APIServer does not validate parent resource apiGroup and apiVersion in scoped resource paths
Description
The Milo APIServer is not validating the apiGroup and apiVersion segments when accessing project-scoped or organization-scoped resources. This allows requests with invalid or arbitrary values to succeed and return data.
Steps to Reproduce
- Make a request with valid parent resource path:
kubectl --kubeconfig datumstaging get --raw \
/apis/resourcemanager.miloapis.com/v1alpha1/projects/test-mdqzir/control-plane/apis/dns.networking.miloapis.com/v1alpha1/dnszoneclasses
- Make a request with invalid parent resource apiGroup and apiVersion:
kubectl --kubeconfig datumstaging get --raw \
/apis/invalidGroup/invalidVersion/projects/test-mdqzir/control-plane/apis/dns.networking.miloapis.com/v1alpha1/dnszoneclasses
Expected Behavior
The second request should return a 404 Not Found or 400 Bad Request error since invalidGroup/invalidVersion is not a valid apiGroup/apiVersion combination.