github

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth2Client

type OAuth2Client interface {
	AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
	Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
	Client(ctx context.Context, t *oauth2.Token) *http.Client
}

OAuth2Client is our abstraction of communication with an OAuth2 Provider.

type Server

type Server struct {
	auth.UnimplementedAuthenticationMethodGithubServiceServer
	// contains filtered or unexported fields
}

Server is an Github server side handler.

func NewServer

func NewServer(
	logger *zap.Logger,
	store storageauth.Store,
	config config.AuthenticationConfig,
) *Server

NewServer constructs a Server.

func (*Server) AuthorizeURL

AuthorizeURL will return a URL for the client to redirect to for completion of the OAuth flow with GitHub.

func (*Server) Callback

Callback is the OAuth callback method for Github authentication. It will take in a Code which is the OAuth grant passed in by the OAuth service, and exchange the grant with an Authentication that includes the user information.

func (*Server) RegisterGRPC

func (s *Server) RegisterGRPC(server *grpc.Server)

RegisterGRPC registers the server as an Server on the provided grpc server.

func (*Server) SkipsAuthentication

func (s *Server) SkipsAuthentication(ctx context.Context) bool

Jump to

Keyboard shortcuts

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