mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
docs: API workspace agents and builds (#5538)
This commit is contained in:
@ -19,6 +19,15 @@ import (
|
||||
|
||||
// Azure supports instance identity verification:
|
||||
// https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service?tabs=linux#tabgroup_14
|
||||
//
|
||||
// @Summary Authenticate agent on Azure instance
|
||||
// @ID authenticate-agent-on-azure-instance
|
||||
// @Security CoderSessionToken
|
||||
// @Produce json
|
||||
// @Tags Agents
|
||||
// @Param request body codersdk.AzureInstanceIdentityToken true "Instance identity token"
|
||||
// @Success 200 {object} codersdk.WorkspaceAgentAuthenticateResponse
|
||||
// @Router /workspaceagents/azure-instance-identity [post]
|
||||
func (api *API) postWorkspaceAuthAzureInstanceIdentity(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
var req codersdk.AzureInstanceIdentityToken
|
||||
@ -36,6 +45,15 @@ func (api *API) postWorkspaceAuthAzureInstanceIdentity(rw http.ResponseWriter, r
|
||||
api.handleAuthInstanceID(rw, r, instanceID)
|
||||
}
|
||||
|
||||
// @Summary Authenticate agent on AWS instance
|
||||
// @ID authenticate-agent-on-aws-instance
|
||||
// @Security CoderSessionToken
|
||||
// @Produce json
|
||||
// @Tags Agents
|
||||
// @Param request body codersdk.AWSInstanceIdentityToken true "Instance identity token"
|
||||
// @Success 200 {object} codersdk.WorkspaceAgentAuthenticateResponse
|
||||
// @Router /workspaceagents/aws-instance-identity [post]
|
||||
//
|
||||
// AWS supports instance identity verification:
|
||||
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html
|
||||
// Using this, we can exchange a signed instance payload for an agent token.
|
||||
@ -56,6 +74,15 @@ func (api *API) postWorkspaceAuthAWSInstanceIdentity(rw http.ResponseWriter, r *
|
||||
api.handleAuthInstanceID(rw, r, identity.InstanceID)
|
||||
}
|
||||
|
||||
// @Summary Authenticate agent on Google Cloud instance
|
||||
// @ID authenticate-agent-on-google-cloud-instance
|
||||
// @Security CoderSessionToken
|
||||
// @Produce json
|
||||
// @Tags Agents
|
||||
// @Param request body codersdk.GoogleInstanceIdentityToken true "Instance identity token"
|
||||
// @Success 200 {object} codersdk.WorkspaceAgentAuthenticateResponse
|
||||
// @Router /workspaceagents/google-instance-identity [post]
|
||||
//
|
||||
// Google Compute Engine supports instance identity verification:
|
||||
// https://cloud.google.com/compute/docs/instances/verifying-instance-identity
|
||||
// Using this, we can exchange a signed instance payload for an agent token.
|
||||
|
Reference in New Issue
Block a user