Documentation
¶
Index ¶
- Constants
- type Server
- func (s *Server) APIKeyCreate(c *gin.Context)
- func (s *Server) APIKeyDelete(c *gin.Context)
- func (s *Server) APIKeyDetail(c *gin.Context)
- func (s *Server) APIKeyList(c *gin.Context)
- func (s *Server) APIKeyPermissions(c *gin.Context)
- func (s *Server) APIKeyUpdate(c *gin.Context)
- func (s *Server) Available() gin.HandlerFunc
- func (s *Server) GetTaskManager() *tasks.TaskManager
- func (s *Server) InvitePreview(c *gin.Context)
- func (s *Server) Login(c *gin.Context)
- func (s *Server) MaintenanceRoutes(router *gin.Engine) (err error)
- func (s *Server) MemberCreate(c *gin.Context)
- func (s *Server) MemberDelete(c *gin.Context)
- func (s *Server) MemberDetail(c *gin.Context)
- func (s *Server) MemberList(c *gin.Context)
- func (s *Server) MemberRoleUpdate(c *gin.Context)
- func (s *Server) MemberUpdate(c *gin.Context)
- func (s *Server) OrganizationDetail(c *gin.Context)
- func (s *Server) OrganizationList(c *gin.Context)
- func (s *Server) ProjectAPIKeyCreate(c *gin.Context)
- func (s *Server) ProjectAPIKeyList(c *gin.Context)
- func (s *Server) ProjectCreate(c *gin.Context)
- func (s *Server) ProjectDelete(c *gin.Context)
- func (s *Server) ProjectDetail(c *gin.Context)
- func (s *Server) ProjectList(c *gin.Context)
- func (s *Server) ProjectTopicCreate(c *gin.Context)
- func (s *Server) ProjectTopicList(c *gin.Context)
- func (s *Server) ProjectUpdate(c *gin.Context)
- func (s *Server) ProtectLogin(c *gin.Context)
- func (s *Server) Refresh(c *gin.Context)
- func (s *Server) Register(c *gin.Context)
- func (s *Server) ResetTaskManager()
- func (s *Server) Routes(router *gin.Engine) (err error)
- func (s *Server) SetEnsignClient(client pb.EnsignClient)
- func (s *Server) Setup() (err error)
- func (s *Server) Started() (err error)
- func (s *Server) Status(c *gin.Context)
- func (s *Server) Stop(context.Context) (err error)
- func (s *Server) Switch(c *gin.Context)
- func (s *Server) TenantCreate(c *gin.Context)
- func (s *Server) TenantDelete(c *gin.Context)
- func (s *Server) TenantDetail(c *gin.Context)
- func (s *Server) TenantList(c *gin.Context)
- func (s *Server) TenantProjectCreate(c *gin.Context)
- func (s *Server) TenantProjectList(c *gin.Context)
- func (s *Server) TenantStats(c *gin.Context)
- func (s *Server) TenantUpdate(c *gin.Context)
- func (s *Server) TopicCreate(c *gin.Context)
- func (s *Server) TopicDelete(c *gin.Context)
- func (s *Server) TopicDetail(c *gin.Context)
- func (s *Server) TopicList(c *gin.Context)
- func (s *Server) TopicUpdate(c *gin.Context)
- func (s *Server) VerifyEmail(c *gin.Context)
Constants ¶
const ServiceName = "tenant"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server implements the service.Service interface and provides handlers to respond to Tenant-specific API routes and requests.
func (*Server) APIKeyCreate ¶ added in v0.2.0
TODO: Implement by factoring out common code from ProjectAPIKeyCreate
func (*Server) APIKeyDelete ¶ added in v0.2.0
APIKeyDelete deletes an API key by forwarding the request to Quarterdeck.
Route: DELETE /v1/apikeys/:apiKeyID
func (*Server) APIKeyDetail ¶ added in v0.2.0
APIKeyDetail returns details about a specific API key.
Route: GET /v1/apikeys/:apiKeyID
func (*Server) APIKeyList ¶ added in v0.2.0
TODO: Implement by factoring out common code from ProjectAPIKeyCreate
func (*Server) APIKeyPermissions ¶ added in v0.5.0
APIKeyPermissions returns the API key permissions available to the user by forwarding the request to Quarterdeck.
Route: GET /v1/apikeys/permissions
func (*Server) APIKeyUpdate ¶ added in v0.2.0
APIKeyUpdate updates an API key by forwarding the request to Quarterdeck.
Route: PUT /v1/apikeys/:apiKeyID
func (*Server) Available ¶
func (s *Server) Available() gin.HandlerFunc
Available is middleware that uses healthy boolean to return a service unavailable http status code if the server is shutting down or in maintenance mode. This middleware must be fairly early on in the chain to ensure that complex handling does not slow the shutdown of the server.
func (*Server) GetTaskManager ¶ added in v0.5.2
func (s *Server) GetTaskManager() *tasks.TaskManager
Expose the task manager to the tests (only allowed in testing mode).
func (*Server) InvitePreview ¶ added in v0.5.2
InvitePreview returns "preview" information about an invite given a token. This endpoint must not be authenticated because unauthorized users should be able to accept organization invitations. Frontends should use this endpoint to validate an invitation token after the user has clicked on an invitation link in their email. The preview must contain enough information so the user knows which organization they are joining and also whether or not the email address is already registered to an account. This allows frontends to know whether or not to prompt the user to login or to create a new account.
Route: /invites/:token
func (*Server) Login ¶ added in v0.3.0
Login is a publically accessible endpoint that allows users to login into their account via Quarterdeck and receive access and refresh tokens for future requests.
Route: POST /v1/login
func (*Server) MaintenanceRoutes ¶ added in v0.5.2
func (*Server) MemberCreate ¶ added in v0.2.0
MemberCreate starts the team member invitation process by forwarding the request to Quarterdeck. If successful, an invitation email is sent to the email address in the request and a unverified member is created in Trtl, returning a 201 Created response.
Route: /member
func (*Server) MemberDelete ¶ added in v0.2.0
MemberDelete deletes a member from a user's request with a given ID and returns a 200 OK response instead of an an error response.
Route: /member/:memberID
func (*Server) MemberDetail ¶ added in v0.2.0
MemberDetail retrieves a summary detail of a member by its ID and returns a 200 OK response.
Route: /member/:memberID
func (*Server) MemberList ¶ added in v0.2.0
MemberList retrieves members assigned to a specified organization and returns a 200 OK response.
Route: /member
func (*Server) MemberRoleUpdate ¶ added in v0.5.2
func (*Server) MemberUpdate ¶ added in v0.2.0
MemberUpdate updates the record of a member with a given ID and returns a 200 OK response.
route: /member/:memberID
func (*Server) OrganizationDetail ¶ added in v0.4.0
Organization Detail fetches the details for an organization from Quarterdeck.
Route: GET /v1/organizations/:orgID
func (*Server) OrganizationList ¶ added in v0.5.2
OrganizationList fetches the list of organizations the authenticated user is a part of from Quarterdeck.
Route: GET /v1/organization
func (*Server) ProjectAPIKeyCreate ¶ added in v0.2.0
ProjectAPIKeyCreate creates a new API key in a project by forwarding the request to Quarterdeck.
Route: POST /v1/projects/:projectID/apikeys
func (*Server) ProjectAPIKeyList ¶ added in v0.2.0
ProjectAPIKeyList lists API keys in the specified project by forwarding the request to Quarterdeck.
Route: GET /v1/projects/:projectID/apikeys
func (*Server) ProjectCreate ¶ added in v0.2.0
ProjectCreate adds a new project to an organization in the database and returns a 201 StatusCreated response.
Route: /project
func (*Server) ProjectDelete ¶ added in v0.2.0
ProjectDelete deletes a project from a user's request with a given ID and returns a 200 OK response instead of an error response.
Route: /project/:projectID
func (*Server) ProjectDetail ¶ added in v0.2.0
ProjectDetail retrieves a summary detail of a project by its ID and returns a 200 OK response.
Route: /project/:projectID
func (*Server) ProjectList ¶ added in v0.2.0
ProjectList retrieves projects assigned to a specified organization and returns a 200 OK response.
Route: /projects
func (*Server) ProjectTopicCreate ¶ added in v0.2.0
ProjectTopicCreate adds a topic to a project in the database and returns a 201 StatusCreated response.
Route: /projects/:projectID/topics
func (*Server) ProjectTopicList ¶ added in v0.2.0
ProjectTopicList retrieves topics assigned to a specified project and returns a 200 OK response.
Route: /projects/:projectID/topics
func (*Server) ProjectUpdate ¶ added in v0.2.0
ProjectUpdate updates the record of a project with a given ID and returns a 200 OK response.
Route: /project/:projectID
func (*Server) ProtectLogin ¶ added in v0.2.0
ProtectLogin prepares the front-end for login by setting the double cookie tokens for CSRF protection.
func (*Server) Refresh ¶ added in v0.3.0
Refresh is a publicly accessible endpoint that allows users to refresh their access token using their refresh token. This enables frontend clients to provide a seamless login experience for the user.
Route: POST /v1/refresh
func (*Server) Register ¶ added in v0.3.0
Register is a publically accessible endpoint that allows new users to create an account via Quarterdeck by providing an email address and password.
Route: POST /v1/register
func (*Server) ResetTaskManager ¶ added in v0.5.2
func (s *Server) ResetTaskManager()
Reset the task manager from the tests (only allowed in testing mode)
func (*Server) SetEnsignClient ¶ added in v0.5.0
func (s *Server) SetEnsignClient(client pb.EnsignClient)
Set an Ensign client on the server for testing.
func (*Server) Stop ¶ added in v0.4.0
Cleanup when the server is being shutdown. Note that in tests you should call Shutdown() to ensure the server stops and not this method.
func (*Server) Switch ¶ added in v0.5.2
Switch is an authenticated endpoint that allows human users to switch between organizations that they are a member of. This exists to allow users to fetch new access and refresh tokens without having to re-enter their credentials. This endpoint is not available to machine users with API key credentials, since API keys can only exist in one project in one organization. If the user is already authenticated with the requested organization, this endpoint returns an error. The refresh endpoint should be used if the access token simply needs to be refreshed.
func (*Server) TenantCreate ¶ added in v0.2.0
TenantCreate adds a new tenant to the database and returns a 201 StatusCreated response.
Route: /tenant
func (*Server) TenantDelete ¶ added in v0.2.0
TenantDelete deletes a tenant from a user's request with a given ID and returns a 200 OK response instead of an an error response.
Route: /tenant/:tenantID
func (*Server) TenantDetail ¶ added in v0.2.0
TenantDetail retrieves a summary detail of a tenant by its ID and returns a 200 OK response.
Route: /tenant/:tenantID
func (*Server) TenantList ¶ added in v0.2.0
TenantList retrieves tenants assigned to a specified organization and returns a 200 OK response.
Route: /tenant
func (*Server) TenantProjectCreate ¶ added in v0.2.0
TenantProjectCreate adds a new tenant project to the database and returns a 201 StatusCreated response.
Route: /tenant/:tenantID/projects
func (*Server) TenantProjectList ¶ added in v0.2.0
TenantProjectList retrieves projects assigned to a specified tenant and returns a 200 OK response.
Route: /tenant/:tenantID/projects
func (*Server) TenantStats ¶ added in v0.3.0
TenantStats is a statistical view endpoint which returns high level counts of resources associated with a single Tenant.
Route: /tenant/:tenantID/stats
func (*Server) TenantUpdate ¶ added in v0.2.0
TenantUpdate will update a tenants record and returns a 200 OK response.
Route: /tenant/:tenantID
func (*Server) TopicCreate ¶ added in v0.2.0
Route: /topics
func (*Server) TopicDelete ¶ added in v0.2.0
TopicDelete completely destroys a topic, removing the metadata in Trtl and as well as all of the data in Ensign. Because this is irreversible, the first call returns a confirmation token to the user. The user must provide this token in a subsequent request in order to confirm the deletion. Because this operation is asynchronous, the endpoint returns a 202 Accepted response.
Route: /topic/:topicID
func (*Server) TopicDetail ¶
TopicDetail retrieves a summary detail of a topic with a given ID and returns a 200 OK response.
Route: /topic/:topicID
func (*Server) TopicList ¶
TopicList retrieves topics assigned to a specified organization and returns a 200 OK response.
Route: /topics
func (*Server) TopicUpdate ¶ added in v0.2.0
TopicUpdate updates the record of a topic with a given ID and returns a 200 OK response. The editable fields are the topic name and state, although the topic state can only be set to READONLY which archives the topic.
Route: /topic/:topicID
func (*Server) VerifyEmail ¶ added in v0.5.0
VerifyEmail is a publicly accessible endpoint that allows users to verify their email address by supplying a token that was sent to their email address. If the token has already been verified, this endpoint returns a 202 Accepted response.
Route: POST /v1/verify