core/identity: dynamic authenticator registration (#5105)

This commit is contained in:
Caleb Doxsey 2024-05-07 16:45:39 -06:00 committed by GitHub
parent 4031f4a962
commit d225288ab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 141 additions and 135 deletions

View file

@ -1,28 +0,0 @@
package manager
import (
"context"
"golang.org/x/oauth2"
"github.com/pomerium/pomerium/internal/identity/identity"
)
type mockAuthenticator struct {
refreshResult *oauth2.Token
refreshError error
revokeError error
updateUserInfoError error
}
func (mock *mockAuthenticator) Refresh(_ context.Context, _ *oauth2.Token, _ identity.State) (*oauth2.Token, error) {
return mock.refreshResult, mock.refreshError
}
func (mock *mockAuthenticator) Revoke(_ context.Context, _ *oauth2.Token) error {
return mock.revokeError
}
func (mock *mockAuthenticator) UpdateUserInfo(_ context.Context, _ *oauth2.Token, _ any) error {
return mock.updateUserInfoError
}