Defaultinator / defaultinator-api

MIT License
1 stars 2 forks source link

Support edit history for Credential objects #6

Closed luciddr34m3r closed 2 years ago

luciddr34m3r commented 2 years ago

Users should be able to view the edit history for a credential object.

luciddr34m3r commented 2 years ago

sampleCredential should be updated like this to conform with the API schema (https://github.com/Defaultinator/defaultinator-api/issues/9)

the apikey field is omitted in the test credential because it shouldn't be returned from the API.

export const sampleCredential = {
  "references": [
    "http://192-168-1-1-ip.co/manuals/1107.pdf"
  ],
  "_id": "23452345",
  "username": "foo",
  "password": "bar",
  "protocol": "Unknown",
  "cpe": {
    "_id": "234523452345",
    "part": "a",
    "product": "11wa_321a",
    "vendor": "11wave",
    "version": "ANY",
    "language": "ANY",
    "update": "ANY",
    "edition": "ANY"
  },
  "edits": [
    {
      "edit": {
        "references": [
          "http://192-168-1-1-ip.co/manuals/1107.pdf"
        ],
        "username": "foo",
        "password": "",
        "protocol": "Unknown",
        "cpe": {
          "part": "a",
          "product": "11wa_321a",
          "vendor": "11wave",
          "version": "ANY",
          "language": "ANY",
          "update": "ANY",
          "edition": "ANY"
        }
      },
      "timestamp": 1642110033,
    },
    {
      "edit": {
        "password": "bar",
      },
      "timestamp": 1642110133,
    },
  ],
  "__v": 0
};