Skip to content
Merged
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
86 changes: 86 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20976,6 +20976,77 @@ const docTemplate = `{
]
}
},
"/oscal/system-security-plans/{id}/export-offerings/{offeringId}/status": {
"patch": {
"description": "Transitions a published export offering to deprecated or revoked,\nwhich — independent of any content change — drifts every active\nleverage link pointing at it (BCH-1341 Phase 5).",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SSP Export Offerings"
],
"summary": "Deprecate or revoke an export offering",
"parameters": [
{
"type": "string",
"description": "SSP ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Offering ID",
"name": "offeringId",
"in": "path",
"required": true
},
{
"description": "New status",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/oscal.updateOfferingStatusRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.GenericDataResponse-relational_SSPExportOffering"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
},
"security": [
{
"OAuth2Password": []
}
]
}
},
"/oscal/system-security-plans/{id}/import-profile": {
"get": {
"description": "Retrieves import-profile for a given SSP.",
Expand Down Expand Up @@ -38873,6 +38944,21 @@ const docTemplate = `{
}
}
},
"oscal.updateOfferingStatusRequest": {
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"type": "string",
Comment thread
saltpy-cs marked this conversation as resolved.
"enum": [
"deprecated",
"revoked"
]
}
}
},
"oscal.upstreamResponsibility": {
"type": "object",
"properties": {
Expand Down
86 changes: 86 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -20970,6 +20970,77 @@
]
}
},
"/oscal/system-security-plans/{id}/export-offerings/{offeringId}/status": {
"patch": {
"description": "Transitions a published export offering to deprecated or revoked,\nwhich — independent of any content change — drifts every active\nleverage link pointing at it (BCH-1341 Phase 5).",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"SSP Export Offerings"
],
"summary": "Deprecate or revoke an export offering",
"parameters": [
{
"type": "string",
"description": "SSP ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Offering ID",
"name": "offeringId",
"in": "path",
"required": true
},
{
"description": "New status",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/oscal.updateOfferingStatusRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.GenericDataResponse-relational_SSPExportOffering"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
},
"security": [
{
"OAuth2Password": []
}
]
}
},
"/oscal/system-security-plans/{id}/import-profile": {
"get": {
"description": "Retrieves import-profile for a given SSP.",
Expand Down Expand Up @@ -38867,6 +38938,21 @@
}
}
},
"oscal.updateOfferingStatusRequest": {
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"type": "string",
Comment thread
saltpy-cs marked this conversation as resolved.
"enum": [
"deprecated",
"revoked"
]
}
}
},
"oscal.upstreamResponsibility": {
"type": "object",
"properties": {
Expand Down
59 changes: 59 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4422,6 +4422,16 @@ definitions:
name:
type: string
type: object
oscal.updateOfferingStatusRequest:
properties:
status:
enum:
- deprecated
- revoked
type: string
required:
- status
type: object
oscal.upstreamResponsibility:
properties:
description:
Expand Down Expand Up @@ -25161,6 +25171,55 @@ paths:
summary: Publish an export offering
tags:
- SSP Export Offerings
/oscal/system-security-plans/{id}/export-offerings/{offeringId}/status:
patch:
consumes:
- application/json
description: |-
Transitions a published export offering to deprecated or revoked,
which — independent of any content change — drifts every active
leverage link pointing at it (BCH-1341 Phase 5).
parameters:
- description: SSP ID
in: path
name: id
required: true
type: string
- description: Offering ID
in: path
name: offeringId
required: true
type: string
- description: New status
in: body
name: body
required: true
schema:
$ref: '#/definitions/oscal.updateOfferingStatusRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.GenericDataResponse-relational_SSPExportOffering'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
"404":
description: Not Found
schema:
$ref: '#/definitions/api.Error'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/api.Error'
security:
- OAuth2Password: []
summary: Deprecate or revoke an export offering
tags:
- SSP Export Offerings
/oscal/system-security-plans/{id}/import-profile:
get:
description: Retrieves import-profile for a given SSP.
Expand Down
3 changes: 2 additions & 1 deletion internal/api/handler/oscal/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ func RegisterHandlers(server *api.Server, logger *zap.SugaredLogger, db *gorm.DB
offeringGroup := oscalGroup.Group("/ssp-export-offerings")
offeringGuard := pep.For(authz.ResourceSSPExportOffering)

exportOfferingHandler := NewSSPExportOfferingHandler(logger, db)
exportOfferingHandler := NewSSPExportOfferingHandler(logger, db, jobEnqueuer)
exportOfferingHandler.RegisterNested(sspGroup, sspGuard)
exportOfferingHandler.Register(offeringGroup, offeringGuard)

leverageHandler := NewSSPLeverageHandler(logger, db, pep.PDP(), pep.FailMode())
leverageHandler.RegisterSubscribe(offeringGroup, offeringGuard)
leverageHandler.RegisterProjection(sspGroup, sspGuard)
leverageHandler.RegisterReAttest(sspGroup, sspGuard)

if config.AI != nil && config.AI.Enabled {
dashboardSuggestionHandler.Register(oscalGroup.Group("/system-security-plans"), jwtMiddleware, dashboardGuard)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func (f *dashboardSuggestionFakeEnqueuer) EnqueueOrphanedRiskCleanup(context.Con
return nil
}

func (f *dashboardSuggestionFakeEnqueuer) EnqueueLeverageDriftNotification(context.Context, uuid.UUID, uuid.UUID, string) error {
return nil
}

func (f *dashboardSuggestionFakeEnqueuer) EnqueueDashboardSuggestionCells(_ context.Context, runID uuid.UUID, cellCount int) error {
f.calls++
f.runID = runID
Expand Down
Loading
Loading