Skip to content

Commit

Permalink
RHINENG-14351: fix api documentation and error message
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka committed Dec 16, 2024
1 parent 01b91a8 commit dfc290e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
16 changes: 2 additions & 14 deletions docs/v3/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6409,7 +6409,7 @@
"patch": {
"summary": "Add a system to a template",
"description": "Add a system authenticated by its client identity certificate to a template",
"operationId": "addTemplateSystem",
"operationId": "addTemplateSubscribedSystem",
"parameters": [
{
"name": "template_id",
Expand All @@ -6421,17 +6421,6 @@
}
}
],
"requestBody": {
"description": "Request body",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/controllers.TemplateSystemsUpdateRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -6472,8 +6461,7 @@
{
"RhIdentity": []
}
],
"x-codegen-request-body-name": "body"
]
}
},
"/templates/{template_id}/systems": {
Expand Down
3 changes: 1 addition & 2 deletions manager/controllers/template_subscribed_systems_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import (

// @Summary Add a system to a template
// @Description Add a system authenticated by its client identity certificate to a template
// @ID addTemplateSystem
// @ID addTemplateSubscribedSystem
// @Security RhIdentity
// @Accept json
// @Produce json
// @Param body body TemplateSystemsUpdateRequest true "Request body"
// @Param template_id path string true "Template ID"
// @Success 200
// @Failure 400 {object} utils.ErrorResponse
Expand Down
2 changes: 1 addition & 1 deletion manager/middlewares/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func SystemCertAuthenticator() gin.HandlerFunc {
slices.Contains(validSystemCertTypes, xrhid.Identity.System.CertType) &&
findAccount(c, xrhid.Identity.OrgID)) {
c.AbortWithStatusJSON(http.StatusUnauthorized,
utils.ErrorResponse{Error: "Invalid x-rh-identity system header"})
utils.ErrorResponse{Error: "Invalid system identity header"})
return
}
c.Set(utils.KeySystem, xrhid.Identity.System.CommonName)
Expand Down

0 comments on commit dfc290e

Please sign in to comment.