ContainerImage.Pinniped/internal/mocks/mocktokenauthenticatorcloser/generate.go
Andrew Keesler e0ee18a993
Always close JWTAuthenticator underlying authenticator
Otherwise we will leak goroutines.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
2020-12-08 15:41:48 -05:00

22 lines
813 B
Go

// Copyright 2020 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package mocktokenauthenticatorcloser
import (
"k8s.io/apiserver/pkg/authentication/authenticator"
pinnipedauthenticator "go.pinniped.dev/internal/controller/authenticator"
)
//go:generate go run -v github.com/golang/mock/mockgen -destination=mocktokenauthenticatorcloser.go -package=mocktokenauthenticatorcloser -copyright_file=../../../hack/header.txt . TokenAuthenticatorCloser
// TokenAuthenticatorCloser is a type that can authenticate tokens and be closed idempotently.
//
// This type is slightly different from io.Closer, because io.Closer can return an error and is not
// necessarily idempotent.
type TokenAuthenticatorCloser interface {
authenticator.Token
pinnipedauthenticator.Closer
}