Documentation
¶
Overview ¶
Copyright © 2023 NAME HERE cosmo-workspace
Index ¶
- func ErrResponse(log *clog.Logger, err error) error
- func Execute()
- func NewForbidden(err error) error
- func NewRootCmd(o *options) *cobra.Command
- type HTTPRequestLogger
- type InClusterServeFiles
- type InClusterServer
- type Server
- func (s *Server) AuthServiceHandler(mux *http.ServeMux)
- func (s *Server) BeginLogin(ctx context.Context, req *connect_go.Request[dashv1alpha1.BeginLoginRequest]) (*connect_go.Response[dashv1alpha1.BeginLoginResponse], error)
- func (s *Server) BeginRegistration(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.BeginRegistrationResponse], error)
- func (s *Server) CreateSession(w http.ResponseWriter, r *http.Request, sesInfo session.Info) error
- func (s *Server) CreateUser(ctx context.Context, req *connect_go.Request[dashv1alpha1.CreateUserRequest]) (*connect_go.Response[dashv1alpha1.CreateUserResponse], error)
- func (s *Server) CreateWorkspace(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.CreateWorkspaceResponse], error)
- func (s *Server) DeleteCredential(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.DeleteCredentialResponse], error)
- func (s *Server) DeleteNetworkRule(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.DeleteNetworkRuleResponse], error)
- func (s *Server) DeleteUser(ctx context.Context, req *connect_go.Request[dashv1alpha1.DeleteUserRequest]) (*connect_go.Response[dashv1alpha1.DeleteUserResponse], error)
- func (s *Server) DeleteWorkspace(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.DeleteWorkspaceResponse], error)
- func (s *Server) FinishLogin(ctx context.Context, req *connect_go.Request[dashv1alpha1.FinishLoginRequest]) (*connect_go.Response[dashv1alpha1.FinishLoginResponse], error)
- func (s *Server) FinishRegistration(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.FinishRegistrationResponse], error)
- func (s *Server) GetEvents(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetEventsRequest]) (*connect_go.Response[dashv1alpha1.GetEventsResponse], error)
- func (s *Server) GetUser(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetUserRequest]) (*connect_go.Response[dashv1alpha1.GetUserResponse], error)
- func (s *Server) GetUserAddonTemplates(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.GetUserAddonTemplatesResponse], error)
- func (s *Server) GetUsers(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetUsersRequest]) (*connect_go.Response[dashv1alpha1.GetUsersResponse], error)
- func (s *Server) GetWorkspace(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetWorkspaceRequest]) (*connect_go.Response[dashv1alpha1.GetWorkspaceResponse], error)
- func (s *Server) GetWorkspaceTemplates(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.GetWorkspaceTemplatesResponse], error)
- func (s *Server) GetWorkspaces(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.GetWorkspacesResponse], error)
- func (s *Server) ListCredentials(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.ListCredentialsResponse], error)
- func (s *Server) Login(ctx context.Context, req *connect_go.Request[dashv1alpha1.LoginRequest]) (*connect_go.Response[dashv1alpha1.LoginResponse], error)
- func (s *Server) Logout(ctx context.Context, req *connect_go.Request[emptypb.Empty]) (*connect_go.Response[emptypb.Empty], error)
- func (s *Server) ServiceAccountLogin(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.LoginResponse], error)
- func (s *Server) SessionInfo(userName string) (session.Info, time.Time)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) StreamServiceHandler(mux *http.ServeMux)
- func (s *Server) StreamingEvents(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetEventsRequest], ...) error
- func (s *Server) TemplateServiceHandler(mux *http.ServeMux)
- func (s *Server) UpdateCredential(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpdateCredentialResponse], error)
- func (s *Server) UpdateUserAddons(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpdateUserAddonsResponse], error)
- func (s *Server) UpdateUserDisplayName(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpdateUserDisplayNameResponse], error)
- func (s *Server) UpdateUserPassword(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpdateUserPasswordResponse], error)
- func (s *Server) UpdateUserRole(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpdateUserRoleResponse], error)
- func (s *Server) UpdateWorkspace(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpdateWorkspaceResponse], error)
- func (s *Server) UpsertNetworkRule(ctx context.Context, ...) (*connect_go.Response[dashv1alpha1.UpsertNetworkRuleResponse], error)
- func (s *Server) UserServiceHandler(mux *http.ServeMux)
- func (s *Server) Verify(ctx context.Context, req *connect_go.Request[emptypb.Empty]) (*connect_go.Response[dashv1alpha1.VerifyResponse], error)
- func (s *Server) WebAuthnServiceHandler(mux *http.ServeMux)
- func (s *Server) WorkspaceServiceHandler(mux *http.ServeMux)
- type StoreStatusResponseWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewForbidden ¶
func NewRootCmd ¶ added in v0.9.0
Types ¶
type HTTPRequestLogger ¶
func NewHTTPRequestLogger ¶
func NewHTTPRequestLogger(logr *clog.Logger) HTTPRequestLogger
func (HTTPRequestLogger) Middleware ¶
func (l HTTPRequestLogger) Middleware(next http.Handler) http.Handler
type InClusterServeFiles ¶
type InClusterServeFiles struct {
CAFile string
}
type InClusterServer ¶
type InClusterServer struct { Log *clog.Logger StaticFileDir string Port int // contains filtered or unexported fields }
InClusterServer serves certificate for incluster workspace It implements https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Runnable
func NewInClusterServer ¶
func NewInClusterServer(log *clog.Logger, port int, f InClusterServeFiles) (*InClusterServer, error)
type Server ¶
type Server struct { Log *clog.Logger Klient kosmo.Client GracefulShutdownDur time.Duration ResponseTimeout time.Duration StaticFileDir string Port int MaxAgeSeconds int TLSPrivateKeyPath string TLSCertPath string Insecure bool CookieDomain string CookieHashKey string CookieBlockKey string CookieSessionName string Authorizers map[cosmov1alpha1.UserAuthType]auth.Authorizer // contains filtered or unexported fields }
Server serves dashboard APIs and UI static files It implements https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Runnable
func (*Server) AuthServiceHandler ¶ added in v0.8.0
func (*Server) BeginLogin ¶
func (s *Server) BeginLogin(ctx context.Context, req *connect_go.Request[dashv1alpha1.BeginLoginRequest]) (*connect_go.Response[dashv1alpha1.BeginLoginResponse], error)
BeginLogin is proto interface for webauthn.BeginLogin
func (*Server) BeginRegistration ¶
func (s *Server) BeginRegistration(ctx context.Context, req *connect_go.Request[dashv1alpha1.BeginRegistrationRequest]) (*connect_go.Response[dashv1alpha1.BeginRegistrationResponse], error)
BeginRegistration is proto interface for webauthn.BeginRegistration
func (*Server) CreateSession ¶
func (*Server) CreateUser ¶ added in v0.8.0
func (s *Server) CreateUser(ctx context.Context, req *connect_go.Request[dashv1alpha1.CreateUserRequest]) (*connect_go.Response[dashv1alpha1.CreateUserResponse], error)
func (*Server) CreateWorkspace ¶ added in v0.8.0
func (s *Server) CreateWorkspace(ctx context.Context, req *connect_go.Request[dashv1alpha1.CreateWorkspaceRequest]) (*connect_go.Response[dashv1alpha1.CreateWorkspaceResponse], error)
func (*Server) DeleteCredential ¶
func (s *Server) DeleteCredential(ctx context.Context, req *connect_go.Request[dashv1alpha1.DeleteCredentialRequest]) (*connect_go.Response[dashv1alpha1.DeleteCredentialResponse], error)
DeleteCredential remove credential of a user by given id
func (*Server) DeleteNetworkRule ¶
func (s *Server) DeleteNetworkRule(ctx context.Context, req *connect_go.Request[dashv1alpha1.DeleteNetworkRuleRequest]) (*connect_go.Response[dashv1alpha1.DeleteNetworkRuleResponse], error)
func (*Server) DeleteUser ¶
func (s *Server) DeleteUser(ctx context.Context, req *connect_go.Request[dashv1alpha1.DeleteUserRequest]) (*connect_go.Response[dashv1alpha1.DeleteUserResponse], error)
func (*Server) DeleteWorkspace ¶
func (s *Server) DeleteWorkspace(ctx context.Context, req *connect_go.Request[dashv1alpha1.DeleteWorkspaceRequest]) (*connect_go.Response[dashv1alpha1.DeleteWorkspaceResponse], error)
func (*Server) FinishLogin ¶
func (s *Server) FinishLogin(ctx context.Context, req *connect_go.Request[dashv1alpha1.FinishLoginRequest]) (*connect_go.Response[dashv1alpha1.FinishLoginResponse], error)
FinishLogin is proto interface for webauthn.FinishLogin
func (*Server) FinishRegistration ¶
func (s *Server) FinishRegistration(ctx context.Context, req *connect_go.Request[dashv1alpha1.FinishRegistrationRequest]) (*connect_go.Response[dashv1alpha1.FinishRegistrationResponse], error)
FinishRegistration is proto interface for webauthn.FinishRegistration
func (*Server) GetEvents ¶
func (s *Server) GetEvents(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetEventsRequest]) (*connect_go.Response[dashv1alpha1.GetEventsResponse], error)
func (*Server) GetUser ¶
func (s *Server) GetUser(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetUserRequest]) (*connect_go.Response[dashv1alpha1.GetUserResponse], error)
func (*Server) GetUserAddonTemplates ¶ added in v0.2.0
func (s *Server) GetUserAddonTemplates(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetUserAddonTemplatesRequest]) (*connect_go.Response[dashv1alpha1.GetUserAddonTemplatesResponse], error)
func (*Server) GetUsers ¶
func (s *Server) GetUsers(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetUsersRequest]) (*connect_go.Response[dashv1alpha1.GetUsersResponse], error)
func (*Server) GetWorkspace ¶
func (s *Server) GetWorkspace(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetWorkspaceRequest]) (*connect_go.Response[dashv1alpha1.GetWorkspaceResponse], error)
func (*Server) GetWorkspaceTemplates ¶
func (s *Server) GetWorkspaceTemplates(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetWorkspaceTemplatesRequest]) (*connect_go.Response[dashv1alpha1.GetWorkspaceTemplatesResponse], error)
func (*Server) GetWorkspaces ¶
func (s *Server) GetWorkspaces(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetWorkspacesRequest]) (*connect_go.Response[dashv1alpha1.GetWorkspacesResponse], error)
func (*Server) ListCredentials ¶
func (s *Server) ListCredentials(ctx context.Context, req *connect_go.Request[dashv1alpha1.ListCredentialsRequest]) (*connect_go.Response[dashv1alpha1.ListCredentialsResponse], error)
ListCredentials returns all the credentials of a user
func (*Server) Login ¶
func (s *Server) Login(ctx context.Context, req *connect_go.Request[dashv1alpha1.LoginRequest]) (*connect_go.Response[dashv1alpha1.LoginResponse], error)
func (*Server) ServiceAccountLogin ¶
func (s *Server) ServiceAccountLogin(ctx context.Context, req *connect_go.Request[dashv1alpha1.ServiceAccountLoginRequest]) (*connect_go.Response[dashv1alpha1.LoginResponse], error)
func (*Server) SessionInfo ¶
func (*Server) StreamServiceHandler ¶
func (*Server) StreamingEvents ¶
func (s *Server) StreamingEvents(ctx context.Context, req *connect_go.Request[dashv1alpha1.GetEventsRequest], stream *connect_go.ServerStream[dashv1alpha1.GetEventsResponse]) error
StreamingEvents implements dashboardv1alpha1connect.UserServiceHandler.
func (*Server) TemplateServiceHandler ¶ added in v0.8.0
func (*Server) UpdateCredential ¶
func (s *Server) UpdateCredential(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpdateCredentialRequest]) (*connect_go.Response[dashv1alpha1.UpdateCredentialResponse], error)
UpdateCredential updates credentia
func (*Server) UpdateUserAddons ¶
func (s *Server) UpdateUserAddons(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpdateUserAddonsRequest]) (*connect_go.Response[dashv1alpha1.UpdateUserAddonsResponse], error)
func (*Server) UpdateUserDisplayName ¶ added in v0.8.0
func (s *Server) UpdateUserDisplayName(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpdateUserDisplayNameRequest]) (*connect_go.Response[dashv1alpha1.UpdateUserDisplayNameResponse], error)
func (*Server) UpdateUserPassword ¶ added in v0.8.0
func (s *Server) UpdateUserPassword(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpdateUserPasswordRequest]) (*connect_go.Response[dashv1alpha1.UpdateUserPasswordResponse], error)
func (*Server) UpdateUserRole ¶ added in v0.8.0
func (s *Server) UpdateUserRole(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpdateUserRoleRequest]) (*connect_go.Response[dashv1alpha1.UpdateUserRoleResponse], error)
func (*Server) UpdateWorkspace ¶ added in v0.8.0
func (s *Server) UpdateWorkspace(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpdateWorkspaceRequest]) (*connect_go.Response[dashv1alpha1.UpdateWorkspaceResponse], error)
func (*Server) UpsertNetworkRule ¶ added in v0.8.0
func (s *Server) UpsertNetworkRule(ctx context.Context, req *connect_go.Request[dashv1alpha1.UpsertNetworkRuleRequest]) (*connect_go.Response[dashv1alpha1.UpsertNetworkRuleResponse], error)
func (*Server) UserServiceHandler ¶ added in v0.8.0
func (*Server) Verify ¶
func (s *Server) Verify(ctx context.Context, req *connect_go.Request[emptypb.Empty]) (*connect_go.Response[dashv1alpha1.VerifyResponse], error)
func (*Server) WebAuthnServiceHandler ¶
func (*Server) WorkspaceServiceHandler ¶ added in v0.8.0
type StoreStatusResponseWriter ¶
type StoreStatusResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*StoreStatusResponseWriter) Flush ¶
func (w *StoreStatusResponseWriter) Flush()
func (*StoreStatusResponseWriter) StatusCode ¶
func (w *StoreStatusResponseWriter) StatusCode() int
func (*StoreStatusResponseWriter) StatusString ¶
func (w *StoreStatusResponseWriter) StatusString() string
func (*StoreStatusResponseWriter) WriteHeader ¶
func (w *StoreStatusResponseWriter) WriteHeader(statusCode int)