KAS Internal API should return 402 Payment Required when a licensed feature is not allowed for the user
Proposal
We should handle better the agentk messages when it tries to access a feature which is licensed and the user does not have access.
The idea is that Rails returns 402, then KAS should propagate it to the agent. No change in the agent should be needed. We should also inform which license is needed (PREMIUM|ULTIMATE).
Licensed Internal API features live under: https://gitlab.com/gitlab-org/gitlab/-/blob/e62d975523ba138ebfdd0c386450afd4a8c61c16/ee/lib/ee/api/internal/kubernetes.rb#L107-123
Nowadays we return not_found!
.
Edited by João Alexandre Cunha