provider.go 653 B

123456789101112131415161718192021
  1. // Copyright 2017 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package oauth2 // import "miniflux.app/oauth2"
  5. import (
  6. "context"
  7. "miniflux.app/model"
  8. )
  9. // Provider is an interface for OAuth2 providers.
  10. type Provider interface {
  11. GetUserExtraKey() string
  12. GetRedirectURL(state string) string
  13. GetProfile(ctx context.Context, code string) (*Profile, error)
  14. PopulateUserCreationWithProfileID(user *model.UserCreationRequest, profile *Profile)
  15. PopulateUserWithProfileID(user *model.User, profile *Profile)
  16. UnsetUserProfileID(user *model.User)
  17. }