mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-01 19:36:32 +02:00
* core/identity: add data store for thread-safe storage of sessions and users * wip * add test * wip * clean up context * fix nil session error * add stop message * remove log * use origin context * use base context for manager calls * use manager context for syncers too * add runtime flag * rename legacy lease * add comment * use NotSame * add comment * Update internal/identity/manager/manager.go Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com> * lint --------- Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
28 lines
684 B
Go
28 lines
684 B
Go
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
|
|
}
|