Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Allow CDAP users to securely store sensitive data.
  2. Allow authorized CDAP users to access stored data at runtime.
  3. Allow authorized CDAP users to manage the stored data.

Checklist

  •  User stories documented (Nishith)
  •  User stories reviewed (Nitin)
  •  Design documented (Nishith)
  •  Design reviewed (Andreas/Terence)
  •  Feature merged (Nishith)
  •  Blog post 

...

Code Block
languagejava
titleSecure Store Programmatic API
// Represents the metadata about the data
interface SecureStoreMetaData {
  String getName();
  String getDescription();
  long getLastModifiedTime();
  Map<String, String> getProperties();
}
 
// Represents the secure data
interface SecureStoreData {
  // Returns the meta data about the secure data
  SecureStoreMetaData getMetaData();
 
  // Returns the secure data
  byte[]String get();
}
 
// Provides read-only access to secure store
interface SecureStore {
  // Returns a map with names as key and descriptions as the value of available 
  // secure data in the store.
  Map<String, String> list(String namespace);
 
  // Gets the secure data
  SecureStoreData get(String namespace, String name);
}
 
// Manager interface for managing secure data
interface SecureStoreManager {
  // Stores the secure data
  void put(String namespace, String name, byte[]String data, Map<String, String> properties);
 
  // Remove the secure data
  void delete(String namespace, String name);
}

...

OperationREST APIBodyResponse
PutPUT /v3/security/store/namespaces/<namespace>/key

Content-Type: application/json

Code Block
titlePut Data
{
  "name"        :  "<name>"
  "description" :  "<description>"
  "data"        :  "<data>"  //utf-8
  "properties"  :  {
    "key"  :  "value"
	...
  }
}

200 OK

DeleteDELETE /v3/security/store/namespaces/<namespace>/keys/<key-name>N/A

200 OK

404 Not Found

Get

GET /v3/security/store/namespaces/<namespace>/keys/<key-name>

N/A

200 OK

Content-Type: application/json

Code Block
{
  "name"  :  "<name>"
  "data"  :  "<data>"  //utf-8
}

404 Not Found

Get MetadataGET /v3/security/store/namespaces/<namespace>/keys/<key-name>/metadataN/A

200 OK

Content-Type: application/json

Code Block
{
  "name"        :  "<name>"
  "description" :  "<description>"
  "created"     :  <millis-epoch> //long
  "properties"  :  {
    "key"  :  "value"
	...
  }
}

404 Not Found

ListGET /v3/security/store/namespaces/<namespace>/keys/N/A

200 OK

Content-Type: application/json

Code Block
[
  {
	"name"        : "<name>"
	"description" : "<description>"
  }
  {
	"name"        : "<name>"
	"description" : "<description>"

  }
  {
	"name"        : "<name>"
	"description" : "<description>"

  }
  ...
]

...