EasyDynamics / oscal-rest

An initial OpenAPI definition of an OSCAL REST API.
Creative Commons Attribution Share Alike 4.0 International
38 stars 13 forks source link

Revised Attachment Handling #83

Closed brian-comply0 closed 6 months ago

brian-comply0 commented 8 months ago

Description

As a developer issuing OSCAL REST API calls to manage attachments, I want a more seamless integration between the attachment endpoints and the OSCAL content related to those attachments.

Specifically, I want attachment methods and endpoints to address the following:


Acceptance Criteria


Concept of Operations (ConOps)

The ConOps is that a client interacting with the REST API is either:

SENDING OSCAL CONTENT

  1. When a client is sending an OSCAL file and attachments, the following steps are used:
    • Client: POST /{model-name}
    • Server: Stores file
    • Server: Assigns {file-id}
    • Server Returns:
    • Response code: 201 (Success - Payload Attached)
    • Payload: { "{model-name}-id" : "{file-id}" }

2a. For each existing attachment that is already defined in the OSCAL file (content already has a back-matter/resource):

2b. For any new attachments that are not yet defined in the OSCAL file:

  1. For either of the attachment methods above, the client can follow the PUT or POST with the following to adjust the content of the back-matter/resource associated with the attachment:
    • Client: PUT /{model-name}/{file-id}/attachment/{resourceUUID}/resource with JSON payload to set or modify the resource's title, description, prop[@name='type'], and other properties and fields as defined in the OSCAL 1.1.2 specification forback-matter/resource`
    • Server: Identifies the back-matter/resource by {resourceUUID}
    • Server: Replaces all resource content with the delivered content.
    • Server Returns:
    • Response code: 204 (Success - No Payload Attached)

RETRIEVING OSCAL CONTENT

  1. When a client is retrieving an OSCAL file and attachments, the following steps are used:
    • Client: GET /{model-name}
    • Server: Provides JSON file with list of OSCAL files of that model name, including the {file-id} for each.
    • Client: GET /{model-name}/{file-id}
    • Server: Provides OSCAL file as payload.
    • Client: Processes OSCAL content as needed, identifies an attachment of interest, and notes it's {resourceUUID}
    • Client: Retrieves the attachment using either:
    • A valid and reachable rlink/@href value within the resource; OR
    • GET /{model-name}/{file-id}/attachment/{resourceUUID}
    • Server Returns:
    • Response code: 200 OK
    • Attachment
### Tasks
brian-comply0 commented 7 months ago

Made good progress on the collection of issues. This one will be addressed in sprint 68.

mpemy commented 6 months ago

Made good progress. This one will be addressed in sprint 69.

brian-comply0 commented 6 months ago

Per today's discussion:

{
  "attachment-list": [
      {
      "resource-uuid": "string",
      "file-name": "string",
      "media-type": "string",
      "title": "string",
      "published": "19-02-29",
      "version": "",
      "remarks": "string"  
      }
   ]
}

NOTES:

pjavan commented 6 months ago

@mpemy / @brian-comply0 status update?

brian-comply0 commented 6 months ago

@pjavan hopefully the status is showing for you as in-review. I have one or two items ahead of this in the priority queue. I hope to review it today.

brian-comply0 commented 6 months ago

This looks good! Closing.