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