Variables
The Variable API securely creates, retrieves, updates, and deletes user variables, encrypting and decrypting confidential data as needed via REST endpoints.
Description
- Variable rest API will be triggered with a input request contains credentials and user details.
- API will process the request and sends data to entity: Variables which will stores the data to DynamoDB table by encrypting the confidential data in request by using Vince crypto library
- Retrieve the user details from DynamoDB, and decrypt the confidential data(encrypted data) then sends back decrypted data as response to the consumer.
- Update the user data in DynamoDB.
- Deletes the user data from DynamoDB.
Operations
only admin and tenent users will have the access to the encryption key.)
- Variable rest API does CRUD operations on the user data.
- Create:
- API will be creating new user data in DynamoDB by encrypting the selected data(i.e. confidential data).
- ‘POST’ method used for this operation.
- Read:
- API will be fetching the user data from DynamoDB and decrypting the selected data and return back the response to the consumer(vince API’s ,..!).
- ‘GET’ method used for this operation.
- Update:
- API updates the existing user data in the DynamoDB.
- ‘PUT’ method used for this operation.
- Delete:
- API deletes the user data from DynamoDB.
- ‘DELETE’ method used for this operation.
- Create:
Headers
| Field Name | type | cardinality | Enumerations | sample | Comments/Description |
|---|---|---|---|---|---|
| Content-Type | string | Mandatory(M) | application/json | This is to indicate the original media type of the resource | |
| Authorization | string | Mandatory(M) | eyJraWQiOiJhQUxE……….. | Authorization token |
Create : POST /v1/api/variables/
Field Definitions
Headers:
Request
| Field Name | type | cardinality | Enumerations | sample | Comments/Description |
|---|---|---|---|---|---|
variableName |
string | M | Maxwell | Unique Identification for the user in the particular tenent. | |
value |
string | M | Maxwell@lantmannen | User’s Password | |
isSecret |
string | M | [true,false] | true | This field is used to indicate the variable to be encrypted decrypted |
Response
201 : Variable created successfully
400 : Bad request 401 : Unauthorized
Read : GET /v1/api/variables/{key}
Field Definitions
Headers:
Response
| Field Name | type | cardinality | Enumerations | sample | Comments/Description |
|---|---|---|---|---|---|
tenantId |
string | M | lantmannen | Unique Identification for the tenent. | |
variableName |
string | M | Maxwell | Unique Identification for the user in the particular tenent. | |
value |
string | M | Maxwell@lantmannen | User’s Password | |
isSecret |
string | M | [true,false] | true | This field is used to indicate the variable to be encrypted decrypted |
Read List : GET /v1/api/variables
5.4.1.Field Definitions
Headers:
Response
| Field Name | type | cardinality | Enumerations | sample | Comments/Description |
|---|---|---|---|---|---|
tenantId |
string | M | lantmannen | Unique Identification for the tenent. | |
variableName |
string | M | Maxwell | Unique Identification for the user in the particular tenent. | |
value |
string | M | Maxwell@lantmannen | User’s Password | |
isSecret |
string | M | [true,false] | true | This field is used to indicate the variable to be encrypted decrypted |
Update : PUT /v1/api/variables/{key}
Field Definitions
Headers:
Request
| Field Name | type | cardinality | Enumerations | sample | Comments/Description |
|---|---|---|---|---|---|
variableName |
string | M | Maxwell | Unique Identification for the user in the particular tenent. | |
value |
string | M | Maxwell@lantmannen | User’s Password | |
isSecret |
string | M | [true,false] | true | This field is used to indicate the variable to be encrypted decrypted |
Response
200 : Variable updated successfully
400 : Bad request 401 : Unauthorized
DELETE /v1/api/variables/{key}
Field Definitions
Headers:
Response
204 : Variable deleted successfully 401 : Unauthorized 404 : Id not found
Sample Messages
Header sample
{
Content-Type:application/json
Authorization:eyJraWQiOiJhQUxE……….
}
Sample Request Create/Update
{
variableName: string
value: string
isSecret: bool
}
Sample Response Create/Update
{
statusCode: 200,
body:'Request processed succesfully'
}
Sample Request Read
{
}
Sample Response Read
{
tenantId: string
variableName: string
value: string
isSecret: bool
}
Sample Request Delete
{
}
Sample Response Delete
{
statusCode: 204,
body:'deleted succesfully'
}