Documentation ¶
Index ¶
- Constants
- func Error(c *gin.Context, code int, msg string)
- func GetHost(c *gin.Context)
- func GetIndex(c *gin.Context)
- func GetSwagger(c *gin.Context)
- func PostHostCertificate(c *gin.Context)
- type ApiResponseCertificate
- type ApiResponseError
- type ApiResponseHost
- type ApiResponseIndex
- type FormHostCertificate
- type Provider
- type UriHost
Constants ¶
View Source
const ( PRINCIPAL = "oinit" FORCE_COMMAND = "oinit-switch" )
View Source
const ( API_VERSION = "1.0.0" ERR_BAD_BODY = "Request body is malformed." ERR_UNKNOWN_HOST = "Unknown host." ERR_GATEWAY_DOWN = "motley_cue is not reachable." ERR_UNAUTHORIZED = "User is not authorized or suspended." ERR_INTERNAL_ERROR = "Internal server error." )
Variables ¶
This section is empty.
Functions ¶
func GetHost ¶
GetHost is the handler for GET /:host
@Summary Get host information @Description Return the CA public key and supported OpenID Connect providers with their required scopes. @Produce json @Param host path string true "Host" example("example.com") @Success 200 {object} ApiResponseHost @Failure 400 {object} ApiResponseError @Failure 404 {object} ApiResponseError @Failure 500 {object} ApiResponseError @Failure 502 {object} ApiResponseError @Router /{host} [get]
func GetIndex ¶
GetIndex is the handler for GET /
@Summary Get API version @Description Return the running API version. @Produce json @Success 200 {object} ApiResponseIndex @Router / [get]
func GetSwagger ¶
func PostHostCertificate ¶
PostHostCertificate is the handler for POST /:host/certificate
@Summary Generate SSH certificate @Description Generate and return a new SSH certificate using the given public key and access token. @Accept json @Produce json @Param host path string true "Host" example("example.com") @Param body body FormHostCertificate true "Public key and access token" @Success 201 {object} ApiResponseCertificate @Failure 400 {object} ApiResponseError @Failure 401 {object} ApiResponseError @Failure 404 {object} ApiResponseError @Failure 500 {object} ApiResponseError @Failure 502 {object} ApiResponseError @Router /{host}/certificate [post]
Types ¶
type ApiResponseCertificate ¶
type ApiResponseCertificate struct {
Certificate string `json:"certificate"`
}
type ApiResponseError ¶
type ApiResponseError struct {
Error string `json:"error"`
}
type ApiResponseHost ¶
type ApiResponseIndex ¶
type ApiResponseIndex struct {
Version string `json:"version"`
}
type FormHostCertificate ¶
Click to show internal directories.
Click to hide internal directories.