-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22017 from department-of-veterans-affairs/release…
…/R.1.5.1_FY24Q3.5 Release R1.5.1 FY24Q3.5
- Loading branch information
Showing
188 changed files
with
6,014 additions
and
2,019 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::CmpController < Api::ApplicationController | ||
def upload | ||
endpoint_disabled("Payload is valid: #{validate_payload?}") | ||
rescue StandardError => error | ||
raise error | ||
end | ||
|
||
private | ||
|
||
def upload_params | ||
params.permit(:payload, file: []) | ||
end | ||
|
||
def validate_payload? | ||
payload = JSON.parse(upload_params[:payload]) | ||
|
||
validate_provider_data?(payload["providerData"]) if payload.present? | ||
end | ||
|
||
def validate_provider_data?(provider_data) | ||
return false if provider_data.blank? | ||
|
||
Rails.logger.info("provider data is #{provider_data}") | ||
true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
openapi: 3.0.2 | ||
info: | ||
title: API V1 | ||
version: v1 | ||
security: | ||
- bearerAuth: [] | ||
servers: | ||
- url: /api/v1/ | ||
paths: | ||
"/cmp": | ||
$ref: "./v1/upload.yml" | ||
components: | ||
securitySchemes: | ||
bearerAuth: | ||
type: http | ||
scheme: bearer | ||
description: API Key provided by Caseflow | ||
schemas: | ||
payload: | ||
$ref: "./v1/payload.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type: object | ||
title: Vefs Error Response | ||
description: The root schema comprises generic File Store Errors. | ||
examples: | ||
- uuid: d1abad83-5468-4031-b42a-c487e19f46c7 | ||
code: VEFSERR0000 | ||
message: Unable to create valid response. | ||
properties: | ||
uuid: | ||
type: string | ||
format: uuid | ||
title: Error UUID | ||
description: UUID used to trace the error response | ||
examples: | ||
- d1abad83-5468-4031-b42a-c487e19f46c7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type: string | ||
title: Content Name | ||
description: The content name of the document being uploaded. This must be unique for the folder being uploaded to. For instance the document "pdf.pdf" cannot be uploaded twice for fileNumber 987654321. The acceptable file extensions are png, pdf, tif, tiff, txt, jpg, jpeg, and bmp. | ||
minLength: 4 | ||
maxLength: 256 | ||
pattern: "^[a-zA-Z0-9 Q`'~=+#^@$&-_.(){};[]E]+.[a-zA-Z]{3,4}$" | ||
example: filename.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type: object | ||
title: Vefs No/Invalid API Key Error Response | ||
description: Error response when no or invalid API Key is present on the request | ||
properties: | ||
messages: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
status: | ||
type: string | ||
enum: | ||
- "unauthorized" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type: object | ||
title: Upload Payload | ||
description: Payload containing content name and the provider specific data. <a href="#model-payload">Schema can be found here.</a> | ||
required: | ||
- contentName | ||
- providerData | ||
properties: | ||
contentName: | ||
$ref: './contentName.yml' | ||
providerData: | ||
$ref: './uploadProviderDataRequest.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
post: | ||
tags: | ||
- File | ||
summary: Upload a file with associated provider data | ||
description: |- | ||
### Upload a file. | ||
This endpoint when given a file and associated data returns a UUID which is a reference to the created object within Caseflow. Information on how to properly create a payload object for this endpoint is available in the schema section <a href="#model-payload">here</a>. (Upload Payload) | ||
operationId: upload | ||
parameters: | ||
- name: X-Folder-URI | ||
in: header | ||
description: >- | ||
This should have a value of BIN:NAME:Caseflow | ||
required: true | ||
schema: | ||
type: string | ||
example: 'BIN:NAME:Caseflow ' | ||
requestBody: | ||
required: true | ||
content: | ||
multipart/form-data: # Media type | ||
schema: # Request payload | ||
$ref: './uploadRequest.yml' | ||
responses: | ||
'200': | ||
description: >- | ||
Response containing the Correspondence package UUID | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './uploadResponse.yml' | ||
'400': | ||
description: Server was unable to understand the request. This may come back as an empty response if the json is malformed or not understood by the server. | ||
content: | ||
application/json: | ||
schema: | ||
oneOf: | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/INVALID_REQUEST' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/DOES_NOT_CONFORM_TO_SCHEMA' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/VALIDATE_INVALID_VALUE' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/DUPLICATE_PROVIDERDATA_KEYS' | ||
'401': | ||
description: API Key does not exist or is not authorized to access the resource. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './noApiKeyResponse.yml' | ||
'415': | ||
description: Unsupported Media Type. This is common when uploading an unacceptable file type. | ||
content: | ||
application/json: | ||
schema: | ||
oneOf: | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/INVALID_MIMETYPE' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/WRONG_MIMETYPE_EXTENSION' | ||
'500': | ||
description: >- | ||
There was an error encountered processing the Request. Response | ||
will contain a "messages" element that will provide further | ||
information on the error. Please retry. If problem persists, | ||
please contact support with a copy of the Response. | ||
content: | ||
application/json: | ||
schema: | ||
oneOf: | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/UNABLE_TO_DETERMINE_MIMETYPE' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/UNABLE_TO_UPLOAD_DATA' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/UNABLE_TO_PERSIST_DATA' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/UNABLE_TO_CONVERT' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/UNKNOWN_ERROR' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/JSON_DESERIALIZATION' | ||
- $ref: './vefsErrorCodes.yml#/components/schemas/JSON_SERIALIZATION' | ||
'501': | ||
description: This endpoint is not enabled. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './vefsErrorCodes.yml#/components/schemas/OPERATION_NOT_ENABLED' |
Oops, something went wrong.