API, Environment variable for bespoke functionality for customer-preston (#28893)

## For #28221

- Add support for env var / flag
- surface as `config.partnerships.enable_primo` if `true`, omit from
response otherwise

### when `FLEET_PARTNERSHIPS_ENABLE_PRIMO=true`:
![Screenshot 2025-05-06 at 6 14
01 PM](https://github.com/user-attachments/assets/f7a0c705-37e7-4491-ad8b-492f456ca924)

### when `FLEET_PARTNERSHIPS_ENABLE_PRIMO=false` or not set:
![Screenshot 2025-05-06 at 6 13
57 PM](https://github.com/user-attachments/assets/e8a88b15-43ef-4d56-ab6c-3fbe832b6ddd)


~Changes file added for user-visible changes in `changes/`~ in companion
frontend PR
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
jacobshandling
2025-05-12 13:04:18 -07:00
committed by GitHub
co-authored by Jacob Shandling
parent ca08e7380f
commit 2f67a87e53
5 changed files with 35 additions and 3 deletions
+4
View File
@@ -622,6 +622,7 @@ type FleetConfig struct {
type PartnershipsConfig struct {
EnableSecureframe bool `yaml:"enable_secureframe"`
EnablePrimo bool `yaml:"enable_primo"`
}
type MDMConfig struct {
@@ -1169,6 +1170,7 @@ func (man Manager) addConfigs() {
// Email
man.addConfigString("email.backend", "", "Provide the email backend type, acceptable values are currently \"ses\" and \"default\" or empty string which will default to SMTP")
// SES
man.addConfigString("ses.region", "", "AWS Region to use")
man.addConfigString("ses.endpoint_url", "", "AWS Service Endpoint to use (leave empty for default service endpoints)")
@@ -1412,6 +1414,7 @@ func (man Manager) addConfigs() {
// Partnerships
man.addConfigBool("partnerships.enable_secureframe", false, "Point transparency URL at Secureframe landing page")
man.addConfigBool("partnerships.enable_primo", false, "Cosmetically disables team capabilities in the UI")
}
func (man Manager) hideConfig(name string) {
@@ -1692,6 +1695,7 @@ func (man Manager) LoadConfig() FleetConfig {
},
Partnerships: PartnershipsConfig{
EnableSecureframe: man.getConfigBool("partnerships.enable_secureframe"),
EnablePrimo: man.getConfigBool("partnerships.enable_primo"),
},
}