Chore: Pass signed user_hash to Intercom via Rudderstack (#63921) (#64145)

* move analytics identifiers to backend

* implement hash function

* grab secret from env

* expose and retrieve intercom secret from config

* concat email with appUrl to ensure uniqueness

* revert to just using email

* Revert "revert to just using email"

This reverts commit 8f10f9b1bc.

* add docstring

(cherry picked from commit d61bcdf4ca)
This commit is contained in:
Ashley Harrison
2023-03-03 10:06:13 -05:00
committed by GitHub
parent 1548edc40e
commit 4ee064da11
15 changed files with 90 additions and 66 deletions
+6
View File
@@ -48,6 +48,12 @@ type CurrentUser struct {
HelpFlags1 user.HelpFlags1 `json:"helpFlags1"`
HasEditPermissionInFolders bool `json:"hasEditPermissionInFolders"`
Permissions UserPermissionsMap `json:"permissions,omitempty"`
Analytics AnalyticsSettings `json:"analytics"`
}
type AnalyticsSettings struct {
Identifier string `json:"identifier"`
IntercomIdentifier string `json:"intercomIdentifier,omitempty"`
}
type UserPermissionsMap map[string]bool
+4
View File
@@ -109,6 +109,10 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
Language: language,
HelpFlags1: c.HelpFlags1,
HasEditPermissionInFolders: hasEditPerm,
Analytics: dtos.AnalyticsSettings{
Identifier: c.SignedInUser.Analytics.Identifier,
IntercomIdentifier: c.SignedInUser.Analytics.IntercomIdentifier,
},
},
Settings: settings,
Theme: prefs.Theme,