Documentation ¶
Index ¶
- Constants
- func AuthFromGrpcContext() grpctransport.ClientRequestFunc
- func AuthGuard(next http.Handler) http.HandlerFunc
- func AuthToGrpcContext() grpctransport.ServerRequestFunc
- func BasicAuthGuard(next http.Handler) http.HandlerFunc
- func BasicAuthToHTTPContext() httptransport.RequestFunc
- func BasicAuthToHTTPRequest(username, password string) httptransport.RequestFunc
- func CookieToHTTPContext(logger log.Logger, keyFunc stdjwt.Keyfunc, sc *securecookie.SecureCookie) httptransport.RequestFunc
- func CookieToHTTPRequest() httptransport.RequestFunc
- func FromGrpcContext() grpctransport.ClientRequestFunc
- func JwtAuthGuard(next http.Handler) http.HandlerFunc
- func LoginCookieToHTTPContext(logger log.Logger, keyFunc stdjwt.Keyfunc, sc *securecookie.SecureCookie) httptransport.RequestFunc
- func MakeClaimsToken(uid string) *stdjwt.Token
- func MakeRefreshToken(_, uid, role string, key []byte) (string, error)
- func MakeToken(_, uid, name, email string, key []byte) (string, error)
- func StreamIntercepter(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func ToGrpcContext() grpctransport.ServerRequestFunc
- func UnaryIntercepter(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- type AmazonResponse
- type CustomClaims
- type GoogleResponse
- type MicrosoftResponse
- type Provider
- type UserInfo
Constants ¶
View Source
const ( ProviderGoogle = "google" GoogleURL = "https://www.googleapis.com/oauth2/v2/userinfo?access_token=%s" ProviderAmazon = "amazon" AmazonURL = "https://api.amazon.com/user/profile?access_token=%s" ProviderMicrosoft = "microsoft" MicrosoftURL = "https://apis.live.net/v5.0/me?access_token=%s" )
Variables ¶
This section is empty.
Functions ¶
func AuthFromGrpcContext ¶
func AuthFromGrpcContext() grpctransport.ClientRequestFunc
func AuthToGrpcContext ¶
func AuthToGrpcContext() grpctransport.ServerRequestFunc
func BasicAuthGuard ¶
func BasicAuthGuard(next http.Handler) http.HandlerFunc
func BasicAuthToHTTPContext ¶
func BasicAuthToHTTPContext() httptransport.RequestFunc
func BasicAuthToHTTPRequest ¶
func BasicAuthToHTTPRequest(username, password string) httptransport.RequestFunc
func CookieToHTTPContext ¶
func CookieToHTTPContext(logger log.Logger, keyFunc stdjwt.Keyfunc, sc *securecookie.SecureCookie) httptransport.RequestFunc
func CookieToHTTPRequest ¶
func CookieToHTTPRequest() httptransport.RequestFunc
func FromGrpcContext ¶
func FromGrpcContext() grpctransport.ClientRequestFunc
func JwtAuthGuard ¶
func JwtAuthGuard(next http.Handler) http.HandlerFunc
func LoginCookieToHTTPContext ¶
func LoginCookieToHTTPContext(logger log.Logger, keyFunc stdjwt.Keyfunc, sc *securecookie.SecureCookie) httptransport.RequestFunc
func MakeClaimsToken ¶
func StreamIntercepter ¶
func StreamIntercepter(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func ToGrpcContext ¶
func ToGrpcContext() grpctransport.ServerRequestFunc
func UnaryIntercepter ¶
func UnaryIntercepter(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Types ¶
type AmazonResponse ¶
type CustomClaims ¶
type CustomClaims struct { //Kid string `json:"kid"` Username string `json:"username"` Email string `json:"email"` Role string `json:"role"` stdjwt.StandardClaims }
func (CustomClaims) Valid ¶
func (c CustomClaims) Valid() error
func (CustomClaims) VerifyUsername ¶
func (c CustomClaims) VerifyUsername(u string) bool
type GoogleResponse ¶
type MicrosoftResponse ¶
Click to show internal directories.
Click to hide internal directories.