Background
Historically tenant access to sites has been controlled on the REST side via TenantSite record. Tenants that have a TenantSite record linking them to a particular site can see that site and take actions there (creating VPCs, network partitions, adding the site to SSH key groups, etc). We create a TenantSite record when a tenant is first given an allocation on that site, whether a compute allocation or network allocation, and we delete the TenantSite record if their last allocation on that site is deleted.
Recent changes mean that depending on the existence of allocations as the sole driver of whether a TenantSite record exists no longer makes sense as a strategy. Privileged tenants have long been able to create instances on sites without having any compute allocations on those sites, and the recent introduction of zero DPU instances means they no longer need to have network allocations either -- a privileged tenant should be able to take action on any site that the belongs to their infrastructure provider. Similarly, service accounts should be able to operate without allocations.
Request
Automatically create TenantSite records for service accounts and privileged tenants for any registered sites they can see.
Implementation
For service accounts, this auto-creation should be invoked in the GetCurrentServiceAccountHandler, while for privileged tenants it should be invoked as part of GetCurrentTenantHandler. NB: We should also adjust the allocation clean-up logic that automatically deletes TenantSite records when deleting the last allocation for a particular tenant/site combo -- for special tenants that are privileged or service accounts, we will no longer wish to do this.
Background
Historically tenant access to sites has been controlled on the REST side via TenantSite record. Tenants that have a TenantSite record linking them to a particular site can see that site and take actions there (creating VPCs, network partitions, adding the site to SSH key groups, etc). We create a TenantSite record when a tenant is first given an allocation on that site, whether a compute allocation or network allocation, and we delete the TenantSite record if their last allocation on that site is deleted.
Recent changes mean that depending on the existence of allocations as the sole driver of whether a TenantSite record exists no longer makes sense as a strategy. Privileged tenants have long been able to create instances on sites without having any compute allocations on those sites, and the recent introduction of zero DPU instances means they no longer need to have network allocations either -- a privileged tenant should be able to take action on any site that the belongs to their infrastructure provider. Similarly, service accounts should be able to operate without allocations.
Request
Automatically create TenantSite records for service accounts and privileged tenants for any registered sites they can see.
Implementation
For service accounts, this auto-creation should be invoked in the GetCurrentServiceAccountHandler, while for privileged tenants it should be invoked as part of GetCurrentTenantHandler. NB: We should also adjust the allocation clean-up logic that automatically deletes TenantSite records when deleting the last allocation for a particular tenant/site combo -- for special tenants that are privileged or service accounts, we will no longer wish to do this.