Add KeyToken authorization

This commit is contained in:
2023-04-21 21:45:16 +02:00
parent 16f6ab4861
commit b1bd278f9b
49 changed files with 3109 additions and 1313 deletions

View File

@@ -7,6 +7,13 @@ import (
"time"
)
// [!] subscriptions are read-access to channels,
//
// The set of subscriptions specifies which messages the ListMessages() API call returns
// also single messages/channels that are subscribed can be queries
//
// (use keytokens for write-access)
type Subscription struct {
SubscriptionID SubscriptionID
SubscriberUserID UserID
@@ -56,7 +63,7 @@ func (s SubscriptionDB) Model() Subscription {
ChannelOwnerUserID: s.ChannelOwnerUserID,
ChannelID: s.ChannelID,
ChannelInternalName: s.ChannelInternalName,
TimestampCreated: time.UnixMilli(s.TimestampCreated),
TimestampCreated: timeFromMilli(s.TimestampCreated),
Confirmed: s.Confirmed != 0,
}
}