diff options
| author | 2025-03-03 16:03:36 +0100 | |
|---|---|---|
| committer | 2025-03-03 15:03:36 +0000 | |
| commit | 1b37944f8b8eccc2afcfb0f603786209a3b7402d (patch) | |
| tree | 2bc0be27cf0405e16ac3e14efc3b6973eb096b8b /internal/db/application.go | |
| parent | bumps go-ffmpreg to v0.6.6 (#3866) (diff) | |
| download | gotosocial-1b37944f8b8eccc2afcfb0f603786209a3b7402d.tar.xz | |
[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
Diffstat (limited to 'internal/db/application.go')
| -rw-r--r-- | internal/db/application.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/internal/db/application.go b/internal/db/application.go index 1011698bf..9f0109d59 100644 --- a/internal/db/application.go +++ b/internal/db/application.go @@ -36,15 +36,6 @@ type Application interface { // DeleteApplicationByClientID deletes the application with corresponding client_id value from the database. DeleteApplicationByClientID(ctx context.Context, clientID string) error - // GetClientByID fetches the application client from database with ID. - GetClientByID(ctx context.Context, id string) (*gtsmodel.Client, error) - - // PutClient puts the given application client in the database. - PutClient(ctx context.Context, client *gtsmodel.Client) error - - // DeleteClientByID deletes the application client from database with ID. - DeleteClientByID(ctx context.Context, id string) error - // GetAllTokens fetches all client oauth tokens from database. GetAllTokens(ctx context.Context) ([]*gtsmodel.Token, error) @@ -63,6 +54,9 @@ type Application interface { // PutToken puts given client oauth token in the database. PutToken(ctx context.Context, token *gtsmodel.Token) error + // UpdateToken updates the given token. Update all columns if no specific columns given. + UpdateToken(ctx context.Context, token *gtsmodel.Token, columns ...string) error + // DeleteTokenByID deletes client oauth token from database with ID. DeleteTokenByID(ctx context.Context, id string) error |
