Documentation ¶
Index ¶
Constants ¶
View Source
const ( AuthorizationKey = "authorization" BearerPrefix = "Bearer " )
Variables ¶
View Source
var ( AnonymousUserInfo = UserInfo{Role: RoleAnonymous, User: "anonymous"} NoauthUserInfo = UserInfo{Role: RoleAdmin, User: "auth-disabled"} )
View Source
var ErrZeroVerifiedChains = errors.New("AuthProvider could not find a client cert.")
View Source
var ErrZeroVerifiedChains2 = errors.New("AuthProvider requires len(VerifiedChains[0]) > 0.")
Functions ¶
func ContextWithUserInfo ¶
func IsValidRoleStr ¶
Types ¶
type AuthProvider ¶
type AuthProvider struct {
Disabled bool
}
func (AuthProvider) UnaryServerInterceptor ¶
func (p AuthProvider) UnaryServerInterceptor() grpc.UnaryServerInterceptor
type UserInfo ¶
func UserInfoFromClientCert ¶
func UserInfoFromClientCert(cert *x509.Certificate) UserInfo
func UserInfoFromContext ¶
func UserInfoFromTLSConnectionState ¶
func UserInfoFromTLSConnectionState(tcs *tls.ConnectionState) (UserInfo, error)
Click to show internal directories.
Click to hide internal directories.