From 1b37944f8b8eccc2afcfb0f603786209a3b7402d Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:03:36 +0100 Subject: [feature] Refactor tokens, allow multiple app redirect_uris (#3849) * [feature] Refactor tokens, allow multiple app redirect_uris * move + tweak handlers a bit * return error for unset oauth2.ClientStore funcs * wrap UpdateToken with cache * panic handling * cheeky little time optimization * unlock on error --- internal/cache/size.go | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'internal/cache/size.go') diff --git a/internal/cache/size.go b/internal/cache/size.go index c96a3cd2e..1c8c5fe2e 100644 --- a/internal/cache/size.go +++ b/internal/cache/size.go @@ -302,15 +302,14 @@ func sizeofAccountStats() uintptr { func sizeofApplication() uintptr { return uintptr(size.Of(>smodel.Application{ - ID: exampleID, - CreatedAt: exampleTime, - UpdatedAt: exampleTime, - Name: exampleUsername, - Website: exampleURI, - RedirectURI: exampleURI, - ClientID: exampleID, - ClientSecret: exampleID, - Scopes: exampleTextSmall, + ID: exampleID, + Name: exampleUsername, + Website: exampleURI, + RedirectURIs: []string{exampleURI}, + ClientID: exampleID, + ClientSecret: exampleID, + Scopes: exampleTextSmall, + ManagedByUserID: exampleID, })) } @@ -325,17 +324,6 @@ func sizeofBlock() uintptr { })) } -func sizeofClient() uintptr { - return uintptr(size.Of(>smodel.Client{ - ID: exampleID, - CreatedAt: exampleTime, - UpdatedAt: exampleTime, - Secret: exampleID, - Domain: exampleURI, - UserID: exampleID, - })) -} - func sizeofConversation() uintptr { return uintptr(size.Of(>smodel.Conversation{ ID: exampleID, @@ -752,8 +740,7 @@ func sizeofThreadMute() uintptr { func sizeofToken() uintptr { return uintptr(size.Of(>smodel.Token{ ID: exampleID, - CreatedAt: exampleTime, - UpdatedAt: exampleTime, + LastUsed: exampleTime, ClientID: exampleID, UserID: exampleID, RedirectURI: exampleURI, -- cgit v1.2.3