Documentation
¶
Index ¶
- Constants
- func NewAuthServiceHandler(svc AuthServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AuthServiceClient
- type AuthServiceHandler
- type UnimplementedAuthServiceHandler
- func (UnimplementedAuthServiceHandler) CompleteEmailSignIn(context.Context, *connect.Request[v1.CompleteEmailSignInRequest]) (*connect.Response[v1.CompleteEmailSignInResponse], error)
- func (UnimplementedAuthServiceHandler) ExchangeAuthorizationCode(context.Context, *connect.Request[v1.ExchangeAuthorizationCodeRequest]) (*connect.Response[v1.ExchangeAuthorizationCodeResponse], error)
- func (UnimplementedAuthServiceHandler) GetMe(context.Context, *connect.Request[v1.GetMeRequest]) (*connect.Response[v1.GetMeResponse], error)
- func (UnimplementedAuthServiceHandler) ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
- func (UnimplementedAuthServiceHandler) PollDeviceSignIn(context.Context, *connect.Request[v1.PollDeviceSignInRequest]) (*connect.Response[v1.PollDeviceSignInResponse], error)
- func (UnimplementedAuthServiceHandler) Refresh(context.Context, *connect.Request[v1.RefreshRequest]) (*connect.Response[v1.RefreshResponse], error)
- func (UnimplementedAuthServiceHandler) RevokeSession(context.Context, *connect.Request[v1.RevokeSessionRequest]) (*connect.Response[v1.RevokeSessionResponse], error)
- func (UnimplementedAuthServiceHandler) SignOut(context.Context, *connect.Request[v1.SignOutRequest]) (*connect.Response[v1.SignOutResponse], error)
- func (UnimplementedAuthServiceHandler) StartDeviceSignIn(context.Context, *connect.Request[v1.StartDeviceSignInRequest]) (*connect.Response[v1.StartDeviceSignInResponse], error)
- func (UnimplementedAuthServiceHandler) StartEmailSignIn(context.Context, *connect.Request[v1.StartEmailSignInRequest]) (*connect.Response[v1.StartEmailSignInResponse], error)
Constants ¶
const ( // AuthServiceStartEmailSignInProcedure is the fully-qualified name of the AuthService's // StartEmailSignIn RPC. AuthServiceStartEmailSignInProcedure = "/devopus.auth.v1.AuthService/StartEmailSignIn" // AuthServiceCompleteEmailSignInProcedure is the fully-qualified name of the AuthService's // CompleteEmailSignIn RPC. AuthServiceCompleteEmailSignInProcedure = "/devopus.auth.v1.AuthService/CompleteEmailSignIn" // AuthServiceExchangeAuthorizationCodeProcedure is the fully-qualified name of the AuthService's // ExchangeAuthorizationCode RPC. AuthServiceExchangeAuthorizationCodeProcedure = "/devopus.auth.v1.AuthService/ExchangeAuthorizationCode" // AuthServiceStartDeviceSignInProcedure is the fully-qualified name of the AuthService's // StartDeviceSignIn RPC. AuthServiceStartDeviceSignInProcedure = "/devopus.auth.v1.AuthService/StartDeviceSignIn" // AuthServicePollDeviceSignInProcedure is the fully-qualified name of the AuthService's // PollDeviceSignIn RPC. AuthServicePollDeviceSignInProcedure = "/devopus.auth.v1.AuthService/PollDeviceSignIn" // AuthServiceRefreshProcedure is the fully-qualified name of the AuthService's Refresh RPC. AuthServiceRefreshProcedure = "/devopus.auth.v1.AuthService/Refresh" // AuthServiceSignOutProcedure is the fully-qualified name of the AuthService's SignOut RPC. AuthServiceSignOutProcedure = "/devopus.auth.v1.AuthService/SignOut" // AuthServiceGetMeProcedure is the fully-qualified name of the AuthService's GetMe RPC. AuthServiceGetMeProcedure = "/devopus.auth.v1.AuthService/GetMe" // AuthServiceListSessionsProcedure is the fully-qualified name of the AuthService's ListSessions // RPC. AuthServiceListSessionsProcedure = "/devopus.auth.v1.AuthService/ListSessions" // AuthServiceRevokeSessionProcedure is the fully-qualified name of the AuthService's RevokeSession // RPC. AuthServiceRevokeSessionProcedure = "/devopus.auth.v1.AuthService/RevokeSession" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// AuthServiceName is the fully-qualified name of the AuthService service.
AuthServiceName = "devopus.auth.v1.AuthService"
)
Variables ¶
This section is empty.
Functions ¶
func NewAuthServiceHandler ¶
func NewAuthServiceHandler(svc AuthServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewAuthServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type AuthServiceClient ¶
type AuthServiceClient interface {
// StartEmailSignIn sends a one-time code to an email that may sign in here: on a
// platform, its owner, its members and the invited. The answer is the same for any
// email; to others no email goes, and their code never works.
StartEmailSignIn(context.Context, *connect.Request[v1.StartEmailSignInRequest]) (*connect.Response[v1.StartEmailSignInResponse], error)
// CompleteEmailSignIn checks the code and opens a session. The first sign-in of an
// email makes its account: there is no registration.
CompleteEmailSignIn(context.Context, *connect.Request[v1.CompleteEmailSignInRequest]) (*connect.Response[v1.CompleteEmailSignInResponse], error)
// ExchangeAuthorizationCode finishes the browser sign-in (OAuth 2.0 authorization
// code with PKCE): the code came to the CLI's callback on 127.0.0.1.
ExchangeAuthorizationCode(context.Context, *connect.Request[v1.ExchangeAuthorizationCodeRequest]) (*connect.Response[v1.ExchangeAuthorizationCodeResponse], error)
// StartDeviceSignIn begins the device flow (RFC 8628) for a machine without a
// browser: the person confirms the user code on another device.
StartDeviceSignIn(context.Context, *connect.Request[v1.StartDeviceSignInRequest]) (*connect.Response[v1.StartDeviceSignInResponse], error)
// PollDeviceSignIn opens the session once the user code is confirmed.
PollDeviceSignIn(context.Context, *connect.Request[v1.PollDeviceSignInRequest]) (*connect.Response[v1.PollDeviceSignInResponse], error)
// Refresh trades a refresh token for new tokens. Every refresh token works once: a
// token used again revokes its whole session.
Refresh(context.Context, *connect.Request[v1.RefreshRequest]) (*connect.Response[v1.RefreshResponse], error)
// SignOut revokes the session of a refresh token.
SignOut(context.Context, *connect.Request[v1.SignOutRequest]) (*connect.Response[v1.SignOutResponse], error)
// GetMe is the signed-in user and the current session. Signed in.
GetMe(context.Context, *connect.Request[v1.GetMeRequest]) (*connect.Response[v1.GetMeResponse], error)
// ListSessions lists the user's live sessions. Signed in.
ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
// RevokeSession ends one of the user's sessions. Signed in.
RevokeSession(context.Context, *connect.Request[v1.RevokeSessionRequest]) (*connect.Response[v1.RevokeSessionResponse], error)
}
AuthServiceClient is a client for the devopus.auth.v1.AuthService service.
func NewAuthServiceClient ¶
func NewAuthServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthServiceClient
NewAuthServiceClient constructs a client for the devopus.auth.v1.AuthService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type AuthServiceHandler ¶
type AuthServiceHandler interface {
// StartEmailSignIn sends a one-time code to an email that may sign in here: on a
// platform, its owner, its members and the invited. The answer is the same for any
// email; to others no email goes, and their code never works.
StartEmailSignIn(context.Context, *connect.Request[v1.StartEmailSignInRequest]) (*connect.Response[v1.StartEmailSignInResponse], error)
// CompleteEmailSignIn checks the code and opens a session. The first sign-in of an
// email makes its account: there is no registration.
CompleteEmailSignIn(context.Context, *connect.Request[v1.CompleteEmailSignInRequest]) (*connect.Response[v1.CompleteEmailSignInResponse], error)
// ExchangeAuthorizationCode finishes the browser sign-in (OAuth 2.0 authorization
// code with PKCE): the code came to the CLI's callback on 127.0.0.1.
ExchangeAuthorizationCode(context.Context, *connect.Request[v1.ExchangeAuthorizationCodeRequest]) (*connect.Response[v1.ExchangeAuthorizationCodeResponse], error)
// StartDeviceSignIn begins the device flow (RFC 8628) for a machine without a
// browser: the person confirms the user code on another device.
StartDeviceSignIn(context.Context, *connect.Request[v1.StartDeviceSignInRequest]) (*connect.Response[v1.StartDeviceSignInResponse], error)
// PollDeviceSignIn opens the session once the user code is confirmed.
PollDeviceSignIn(context.Context, *connect.Request[v1.PollDeviceSignInRequest]) (*connect.Response[v1.PollDeviceSignInResponse], error)
// Refresh trades a refresh token for new tokens. Every refresh token works once: a
// token used again revokes its whole session.
Refresh(context.Context, *connect.Request[v1.RefreshRequest]) (*connect.Response[v1.RefreshResponse], error)
// SignOut revokes the session of a refresh token.
SignOut(context.Context, *connect.Request[v1.SignOutRequest]) (*connect.Response[v1.SignOutResponse], error)
// GetMe is the signed-in user and the current session. Signed in.
GetMe(context.Context, *connect.Request[v1.GetMeRequest]) (*connect.Response[v1.GetMeResponse], error)
// ListSessions lists the user's live sessions. Signed in.
ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
// RevokeSession ends one of the user's sessions. Signed in.
RevokeSession(context.Context, *connect.Request[v1.RevokeSessionRequest]) (*connect.Response[v1.RevokeSessionResponse], error)
}
AuthServiceHandler is an implementation of the devopus.auth.v1.AuthService service.
type UnimplementedAuthServiceHandler ¶
type UnimplementedAuthServiceHandler struct{}
UnimplementedAuthServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedAuthServiceHandler) CompleteEmailSignIn ¶
func (UnimplementedAuthServiceHandler) CompleteEmailSignIn(context.Context, *connect.Request[v1.CompleteEmailSignInRequest]) (*connect.Response[v1.CompleteEmailSignInResponse], error)
func (UnimplementedAuthServiceHandler) ExchangeAuthorizationCode ¶
func (UnimplementedAuthServiceHandler) ExchangeAuthorizationCode(context.Context, *connect.Request[v1.ExchangeAuthorizationCodeRequest]) (*connect.Response[v1.ExchangeAuthorizationCodeResponse], error)
func (UnimplementedAuthServiceHandler) GetMe ¶
func (UnimplementedAuthServiceHandler) GetMe(context.Context, *connect.Request[v1.GetMeRequest]) (*connect.Response[v1.GetMeResponse], error)
func (UnimplementedAuthServiceHandler) ListSessions ¶
func (UnimplementedAuthServiceHandler) ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
func (UnimplementedAuthServiceHandler) PollDeviceSignIn ¶
func (UnimplementedAuthServiceHandler) PollDeviceSignIn(context.Context, *connect.Request[v1.PollDeviceSignInRequest]) (*connect.Response[v1.PollDeviceSignInResponse], error)
func (UnimplementedAuthServiceHandler) Refresh ¶
func (UnimplementedAuthServiceHandler) Refresh(context.Context, *connect.Request[v1.RefreshRequest]) (*connect.Response[v1.RefreshResponse], error)
func (UnimplementedAuthServiceHandler) RevokeSession ¶
func (UnimplementedAuthServiceHandler) RevokeSession(context.Context, *connect.Request[v1.RevokeSessionRequest]) (*connect.Response[v1.RevokeSessionResponse], error)
func (UnimplementedAuthServiceHandler) SignOut ¶
func (UnimplementedAuthServiceHandler) SignOut(context.Context, *connect.Request[v1.SignOutRequest]) (*connect.Response[v1.SignOutResponse], error)
func (UnimplementedAuthServiceHandler) StartDeviceSignIn ¶
func (UnimplementedAuthServiceHandler) StartDeviceSignIn(context.Context, *connect.Request[v1.StartDeviceSignInRequest]) (*connect.Response[v1.StartDeviceSignInResponse], error)
func (UnimplementedAuthServiceHandler) StartEmailSignIn ¶
func (UnimplementedAuthServiceHandler) StartEmailSignIn(context.Context, *connect.Request[v1.StartEmailSignInRequest]) (*connect.Response[v1.StartEmailSignInResponse], error)