forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpermission-list-schema.js
55 lines (53 loc) · 1.31 KB
/
permission-list-schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env node
// This schema is used to validate
// src/github-apps/data/fine-grained-pat-permissions.json
// and src/github-apps/data/server-to-server-permissions.json
const permissionObjects = {
type: 'object',
required: ['access', 'category', 'subcategory', 'slug', 'verb', 'requestPath'],
properties: {
access: {
type: 'string',
enum: ['read', 'write', 'admin'],
},
category: {
type: 'string',
},
subcategory: {
type: 'string',
},
slug: {
type: 'string',
},
verb: {
type: 'string',
enum: ['get', 'patch', 'post', 'put', 'delete'],
},
requestPath: {
type: 'string',
},
'additional-permissions': {
type: 'array',
},
},
}
export default {
type: 'object',
required: ['title', 'displayTitle', 'permissions'],
properties: {
// Properties from the source OpenAPI schema that this module depends on
title: {
description: 'The name of the permission.',
type: 'string',
},
displayTitle: {
description: 'The display title, which includes the resource group and permission name',
type: 'string',
},
permissions: {
description: 'An oject with keys for read and write, each with an array of objects.',
type: 'array',
items: permissionObjects,
},
},
}