Skip to content

Commit

Permalink
feat(core-api): add plugin object store interface definition
Browse files Browse the repository at this point in the history
This will be implemented by object store plugins so as to
have guarantee that at runtime the plugins can be used the
way the caller expects them to.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Jul 11, 2021
1 parent e54f2f9 commit 4bf8038
Show file tree
Hide file tree
Showing 6 changed files with 318 additions and 30 deletions.
30 changes: 1 addition & 29 deletions packages/cactus-core-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

183 changes: 182 additions & 1 deletion packages/cactus-core-api/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
],
"properties": {
"id": {
"$ref": "PluginInstanceId"
"$ref": "#/components/schemas/PluginInstanceId"
},
"packageName": {
"type": "string",
Expand Down Expand Up @@ -421,6 +421,124 @@
}
}
},
"GetObjectRequestV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to get from the object store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"GetObjectResponseV1": {
"type": "object",
"required": [
"key",
"value"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to retrieve the value from the object store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"value": {
"type": "string",
"description": "The value associated with the requested key in the object store as a string.",
"minLength": 0,
"maxLength": 10485760,
"nullable": false
}
}
},
"HasObjectRequestV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key to check for presence in the object store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"HasObjectResponseV1": {
"type": "object",
"required": [
"key",
"isPresent",
"checkedAt"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to check the presence of the value in the object store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"checkedAt": {
"type": "string",
"description": "Date and time encoded as JSON when the presence check was performed by the plugin backend.",
"nullable": false
},
"isPresent": {
"type": "boolean",
"description": "The boolean true or false indicating the presence or absence of an object under 'key'.",
"nullable": false
}
}
},
"SetObjectRequestV1": {
"type": "object",
"required": [
"key",
"value"
],
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to set in the object store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"value": {
"type": "string",
"description": "The value that will be associated with the key in the object store.",
"minLength": 0,
"maxLength": 10485760,
"nullable": false
}
}
},
"SetObjectResponseV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to set the value in the object store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"GetKeychainEntryRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -499,6 +617,39 @@
}
},
"requestBodies": {
"object_store_get_object_v1_request_body": {
"description": "Request body to obtain an object via its key.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetObjectRequestV1"
}
}
}
},
"object_store_set_object_v1_request_body": {
"description": "Request body to set an object under a key.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetObjectRequestV1"
}
}
}
},
"object_store_has_object_v1_request_body": {
"description": "Request body to check presence of an object under a key.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasObjectRequestV1"
}
}
}
},
"keychain_get_entry_request_body": {
"description": "Request body to obtain a keychain entry via its key",
"required": true,
Expand All @@ -523,6 +674,36 @@
}
},
"responses": {
"object_store_get_object_v1_response_body": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetObjectResponseV1"
}
}
}
},
"object_store_set_object_v1_response_body": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetObjectResponseV1"
}
}
}
},
"object_store_has_object_v1_response_body": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasObjectResponseV1"
}
}
}
},
"keychain_get_entry_200": {
"description": "OK",
"content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,76 @@ export interface GetKeychainEntryResponse {
*/
value: string;
}
/**
*
* @export
* @interface GetObjectRequestV1
*/
export interface GetObjectRequestV1 {
/**
* The key for the entry to get from the object store.
* @type {string}
* @memberof GetObjectRequestV1
*/
key: string;
}
/**
*
* @export
* @interface GetObjectResponseV1
*/
export interface GetObjectResponseV1 {
/**
* The key that was used to retrieve the value from the object store.
* @type {string}
* @memberof GetObjectResponseV1
*/
key: string;
/**
* The value associated with the requested key in the object store as a string.
* @type {string}
* @memberof GetObjectResponseV1
*/
value: string;
}
/**
*
* @export
* @interface HasObjectRequestV1
*/
export interface HasObjectRequestV1 {
/**
* The key to check for presence in the object store.
* @type {string}
* @memberof HasObjectRequestV1
*/
key: string;
}
/**
*
* @export
* @interface HasObjectResponseV1
*/
export interface HasObjectResponseV1 {
/**
* The key that was used to check the presence of the value in the object store.
* @type {string}
* @memberof HasObjectResponseV1
*/
key: string;
/**
* Date and time encoded as JSON when the presence check was performed by the plugin backend.
* @type {string}
* @memberof HasObjectResponseV1
*/
checkedAt: string;
/**
* The boolean true or false indicating the presence or absence of an object under \'key\'.
* @type {boolean}
* @memberof HasObjectResponseV1
*/
isPresent: boolean;
}
/**
*
* @export
Expand Down Expand Up @@ -461,4 +531,36 @@ export interface SetKeychainEntryResponse {
*/
key: string;
}
/**
*
* @export
* @interface SetObjectRequestV1
*/
export interface SetObjectRequestV1 {
/**
* The key for the entry to set in the object store.
* @type {string}
* @memberof SetObjectRequestV1
*/
key: string;
/**
* The value that will be associated with the key in the object store.
* @type {string}
* @memberof SetObjectRequestV1
*/
value: string;
}
/**
*
* @export
* @interface SetObjectResponseV1
*/
export interface SetObjectResponseV1 {
/**
* The key that was used to set the value in the object store.
* @type {string}
* @memberof SetObjectResponseV1
*/
key: string;
}

Loading

0 comments on commit 4bf8038

Please sign in to comment.