Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
439 changes: 4 additions & 435 deletions cmd/laas/docs/docs.go

Large diffs are not rendered by default.

439 changes: 4 additions & 435 deletions cmd/laas/docs/swagger.json

Large diffs are not rendered by default.

296 changes: 4 additions & 292 deletions cmd/laas/docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
basePath: /api/v1
definitions:
datatypes.JSONType-models_LicenseDBSchemaExtension:
type: object
datatypes.JSONType-models_ObligationSchemaExtension:
type: object
models.APICollection:
properties:
authenticated:
Expand Down Expand Up @@ -174,7 +170,7 @@ definitions:
notes:
example: This license has been superseded.
type: string
obligations:
obligation_ids:
example:
- f81d4fae-7dec-11d0-a765-00a0c91e6bf6
- f812jfae-7dbc-11d0-a765-00a0hf06bf6
Expand Down Expand Up @@ -210,47 +206,6 @@ definitions:
- spdx_id
- text
type: object
models.LicenseDB:
properties:
active:
type: boolean
addDate:
type: string
copyleft:
type: boolean
externalRef:
$ref: '#/definitions/datatypes.JSONType-models_LicenseDBSchemaExtension'
fullname:
type: string
id:
type: string
notes:
type: string
obligations:
items:
$ref: '#/definitions/models.Obligation'
type: array
osiapproved:
type: boolean
risk:
type: integer
shortname:
type: string
source:
type: string
spdxId:
type: string
text:
type: string
textUpdatable:
type: boolean
url:
type: string
user:
$ref: '#/definitions/models.User'
userId:
type: string
type: object
models.LicenseDBSchemaExtension:
properties:
license_explanation:
Expand Down Expand Up @@ -288,29 +243,6 @@ definitions:
example: 200
type: integer
type: object
models.LicenseListInput:
properties:
ids:
items:
type: object
type: array
type: object
models.LicenseMapElement:
properties:
add:
example: true
type: boolean
id:
example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
type: string
type: object
models.LicenseMapInput:
properties:
map:
items:
$ref: '#/definitions/models.LicenseMapElement'
type: array
type: object
models.LicensePreview:
properties:
id:
Expand Down Expand Up @@ -365,7 +297,7 @@ definitions:
notes:
example: This license has been superseded.
type: string
obligations:
obligation_ids:
items:
type: string
type: array
Expand Down Expand Up @@ -409,9 +341,9 @@ definitions:
notes:
example: This license has been superseded.
type: string
obligations:
obligation_ids:
items:
$ref: '#/definitions/models.Obligation'
type: string
type: array
risk:
example: 1
Expand All @@ -437,45 +369,6 @@ definitions:
example: https://opensource.org/licenses/MIT
type: string
type: object
models.Obligation:
properties:
active:
type: boolean
category:
enum:
- DISTRIBUTION
- PATENT
- INTERNAL
- CONTRACTUAL
- EXPORT_CONTROL
- GENERAL
example: DISTRIBUTION
type: string
classification:
$ref: '#/definitions/models.ObligationClassification'
comment:
type: string
externalRef:
$ref: '#/definitions/datatypes.JSONType-models_ObligationSchemaExtension'
id:
type: string
licenses:
items:
$ref: '#/definitions/models.LicenseDB'
type: array
obligationClassificationId:
type: string
obligationTypeId:
type: string
text:
type: string
textUpdatable:
type: boolean
topic:
type: string
type:
$ref: '#/definitions/models.ObligationType'
type: object
models.ObligationClassification:
properties:
classification:
Expand Down Expand Up @@ -559,48 +452,6 @@ definitions:
example: 200
type: integer
type: object
models.ObligationMapLicenseFormat:
properties:
id:
example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
type: string
shortname:
example: MIT
type: string
type: object
models.ObligationMapResponse:
properties:
data:
items:
$ref: '#/definitions/models.ObligationMapUser'
type: array
paginationmeta:
$ref: '#/definitions/models.PaginationMeta'
status:
example: 200
type: integer
type: object
models.ObligationMapUser:
properties:
id:
example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
type: string
licenses:
items:
$ref: '#/definitions/models.ObligationMapLicenseFormat'
type: array
topic:
example: copyleft
type: string
type:
enum:
- obligation
- restriction
- risk
- right
example: obligation
type: string
type: object
models.ObligationPreview:
properties:
id:
Expand Down Expand Up @@ -1526,145 +1377,6 @@ paths:
summary: Login
tags:
- Users
/obligation_maps/license/{id}:
get:
consumes:
- application/json
description: Get obligation maps for a given license id
operationId: GetObligationMapByLicenseId
parameters:
- description: id of the license
in: path
name: license
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ObligationMapResponse'
"404":
description: No license with given id found
schema:
$ref: '#/definitions/models.LicenseError'
security:
- '{}': []
ApiKeyAuth: []
summary: Get maps for a license
tags:
- Obligations
/obligation_maps/obligation/{id}:
get:
consumes:
- application/json
description: Get obligation maps for a given obligation id
operationId: GetObligationMapByObligationId
parameters:
- description: Id of the obligation
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ObligationMapResponse'
"404":
description: No obligation with given id found
schema:
$ref: '#/definitions/models.LicenseError'
security:
- '{}': []
ApiKeyAuth: []
summary: Get maps for an obligation
tags:
- Obligations
/obligation_maps/obligation/{id}/license:
patch:
consumes:
- application/json
description: Add or remove licenses from obligation map for a given obligation
id
operationId: PatchObligationMap
parameters:
- description: Id of the obligation
in: path
name: id
required: true
type: string
- description: License ids with action
in: body
name: license_maps
required: true
schema:
$ref: '#/definitions/models.LicenseMapInput'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ObligationMapResponse'
"400":
description: Invalid json body
schema:
$ref: '#/definitions/models.LicenseError'
"404":
description: No license or obligation found.
schema:
$ref: '#/definitions/models.LicenseError'
"500":
description: Failure to insert new maps
schema:
$ref: '#/definitions/models.LicenseError'
security:
- ApiKeyAuth: []
summary: Add or remove licenses from obligation map
tags:
- Obligations
put:
consumes:
- application/json
description: Replaces the license list of an obligation id with the given list
in the obligation map.
operationId: UpdateLicenseInObligationMap
parameters:
- description: Id of the obligation
in: path
name: id
required: true
type: string
- description: Ids of the licenses to be in map
in: body
name: Ids
required: true
schema:
$ref: '#/definitions/models.LicenseListInput'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ObligationMapResponse'
"400":
description: Invalid json body
schema:
$ref: '#/definitions/models.LicenseError'
"404":
description: No license or obligation found.
schema:
$ref: '#/definitions/models.LicenseError'
security:
- ApiKeyAuth: []
summary: Change license list
tags:
- Obligations
/obligations:
get:
consumes:
Expand Down
17 changes: 0 additions & 17 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ func Router() *gin.Engine {
obligations.DELETE("/classifications/:classification", middleware.RoleBasedAccessMiddleware([]string{"ADMIN"}), DeleteObligationClassification)
obligations.POST("/similarity", getSimilarObligations)
}
obMap := authorizedv1.Group("/obligation_maps")
{
obMap.GET("obligation/:id", GetObligationMapByObligationId)
obMap.GET("license/:id", GetObligationMapByLicenseId)
obMap.PATCH("obligation/:id/license", PatchObligationMap)
obMap.PUT("obligation/:id/license", UpdateLicenseInObligationMap)
}
audit := authorizedv1.Group("/audits")
{
audit.GET("", GetAllAudit)
Expand Down Expand Up @@ -205,11 +198,6 @@ func Router() *gin.Engine {
obligations.GET("/types", GetAllObligationType)
obligations.GET("/classifications", GetAllObligationClassification)
}
obMap := unAuthorizedv1.Group("/obligation_maps")
{
obMap.GET("obligation/:id", GetObligationMapByObligationId)
obMap.GET("license/:id", GetObligationMapByLicenseId)
}
audit := unAuthorizedv1.Group("/audits")
{
audit.GET("", GetAllAudit)
Expand Down Expand Up @@ -276,11 +264,6 @@ func Router() *gin.Engine {
obligations.DELETE("/classifications/:classification", middleware.RoleBasedAccessMiddleware([]string{"ADMIN"}), DeleteObligationClassification)
obligations.POST("/similarity", getSimilarObligations)
}
obMap := authorizedv1.Group("/obligation_maps")
{
obMap.PATCH("obligation/:id/license", PatchObligationMap)
obMap.PUT("obligation/:id/license", UpdateLicenseInObligationMap)
}
oidcClient := authorizedv1.Group("/oidcClients")
{
oidcClient.GET("", GetUserOidcClients)
Expand Down
Loading
Loading