passport

package
v0.0.0-...-0172641 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2020 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeyPrivate

func GetKeyPrivate() (*rsa.PrivateKey, error)

GetKeyPrivate reads a private PEM formatted RSA cert

func GetKeyPublic

func GetKeyPublic() (*rsa.PublicKey, error)

GetKeyPublic reads a public PEM formatted RSA cert

func MakeNewRefresh

func MakeNewRefresh() *string

MakeNewRefresh creates a new refresh token

func MakeNewToken

func MakeNewToken(extraClaims map[string]interface{}) (*string, *jwt.Token, error)

MakeNewToken creates a new JWT token for the specific user

func MakeTestToken

func MakeTestToken(user *users.User) (string, error)

MakeTestToken makes a temporary JWT token which expires in 4

*seconds specifically for testing purposes

func RandomString

func RandomString(n int) string

RandomString generates a n lengthed string (cryptographically)

func RunGRPC

func RunGRPC(port int, tlsdir string)

RunGRPC starts the GRPC server

func UserClaims

func UserClaims(user *users.User) map[string]interface{}

UserClaims takes in a user and applies the standard user claims

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server basic Server construct

func NewServer

func NewServer() *Server

NewServer creates a ne struct to interface the auth server

func (*Server) Authenticate

func (s *Server) Authenticate(ctx context.Context, request *pb.AuthRequest) (*pb.AuthResponse, error)

Authenticate takes in oneof a authentication types and tries to generate tokens

func (*Server) Refresh

Refresh allows the creation of a auth token given a refresh token validating the refresh token has not been used before and has not expired

func (*Server) RevokeToken

func (s *Server) RevokeToken(ctx context.Context, request *pb.Revoke) (*pb.Empty, error)

RevokeToken adds a token to the revoked tokens list

func (*Server) SocialLogin

func (s *Server) SocialLogin(ctx context.Context, request *pb.SocialRequest) (*pb.AuthResponse, error)

SocialLogin validates remote idP tokens and creates users and passes back auth tokens

func (*Server) VerifyToken

func (s *Server) VerifyToken(ctx context.Context, request *pb.VerifyTokenRequest) (*pb.VerifyTokenResponse, error)

VerifyToken takes in a VerifyTokenRequest, validates the token in that request

Directories

Path Synopsis
Package evntsrc_passport is a generated protocol buffer package.
Package evntsrc_passport is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL