Skip to content

Add file schema#218

Open
mrmalachai wants to merge 3 commits intovicinaehq:mainfrom
mrmalachai:feature/pass/file-schema
Open

Add file schema#218
mrmalachai wants to merge 3 commits intovicinaehq:mainfrom
mrmalachai:feature/pass/file-schema

Conversation

@mrmalachai
Copy link
Copy Markdown

Add feature satisfying issue 213. This is my first real attempt at something like this, so please toss me feedback!

Default behavior should be preserved if the new fileSchema config item is left blank or is null or undefined, otherwise the new behavior takes over. The JSON schema for this new string is as follows:

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "key": {
        "type": "string"
      },
      "type": {
        "type": "string",
        "enum": [
          "password",
          "otp",
          "field",
          "note"
        ]
      }
    }
  }
}

My personal configuration that I both used for testing and am going to be using in the future is as follows:

[
  {"key": "Password","type": "password"},
  {"key": "UserName","type": "field"},
  {"key": "URL","type": "field"},
  {"key": "OTP","type": "otp"}
]

This setup only takes into account lines without keys in them, so key: value will simply be treated as a value itself. This can be extended later.

Also ran npm audit fix as there were some vulns that were easy to fix.

@aurelleb
Copy link
Copy Markdown
Contributor

my understanding is that this is a custom file schema adjusted for this use case. While I'm not against it, how is a user expected to discover what the expected schema is?

@mrmalachai
Copy link
Copy Markdown
Author

my understanding is that this is a custom file schema adjusted for this use case. While I'm not against it, how is a user expected to discover what the expected schema is?

You are very correct. I added a description of the preference item, and a section explaining it to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants