1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Validate plugin ID

This commit is contained in:
Laurent Cozic 2021-01-06 20:27:04 +00:00
parent 8d4d438136
commit 7114228fd6
2 changed files with 5 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { PluginManifest, PluginPermission } from './types';
import validatePluginId from './validatePluginId';
export default function manifestFromObject(o: any): PluginManifest {
@ -28,9 +29,12 @@ export default function manifestFromObject(o: any): PluginManifest {
author: getString('author', false),
description: getString('description', false),
homepage_url: getString('homepage_url', false),
repository_url: getString('repository_url', false),
permissions: permissions,
};
validatePluginId(manifest.id);
if (o.permissions) {
for (const p of o.permissions) {
manifest.permissions.push(p);

View File

@ -11,6 +11,7 @@ export interface PluginManifest {
author?: string;
description?: string;
homepage_url?: string;
repository_url?: string;
permissions?: PluginPermission[];
// Private keys