Skip to content

Commit

Permalink
smal fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
havardelnan committed Jan 23, 2025
1 parent 7470b2d commit ff330e9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 96 deletions.
10 changes: 2 additions & 8 deletions internal/controllers/aclcontroller/acl_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ func init() {
// @Accept application/json
// @Produce application/json
// @Success 200 {array} aclmodels.Acl2Scope
// @Failure 403 {object} rorerror.RorError
// @Failure 401 {object} rorerror.RorError
// @Failure 500 {object} rorerror.RorError
// @Router /v1/acl/scopes [get]
// @Security ApiKey || AccessToken
func GetScopes() gin.HandlerFunc {
return func(c *gin.Context) {

results := aclmodels.GetScopes()
c.JSON(http.StatusOK, results)
}
Expand All @@ -61,13 +58,10 @@ func GetScopes() gin.HandlerFunc {
// @Schemes
// @Description Check acl by scope, subject and access method
// @Tags acl
// @Accept application/json
// @Produce application/json
// @Success 200
// @Failure 403
// @Failure 400 {object} rorerror.RorError
// @Failure 401 {object} rorerror.RorError
// @Failure 500 {object} rorerror.RorError
// @Failure 400
// @Failure 401
// @Param scope path string false "Scope"
// @Param subject path string false "Subject"
// @Param access path string false "read,write,update or delete"
Expand Down
42 changes: 8 additions & 34 deletions internal/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,6 @@ const docTemplate = `{
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
}
}
}
Expand Down Expand Up @@ -481,12 +469,6 @@ const docTemplate = `{
}
],
"description": "Check acl by scope, subject and access method",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"acl"
],
Expand Down Expand Up @@ -516,25 +498,13 @@ const docTemplate = `{
"description": "OK"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
"description": "Bad Request"
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
}
}
}
Expand Down Expand Up @@ -10312,10 +10282,14 @@ const docTemplate = `{
"type": "object",
"properties": {
"message": {
"type": "string"
"description": "Error message",
"type": "string",
"example": "Bad Request"
},
"status": {
"type": "integer"
"description": "HTTP status code",
"type": "integer",
"example": 400
}
}
},
Expand Down
42 changes: 8 additions & 34 deletions internal/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,6 @@
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
}
}
}
Expand Down Expand Up @@ -474,12 +462,6 @@
}
],
"description": "Check acl by scope, subject and access method",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"acl"
],
Expand Down Expand Up @@ -509,25 +491,13 @@
"description": "OK"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
"description": "Bad Request"
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/rorerror.RorError"
}
}
}
}
Expand Down Expand Up @@ -10305,10 +10275,14 @@
"type": "object",
"properties": {
"message": {
"type": "string"
"description": "Error message",
"type": "string",
"example": "Bad Request"
},
"status": {
"type": "integer"
"description": "HTTP status code",
"type": "integer",
"example": 400
}
}
},
Expand Down
24 changes: 4 additions & 20 deletions internal/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1902,8 +1902,12 @@ definitions:
rorerror.RorError:
properties:
message:
description: Error message
example: Bad Request
type: string
status:
description: HTTP status code
example: 400
type: integer
type: object
rorresourceowner.RorResourceOwnerReference:
Expand Down Expand Up @@ -4820,8 +4824,6 @@ paths:
- acl
/v1/acl/{scope}/{subject}/{access}:
head:
consumes:
- application/json
description: Check acl by scope, subject and access method
parameters:
- description: Scope
Expand All @@ -4836,25 +4838,15 @@ paths:
in: path
name: access
type: string
produces:
- application/json
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/rorerror.RorError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/rorerror.RorError'
"403":
description: Forbidden
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/rorerror.RorError'
security:
- AccessToken: []
ApiKey: []
Expand Down Expand Up @@ -4956,14 +4948,6 @@ paths:
description: Unauthorized
schema:
$ref: '#/definitions/rorerror.RorError'
"403":
description: Forbidden
schema:
$ref: '#/definitions/rorerror.RorError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/rorerror.RorError'
security:
- AccessToken: []
ApiKey: []
Expand Down

0 comments on commit ff330e9

Please sign in to comment.