provider.go 659 B

12345678910111213141516171819202122
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package oauth2 // import "miniflux.app/v2/internal/oauth2"
  4. import (
  5. "context"
  6. "golang.org/x/oauth2"
  7. "miniflux.app/v2/internal/model"
  8. )
  9. // Provider is an interface for OAuth2 providers.
  10. type Provider interface {
  11. GetConfig() *oauth2.Config
  12. GetUserExtraKey() string
  13. GetProfile(ctx context.Context, code, codeVerifier string) (*Profile, error)
  14. PopulateUserCreationWithProfileID(user *model.UserCreationRequest, profile *Profile)
  15. PopulateUserWithProfileID(user *model.User, profile *Profile)
  16. UnsetUserProfileID(user *model.User)
  17. }