fleet/server/mdm/android/pubsub.go
Victor Lyuboslavsky 8f1626303a
Added custom auth for PubSub push endpoint. (#26664)
For #26219 

Need to get in this security change for the RC

- Added auth (token stored in `mdm_config_assets`) for PubSub endpoint
- unknown notification types, including `test` are not authenticated
- Status reports for deleted devices are not authenticated -- no DB
changes are done for these since they only happen when we disable MDM
right now

# Checklist for submitter

- [x] Manual QA for all new/changed functionality
2025-02-27 15:16:32 -06:00

22 lines
516 B
Go

package android
type NotificationType string
const (
PubSubTest NotificationType = "test"
PubSubEnrollment NotificationType = "ENROLLMENT"
PubSubStatusReport NotificationType = "STATUS_REPORT"
PubSubCommand NotificationType = "COMMAND"
PubSubUsageLogs NotificationType = "USAGE_LOGS"
)
type DeviceState string
const (
DeviceStateDeleted DeviceState = "DELETED"
)
type PubSubMessage struct {
Attributes map[string]string `json:"attributes"`
Data string `json:"data"`
}