Documentation ¶
Index ¶
- type OAuth2Client
- type Server
- func (s *Server) AuthorizeURL(ctx context.Context, req *auth.AuthorizeURLRequest) (*auth.AuthorizeURLResponse, error)
- func (s *Server) Callback(ctx context.Context, r *auth.CallbackRequest) (*auth.CallbackResponse, error)
- func (s *Server) RegisterGRPC(server *grpc.Server)
- func (s *Server) SkipsAuthentication(ctx context.Context) bool
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 ¶
func (s *Server) AuthorizeURL(ctx context.Context, req *auth.AuthorizeURLRequest) (*auth.AuthorizeURLResponse, error)
AuthorizeURL will return a URL for the client to redirect to for completion of the OAuth flow with GitHub.
func (*Server) Callback ¶
func (s *Server) Callback(ctx context.Context, r *auth.CallbackRequest) (*auth.CallbackResponse, error)
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 ¶
RegisterGRPC registers the server as an Server on the provided grpc server.
Click to show internal directories.
Click to hide internal directories.