all repos

onasty @ b3a528af9e74a124dbb79687ebb116ce8a8c8e8c

a one-time notes service

onasty/e2e/oauth_provider_mock_test.go(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package e2e_test

import (
	"context"

	"github.com/olexsmir/onasty/internal/oauth"
)

var _ oauth.Provider = (*oauthProviderStub)(nil)

type oauthProviderStub struct{}

func newOauthProviderStub() *oauthProviderStub {
	return &oauthProviderStub{}
}

func (o *oauthProviderStub) GetAuthURL(_ string) string {
	return "https://example.com/oauth/authorize"
}

func (o *oauthProviderStub) ExchangeCode(_ context.Context, _ string) (oauth.UserInfo, error) {
	return oauth.UserInfo{
		Provider:      "google",
		ProviderID:    "1234567890",
		Email:         "testing@mail.org",
		EmailVerified: false,
	}, nil
}