summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-03-02 16:42:51 +0100
committerLibravatar GitHub <noreply@github.com>2025-03-02 16:42:51 +0100
commit8488ac928651656c6f7bebf5eaabce62c2b9fb66 (patch)
tree94357311026e5ed96862a647400375a4543dd815 /vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go
parent[chore] go-swagger -> codeberg (#3856) (diff)
downloadgotosocial-8488ac928651656c6f7bebf5eaabce62c2b9fb66.tar.xz
[chore] migrate oauth2 -> codeberg (#3857)
Diffstat (limited to 'vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go')
-rw-r--r--vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go b/vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go
new file mode 100644
index 000000000..65fda9ed6
--- /dev/null
+++ b/vendor/codeberg.org/superseriousbusiness/oauth2/v4/store.go
@@ -0,0 +1,36 @@
+package oauth2
+
+import "context"
+
+type (
+ // ClientStore the client information storage interface
+ ClientStore interface {
+ GetByID(ctx context.Context, id string) (ClientInfo, error)
+ Set(ctx context.Context, id string, cli ClientInfo) error
+ Delete(ctx context.Context, id string) error
+ }
+
+ // TokenStore the token information storage interface
+ TokenStore interface {
+ // create and store the new token information
+ Create(ctx context.Context, info TokenInfo) error
+
+ // delete the authorization code
+ RemoveByCode(ctx context.Context, code string) error
+
+ // use the access token to delete the token information
+ RemoveByAccess(ctx context.Context, access string) error
+
+ // use the refresh token to delete the token information
+ RemoveByRefresh(ctx context.Context, refresh string) error
+
+ // use the authorization code for token information data
+ GetByCode(ctx context.Context, code string) (TokenInfo, error)
+
+ // use the access token for token information data
+ GetByAccess(ctx context.Context, access string) (TokenInfo, error)
+
+ // use the refresh token for token information data
+ GetByRefresh(ctx context.Context, refresh string) (TokenInfo, error)
+ }
+)