OAuth: Use the attached external session data in OAuthToken and OAuthTokenSync (#96655)
* wip * wip + tests * wip * wip opt2 * Use authn.Identity struct's SessionToken * Merge fixes * Handle disabling the feature flag correctly * Fix test * Cleanup * Remove HasOAuthEntry from the OAuthTokenService interface * Remove unused function
This commit is contained in:
@@ -3,6 +3,8 @@ package auth
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
type ExternalSession struct {
|
||||
@@ -43,6 +45,10 @@ func (e *ExternalSession) Clone() *ExternalSession {
|
||||
}
|
||||
}
|
||||
|
||||
type UpdateExternalSessionCommand struct {
|
||||
Token *oauth2.Token
|
||||
}
|
||||
|
||||
type ListExternalSessionQuery struct {
|
||||
ID int64
|
||||
NameID string
|
||||
@@ -57,6 +63,8 @@ type ExternalSessionStore interface {
|
||||
List(ctx context.Context, query *ListExternalSessionQuery) ([]*ExternalSession, error)
|
||||
// Create creates a new external session for a user
|
||||
Create(ctx context.Context, extSesion *ExternalSession) error
|
||||
// Update updates an external session
|
||||
Update(ctx context.Context, ID int64, cmd *UpdateExternalSessionCommand) error
|
||||
// Delete deletes an external session
|
||||
Delete(ctx context.Context, ID int64) error
|
||||
// DeleteExternalSessionsByUserID deletes an external session
|
||||
|
||||
Reference in New Issue
Block a user