Hello community,
The MVP for OCI Flatpak support in Katello releases with 4.16: Foreman 3.14 and Katello 4.16 Release Notes
This MVP included Katello having to proxy the Flatpak index that Pulp provides to ensure that registered hosts would only see the Flatpak content in the content view environments that they are registered to. For context, the Flatpak index only serves the latest container content available in the registry. Since there is no integration between Flatpak and RHSM, Katello solved this by matching request IPs to existing hosts to determine what content view environments to serve back. In the case that we cannot find the host from the request IP, we just give the user the full Flatpak index.
While this works for the main Katello server, smart proxies are a different story entirely. For Katello 4.16, smart proxies have no lifecycle management support for Flatpaks. Only the global Pulp Flatpak index will be served.
To implement the same IP-matching feature on smart proxies, the Container Gateway (which will likely be responsible for serving the proxied Flatpak index) would need to also know which hosts have access to which repositories. It currently has a PostgreSQL DB and mirrors Foreman user data for limiting access to normal container repositories. However, host access is completely different from user access to repositories. A user with access to limited Flatpak content may be unable to access it if the container images are older than the ones listed in the Flatpak index.
<tangent>
In an ideal world, I think the Flatpak client would have some way to request a limited set of content so that the content view environments (and organizations) could be respected. If Katello & the Container Gateway could receive even a simple tag from the Flatpak client, we could filter the index based on that tag.
</tangent>
I havenāt looked too much into it yet, but modern Pulp has ādomainā capabilities, which can separate served repository paths by domain names. Theoretically that could be used to limit the hostās access and Pulp could serve a different Flatpak index per domain. However, this could complicate smart proxy syncing (since domains would need to be synced separately as well), and Iām not sure how easily domains can be created/destroyed on the fly as users associate new content view environments to smart proxies.
We may have an opportunity here to improve on the IP-matching strategy in general since it isnāt 100% guaranteed to match with a host (and can be spoofed). Plus, if one organization in Katello doesnāt want another org to ever access its Flatpak index, that is impossible with todayās implementation. A user would simply need to not register with subscription-manager and it will see the latest Flatpak index hosted by Pulp. The only safeguard here would be the Foreman container user access control.
If we are able to find a different solution from IP-matching one for smart proxies, perhaps it could be implemented for the main Katello server as well.
From my perspective, the first lead to follow would be Pulpās domain support, since itās a Pulp-native way to separate access to content.
In the meantime, Iām curious to hear what the community thinks.
Thanks!
āIan