Improved API privacy
This commit is contained in:
parent
4e6aa5eef6
commit
cc1c394002
@ -38,6 +38,11 @@ type ConnectionAnalytics struct {
|
||||
EffectiveType string `json:"effectiveType"`
|
||||
}
|
||||
|
||||
// GetID returns the ID.
|
||||
func (analytics *Analytics) GetID() string {
|
||||
return analytics.UserID
|
||||
}
|
||||
|
||||
// GetAnalytics returns the analytics for the given user ID.
|
||||
func GetAnalytics(userID UserID) (*Analytics, error) {
|
||||
obj, err := DB.Get("Analytics", userID)
|
||||
|
@ -8,7 +8,8 @@ import (
|
||||
|
||||
// Force interface implementations
|
||||
var (
|
||||
_ api.Newable = (*Analytics)(nil)
|
||||
_ Identifiable = (*Analytics)(nil)
|
||||
_ api.Newable = (*Analytics)(nil)
|
||||
)
|
||||
|
||||
// Authorize returns an error if the given API POST request is not authorized.
|
||||
|
@ -5,3 +5,8 @@ type GoogleToUser struct {
|
||||
ID string `json:"id" primary:"true"`
|
||||
UserID UserID `json:"userId"`
|
||||
}
|
||||
|
||||
// GetID returns the ID.
|
||||
func (mapping *GoogleToUser) GetID() string {
|
||||
return mapping.ID
|
||||
}
|
||||
|
@ -55,6 +55,11 @@ func (list *PushSubscriptions) Find(id string) *PushSubscription {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetID returns the ID.
|
||||
func (list *PushSubscriptions) GetID() string {
|
||||
return list.UserID
|
||||
}
|
||||
|
||||
// GetPushSubscriptions ...
|
||||
func GetPushSubscriptions(id string) (*PushSubscriptions, error) {
|
||||
obj, err := DB.Get("PushSubscriptions", id)
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
|
||||
// Force interface implementations
|
||||
var (
|
||||
_ Identifiable = (*PushSubscriptions)(nil)
|
||||
_ api.Editable = (*PushSubscriptions)(nil)
|
||||
_ api.Filter = (*PushSubscriptions)(nil)
|
||||
)
|
||||
@ -91,6 +92,10 @@ func (list *PushSubscriptions) Filter() {
|
||||
item.P256DH = ""
|
||||
item.Auth = ""
|
||||
item.Endpoint = ""
|
||||
item.Platform = ""
|
||||
item.UserAgent = ""
|
||||
item.Screen.Width = 0
|
||||
item.Screen.Height = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,11 +15,14 @@ import (
|
||||
|
||||
// privateTypes are types that are not available for download.
|
||||
var privateTypes = []string{
|
||||
"Analytics",
|
||||
"EditLogEntry",
|
||||
"EmailToUser",
|
||||
"FacebookToUser",
|
||||
"PayPalPayment",
|
||||
"Purchase",
|
||||
"Session",
|
||||
"TwitterToUser",
|
||||
}
|
||||
|
||||
// Download downloads a snapshot of a database collection.
|
||||
|
Loading…
Reference in New Issue
Block a user