From b0db12490c75fa5c9780017d9eb1f8da48651c31 Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:31:47 +0200 Subject: [PATCH 1/7] Fix optional types and access func --- storage-new/models/Note.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/storage-new/models/Note.go b/storage-new/models/Note.go index f8c0907..efc725f 100644 --- a/storage-new/models/Note.go +++ b/storage-new/models/Note.go @@ -1,6 +1,7 @@ package models import ( + "database/sql" "time" "gorm.io/gorm" @@ -21,14 +22,25 @@ type Note struct { // Raw content of the note. So without additional formatting applied // Might already have formatting applied beforehand from the origin server RawContent string - ContentWarning *string // Content warnings of the note, if it contains any - RepliesTo *string // Url of the message this replies to - Quotes *string // url of the message this note quotes + ContentWarning sql.NullString // Content warnings of the note, if it contains any + RepliesTo sql.NullString // Url of the message this replies to + Quotes sql.NullString // url of the message this note quotes AccessLevel NoteAccessLevel // Where to send this message to (public, home, followers, dm) - OriginServer string // Url of the origin server. Also the primary key for those + Origin RemoteServer + OriginId uint AttachmentRelations []NoteToAttachment `gorm:"foreignKey:NoteId"` // Attachments added on to this note EmoteRelations []NoteToEmote `gorm:"foreignKey:NoteId"` // Emotes used in this note PingRelations []NoteToPing `gorm:"foreignKey:NoteId"` // Pings/mentions this note performs Tags []NoteTag `gorm:"foreignKey:NoteId"` // Tags this note contains } + +type INote interface { + // Get all notes by a user, paged, that are a specific access level. + // Ordered by age, descending (newest first) + // + // SELECT * FROM @@table + // WHERE creator_id = @userId AND access_level = @accessLevel + // ORDER BY created_at DESC LIMIT 50 OFFSET @pageNr * 50 + GetNotesPaged(userId string, pageNr uint, accessLevel uint8) ([]Note, error) +} From 115a167e75d9efda856c794d2e4ca07542092038 Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:32:17 +0200 Subject: [PATCH 2/7] Formatting --- storage-new/models/User.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage-new/models/User.go b/storage-new/models/User.go index 76417be..87c4d37 100644 --- a/storage-new/models/User.go +++ b/storage-new/models/User.go @@ -84,6 +84,7 @@ type IUser interface { // // SELECT * FROM @@table WHERE username = @username AND deleted_at IS NULL LIMIT 1 GetByUsername(username string) (*gen.T, error) + // Get all true public accounts (verified & no restricted follow & indexable) // in a paged manner, sorted by date saved // @@ -96,6 +97,7 @@ type IUser interface { // LIMIT 50 // OFFSET @pageNr * 50 GetPagedTruePublic(pageNr uint) ([]gen.T, error) + // Get all deleted accounts in a paged manner, sorted by date saved // // SELECT * FROM @@table WHERE @@ -104,6 +106,7 @@ type IUser interface { // LIMIT 50 // OFFSET @pageNr * 50 GetPagedAllDeleted(pageNr uint) ([]gen.T, error) + // Get all accounts that aren't deleted in a paged manner, sorted by date saved // // SELECT * FROM @@table WHERE @@ -112,6 +115,7 @@ type IUser interface { // LIMIT 50 // OFFSET @pageNr * 50 GetPagedAllNonDeleted(pageNr uint) ([]gen.T, error) + // Gdpr deleted users // // DELETE FROM @@table WHERE deleted_at IS NOT NULL AND deleted_at + interval '30 days' < NOW() From 91ff8d2ea18fae596eef04533d6a811813d70f84 Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:32:31 +0200 Subject: [PATCH 3/7] Regenerate --- storage-new/dbgen/note_tags.gen.go | 8 ++ storage-new/dbgen/note_to_attachments.gen.go | 8 ++ storage-new/dbgen/note_to_boosts.gen.go | 8 ++ storage-new/dbgen/note_to_emotes.gen.go | 8 ++ storage-new/dbgen/note_to_feeds.gen.go | 8 ++ storage-new/dbgen/note_to_pings.gen.go | 8 ++ storage-new/dbgen/notes.gen.go | 143 +++++++++++++++++-- storage-new/dbgen/notifications.gen.go | 8 ++ storage-new/dbgen/reactions.gen.go | 8 ++ 9 files changed, 193 insertions(+), 14 deletions(-) diff --git a/storage-new/dbgen/note_tags.gen.go b/storage-new/dbgen/note_tags.gen.go index 7cb953b..d792e8f 100644 --- a/storage-new/dbgen/note_tags.gen.go +++ b/storage-new/dbgen/note_tags.gen.go @@ -255,6 +255,11 @@ func newNoteTag(db *gorm.DB, opts ...gen.DOOption) noteTag { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -497,6 +502,9 @@ type noteTagBelongsToNote struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/note_to_attachments.gen.go b/storage-new/dbgen/note_to_attachments.gen.go index 74bb4cd..cfcd57a 100644 --- a/storage-new/dbgen/note_to_attachments.gen.go +++ b/storage-new/dbgen/note_to_attachments.gen.go @@ -255,6 +255,11 @@ func newNoteToAttachment(db *gorm.DB, opts ...gen.DOOption) noteToAttachment { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -505,6 +510,9 @@ type noteToAttachmentBelongsToNote struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/note_to_boosts.gen.go b/storage-new/dbgen/note_to_boosts.gen.go index 6471fb4..a20f7ab 100644 --- a/storage-new/dbgen/note_to_boosts.gen.go +++ b/storage-new/dbgen/note_to_boosts.gen.go @@ -193,6 +193,11 @@ func newNoteToBoost(db *gorm.DB, opts ...gen.DOOption) noteToBoost { }{ RelationField: field.NewRelation("Note.Creator", "models.User"), }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -512,6 +517,9 @@ type noteToBoostBelongsToNote struct { Creator struct { field.RelationField } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/note_to_emotes.gen.go b/storage-new/dbgen/note_to_emotes.gen.go index 5db4995..3a03a3d 100644 --- a/storage-new/dbgen/note_to_emotes.gen.go +++ b/storage-new/dbgen/note_to_emotes.gen.go @@ -255,6 +255,11 @@ func newNoteToEmote(db *gorm.DB, opts ...gen.DOOption) noteToEmote { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -505,6 +510,9 @@ type noteToEmoteBelongsToNote struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/note_to_feeds.gen.go b/storage-new/dbgen/note_to_feeds.gen.go index 0484318..a3882bd 100644 --- a/storage-new/dbgen/note_to_feeds.gen.go +++ b/storage-new/dbgen/note_to_feeds.gen.go @@ -255,6 +255,11 @@ func newNoteToFeed(db *gorm.DB, opts ...gen.DOOption) noteToFeed { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -497,6 +502,9 @@ type noteToFeedBelongsToNote struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/note_to_pings.gen.go b/storage-new/dbgen/note_to_pings.gen.go index e666323..f90a23e 100644 --- a/storage-new/dbgen/note_to_pings.gen.go +++ b/storage-new/dbgen/note_to_pings.gen.go @@ -255,6 +255,11 @@ func newNoteToPing(db *gorm.DB, opts ...gen.DOOption) noteToPing { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -505,6 +510,9 @@ type noteToPingBelongsToNote struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/notes.gen.go b/storage-new/dbgen/notes.gen.go index b322f50..798baa7 100644 --- a/storage-new/dbgen/notes.gen.go +++ b/storage-new/dbgen/notes.gen.go @@ -6,6 +6,7 @@ package dbgen import ( "context" + "strings" "git.mstar.dev/mstar/linstrom/storage-new/models" "gorm.io/gorm" @@ -33,11 +34,11 @@ func newNote(db *gorm.DB, opts ...gen.DOOption) note { _note.CreatorId = field.NewString(tableName, "creator_id") _note.Remote = field.NewBool(tableName, "remote") _note.RawContent = field.NewString(tableName, "raw_content") - _note.ContentWarning = field.NewString(tableName, "content_warning") - _note.RepliesTo = field.NewString(tableName, "replies_to") - _note.Quotes = field.NewString(tableName, "quotes") + _note.ContentWarning = field.NewField(tableName, "content_warning") + _note.RepliesTo = field.NewField(tableName, "replies_to") + _note.Quotes = field.NewField(tableName, "quotes") _note.AccessLevel = field.NewField(tableName, "access_level") - _note.OriginServer = field.NewString(tableName, "origin_server") + _note.OriginId = field.NewUint(tableName, "origin_id") _note.AttachmentRelations = noteHasManyAttachmentRelations{ db: db.Session(&gorm.Session{}), @@ -116,6 +117,9 @@ func newNote(db *gorm.DB, opts ...gen.DOOption) note { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField } @@ -373,6 +377,11 @@ func newNote(db *gorm.DB, opts ...gen.DOOption) note { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("AttachmentRelations.Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField }{ @@ -487,6 +496,12 @@ func newNote(db *gorm.DB, opts ...gen.DOOption) note { RelationField: field.NewRelation("Creator", "models.User"), } + _note.Origin = noteBelongsToOrigin{ + db: db.Session(&gorm.Session{}), + + RelationField: field.NewRelation("Origin", "models.RemoteServer"), + } + _note.fillFieldMap() return _note @@ -503,11 +518,11 @@ type note struct { CreatorId field.String Remote field.Bool RawContent field.String - ContentWarning field.String - RepliesTo field.String - Quotes field.String + ContentWarning field.Field + RepliesTo field.Field + Quotes field.Field AccessLevel field.Field - OriginServer field.String + OriginId field.Uint AttachmentRelations noteHasManyAttachmentRelations EmoteRelations noteHasManyEmoteRelations @@ -518,6 +533,8 @@ type note struct { Creator noteBelongsToCreator + Origin noteBelongsToOrigin + fieldMap map[string]field.Expr } @@ -540,11 +557,11 @@ func (n *note) updateTableName(table string) *note { n.CreatorId = field.NewString(table, "creator_id") n.Remote = field.NewBool(table, "remote") n.RawContent = field.NewString(table, "raw_content") - n.ContentWarning = field.NewString(table, "content_warning") - n.RepliesTo = field.NewString(table, "replies_to") - n.Quotes = field.NewString(table, "quotes") + n.ContentWarning = field.NewField(table, "content_warning") + n.RepliesTo = field.NewField(table, "replies_to") + n.Quotes = field.NewField(table, "quotes") n.AccessLevel = field.NewField(table, "access_level") - n.OriginServer = field.NewString(table, "origin_server") + n.OriginId = field.NewUint(table, "origin_id") n.fillFieldMap() @@ -561,7 +578,7 @@ func (n *note) GetFieldByName(fieldName string) (field.OrderExpr, bool) { } func (n *note) fillFieldMap() { - n.fieldMap = make(map[string]field.Expr, 17) + n.fieldMap = make(map[string]field.Expr, 18) n.fieldMap["id"] = n.ID n.fieldMap["created_at"] = n.CreatedAt n.fieldMap["updated_at"] = n.UpdatedAt @@ -573,7 +590,7 @@ func (n *note) fillFieldMap() { n.fieldMap["replies_to"] = n.RepliesTo n.fieldMap["quotes"] = n.Quotes n.fieldMap["access_level"] = n.AccessLevel - n.fieldMap["origin_server"] = n.OriginServer + n.fieldMap["origin_id"] = n.OriginId } @@ -666,6 +683,9 @@ type noteHasManyAttachmentRelations struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField } @@ -1054,6 +1074,77 @@ func (a noteBelongsToCreatorTx) Count() int64 { return a.tx.Count() } +type noteBelongsToOrigin struct { + db *gorm.DB + + field.RelationField +} + +func (a noteBelongsToOrigin) Where(conds ...field.Expr) *noteBelongsToOrigin { + if len(conds) == 0 { + return &a + } + + exprs := make([]clause.Expression, 0, len(conds)) + for _, cond := range conds { + exprs = append(exprs, cond.BeCond().(clause.Expression)) + } + a.db = a.db.Clauses(clause.Where{Exprs: exprs}) + return &a +} + +func (a noteBelongsToOrigin) WithContext(ctx context.Context) *noteBelongsToOrigin { + a.db = a.db.WithContext(ctx) + return &a +} + +func (a noteBelongsToOrigin) Session(session *gorm.Session) *noteBelongsToOrigin { + a.db = a.db.Session(session) + return &a +} + +func (a noteBelongsToOrigin) Model(m *models.Note) *noteBelongsToOriginTx { + return ¬eBelongsToOriginTx{a.db.Model(m).Association(a.Name())} +} + +type noteBelongsToOriginTx struct{ tx *gorm.Association } + +func (a noteBelongsToOriginTx) Find() (result *models.RemoteServer, err error) { + return result, a.tx.Find(&result) +} + +func (a noteBelongsToOriginTx) Append(values ...*models.RemoteServer) (err error) { + targetValues := make([]interface{}, len(values)) + for i, v := range values { + targetValues[i] = v + } + return a.tx.Append(targetValues...) +} + +func (a noteBelongsToOriginTx) Replace(values ...*models.RemoteServer) (err error) { + targetValues := make([]interface{}, len(values)) + for i, v := range values { + targetValues[i] = v + } + return a.tx.Replace(targetValues...) +} + +func (a noteBelongsToOriginTx) Delete(values ...*models.RemoteServer) (err error) { + targetValues := make([]interface{}, len(values)) + for i, v := range values { + targetValues[i] = v + } + return a.tx.Delete(targetValues...) +} + +func (a noteBelongsToOriginTx) Clear() error { + return a.tx.Clear() +} + +func (a noteBelongsToOriginTx) Count() int64 { + return a.tx.Count() +} + type noteDo struct{ gen.DO } type INoteDo interface { @@ -1115,6 +1206,30 @@ type INoteDo interface { Returning(value interface{}, columns ...string) INoteDo UnderlyingDB() *gorm.DB schema.Tabler + + GetNotesPaged(userId string, pageNr uint, accessLevel uint8) (result []models.Note, err error) +} + +// Get all notes by a user, paged, that are a specific access level. +// Ordered by age, descending (newest first) +// +// SELECT * FROM @@table +// WHERE creator_id = @userId AND access_level = @accessLevel +// ORDER BY created_at DESC LIMIT 50 OFFSET @pageNr * 50 +func (n noteDo) GetNotesPaged(userId string, pageNr uint, accessLevel uint8) (result []models.Note, err error) { + var params []interface{} + + var generateSQL strings.Builder + params = append(params, userId) + params = append(params, accessLevel) + params = append(params, pageNr) + generateSQL.WriteString("SELECT * FROM notes WHERE creator_id = ? AND access_level = ? ORDER BY created_at DESC LIMIT 50 OFFSET ? * 50 ") + + var executeSQL *gorm.DB + executeSQL = n.UnderlyingDB().Raw(generateSQL.String(), params...).Find(&result) // ignore_security_alert + err = executeSQL.Error + + return } func (n noteDo) Debug() INoteDo { diff --git a/storage-new/dbgen/notifications.gen.go b/storage-new/dbgen/notifications.gen.go index 6f50fd8..62e286b 100644 --- a/storage-new/dbgen/notifications.gen.go +++ b/storage-new/dbgen/notifications.gen.go @@ -199,6 +199,11 @@ func newNotification(db *gorm.DB, opts ...gen.DOOption) notification { }{ RelationField: field.NewRelation("SourceNote.Creator", "models.User"), }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("SourceNote.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -541,6 +546,9 @@ type notificationBelongsToSourceNote struct { Creator struct { field.RelationField } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { diff --git a/storage-new/dbgen/reactions.gen.go b/storage-new/dbgen/reactions.gen.go index 4a4d57c..faef15f 100644 --- a/storage-new/dbgen/reactions.gen.go +++ b/storage-new/dbgen/reactions.gen.go @@ -259,6 +259,11 @@ func newReaction(db *gorm.DB, opts ...gen.DOOption) reaction { }, }, }, + Origin: struct { + field.RelationField + }{ + RelationField: field.NewRelation("Note.Origin", "models.RemoteServer"), + }, AttachmentRelations: struct { field.RelationField Note struct { @@ -529,6 +534,9 @@ type reactionBelongsToNote struct { } } } + Origin struct { + field.RelationField + } AttachmentRelations struct { field.RelationField Note struct { From a4ab7f02947c5d1721437618ab4d2cdf61869248 Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:32:38 +0200 Subject: [PATCH 4/7] Fix parsing error --- storage-new/models/NoteAccessLevelType.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage-new/models/NoteAccessLevelType.go b/storage-new/models/NoteAccessLevelType.go index b023675..1b45d71 100644 --- a/storage-new/models/NoteAccessLevelType.go +++ b/storage-new/models/NoteAccessLevelType.go @@ -24,6 +24,6 @@ func (n *NoteAccessLevel) Value() (driver.Value, error) { } func (ct *NoteAccessLevel) Scan(value any) error { - *ct = NoteAccessLevel(value.(uint8)) + *ct = NoteAccessLevel(value.(int64)) return nil } From a7dab0fe4358473141b2ba495e0ff846a2b757c1 Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:33:26 +0200 Subject: [PATCH 5/7] Add note interface --- cmd/model-gen/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/model-gen/main.go b/cmd/model-gen/main.go index a65089e..829ede7 100644 --- a/cmd/model-gen/main.go +++ b/cmd/model-gen/main.go @@ -49,6 +49,7 @@ func main() { g.ApplyInterface(func(models.INotification) {}, models.Notification{}) g.ApplyInterface(func(models.IUser) {}, models.User{}) g.ApplyInterface(func(models.IAccessToken) {}, models.AccessToken{}) + g.ApplyInterface(func(models.INote) {}, models.Note{}) log.Info().Msg("Extra features applied, starting generation") g.Execute() From 9990a205d82c13fad7e68f997ca50934b233ae0d Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:33:37 +0200 Subject: [PATCH 6/7] Fix interface name typo --- shared/interfaces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/interfaces.go b/shared/interfaces.go index f330a7c..af20351 100644 --- a/shared/interfaces.go +++ b/shared/interfaces.go @@ -4,6 +4,6 @@ type Clonable interface { Clone() Clonable } -type Santisable interface { +type Sanitisable interface { Sanitize() } From 671d18d2ba7cbff404aea487ff7cb11705a39c35 Mon Sep 17 00:00:00 2001 From: mstar Date: Tue, 8 Apr 2025 16:33:47 +0200 Subject: [PATCH 7/7] Add note info stuff to debug server. Also docs --- storage-new/self.go | 15 +++++++++++++-- web/debug/server.go | 11 +++++++++++ web/public/server.go | 26 ++++++++++++++++++++++++++ web/shared/User.go | 2 +- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/storage-new/self.go b/storage-new/self.go index b72a5ad..8e12888 100644 --- a/storage-new/self.go +++ b/storage-new/self.go @@ -7,7 +7,6 @@ import ( "git.mstar.dev/mstar/goutils/other" "github.com/google/uuid" - "github.com/rs/zerolog/log" "gorm.io/gorm" "git.mstar.dev/mstar/linstrom/config" @@ -27,7 +26,6 @@ func InsertSelf() error { if err != nil { return other.Error("storage", "failed to save/update self server", err) } - log.Debug().Any("server", server).Send() user, err := insertUser(server) if err != nil { return other.Error("storage", "failed to save/update self user", err) @@ -35,6 +33,9 @@ func InsertSelf() error { if err = insertUserPronoun(user); err != nil { return other.Error("storage", "failed to save/update self user pronoun", err) } + if err = attachUserToRole(user); err != nil { + return other.Error("storage", "failed to save/update self user to full admin role", err) + } return nil } @@ -152,3 +153,13 @@ func insertUserPronoun(user *models.User) error { return err } } + +func attachUserToRole(user *models.User) error { + u2r := models.UserToRole{ + User: *user, + UserId: user.ID, + Role: models.FullAdminRole, + RoleId: models.FullAdminRole.ID, + } + return dbgen.UserToRole.Save(&u2r) +} diff --git a/web/debug/server.go b/web/debug/server.go index 9042b56..e0afc95 100644 --- a/web/debug/server.go +++ b/web/debug/server.go @@ -1,3 +1,12 @@ +// Package webdebug provides a http server for local debugging. +// The server is explicitly for localhost only as it offers +// a lot more control and access than the public one. +// Additionally, there is no guarantee for functional authentication +// and authorisation of requests. +// Using it can be considered a security risk. +// +// There is no guarantee for API stability. It might change drastically +// across versions or even commits and doesn't need announcements package webdebug import ( @@ -16,6 +25,8 @@ func New() *Server { handler.HandleFunc("GET /non-deleted", getNonDeletedUsers) handler.HandleFunc("POST /local-user", createLocalUser) handler.HandleFunc("GET /delete", deleteUser) + handler.HandleFunc("POST /post-as", postAs) + handler.HandleFunc("GET /notes-for", notesFrom) web := http.Server{ Addr: DebugAddr, Handler: handler, diff --git a/web/public/server.go b/web/public/server.go index df8c3a6..53d8911 100644 --- a/web/public/server.go +++ b/web/public/server.go @@ -1,3 +1,29 @@ +// Package webpublic contains the public webserver +// which provides the primary and only intended access point +// for interacting with the system. +// +// # Sections +// +// - Frontend: Serves the various web frontend versions +// - Main: The original Linstrom specific frontend +// - NoJs: An entirely serverside rendered frontend, no JS included +// - Custom: Custom frontend files will be served here +// +// - API: Endpoints for the actual interactions +// - Frontend: The API used by the main frontend +// - Masto: Mastodon compatible adapter for internal structures +// - ActivityPub: For integration with the Fediverse via ActivityPub +// - Linstrom-RPC: For Linstrom to Linstrom server communication +// +// # Guarantees +// +// - The Masto and ActivityPub API will remain stable +// - Frontend API might change, but the intended consumer (Main frontend) +// will always be up to date with the changes +// - Linstrom-RPC API is versioned and will keep +// a few versions of backwards compatibility +// +// TODO: Decide how long the Linstrom-RPC API will remain backwards compatible package webpublic import "net/http" diff --git a/web/shared/User.go b/web/shared/User.go index 5c11fc4..01775ba 100644 --- a/web/shared/User.go +++ b/web/shared/User.go @@ -39,7 +39,7 @@ type User struct { } // Compiler assertations for interface implementations -var _ shared.Santisable = &User{} +var _ shared.Sanitisable = &User{} var _ shared.Clonable = &User{} func (u *User) Sanitize() {