-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpeerdescriptor-schema.yaml
137 lines (131 loc) · 3.69 KB
/
peerdescriptor-schema.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
$schema: http://json-schema.org/draft-06/schema#
id: http://intercoop.somenergia.coop/peerinfo-schema/1.0/#
title: Peer catalog and api information for intercooperation
description: >
This schema defines a format to describe a peer entity
in a intercooperation context using the intercoop protocol.
It includes information to be able to display a catalog
of services and how to activate them via an intercoop api.
type: object
required:
- intercoopVersion
- peerVersion
- peerid
- name
- logo
- description
- url
- privacyPolicyUrl
- services
- targetUrl
additionalProperties: false
properties:
intercoopVersion:
type: string
pattern: '[0-9]+(\.[0-9]+)*'
enum:
- "1.0" # Force current version
peerVersion:
type: integer
peerid:
type: string
pattern: '^[a-z]+$'
name:
title: Entity name
type: string
logo:
title: Url to the entity logo
type: string
publickey:
title: Public RSA key in PEM format that others peers can use to validate signed messages from the entity
type: string
description:
title: Single line entity description
$ref: "#/definitions/translatable"
url:
title: Url to entity's web page
$ref: "#/definitions/translatable"
privacyPolicyUrl:
title: A link to the entity privacy policy
$ref: "#/definitions/translatable"
info:
title: Extended information in markdown format
$ref: "#/definitions/translatable"
services:
title: Services that the entity offers
type: object
patternProperties:
"^[a-z]+$":
$ref: "#/definitions/service"
additionalProperties: false
dataFormat:
type: string
default: yaml
enum:
- yaml
- json
- xml
targetUrl:
title: base Url to redirect services
type: string
fields:
title: Transferred fields for any service not specifying it
default:
- peerid
- nif
$ref: "#/definitions/transferFields"
definitions:
transferFields:
title: fields that a service could request to share
type: array
items:
type: string
enum:
- originpeer # slug id of the source entity (required)
- innerid # serial number within the source entity
- peerroles # list of roles within the source entity (member, worker, customer...)
- nif # includes dni, cie and cif
- name # "surname, fistname" for physical persons,
- address
- postalcode
- city
- state
- country # ISO code
- phone # Preferred contact phone
- email # Preferred contact email
- lang # Language preferred by the user (ISO code)
- langs # Languages accepted by the user sorted by preference (ISO code)
- proxynif # For legal persons, the proxy phisical person nif (see nif)
- proxyname # For legal persons, the proxy phisical person name (see name)
translatable:
title: strings that can be optionally translated
description: >
Translatable strings may have plain string values
or they can contain a map of translations with the
2-letters of the lang ISO code.
anyOf:
- description: optionally untranslated string
type: string
- description: a map of translations including at least 'es'
type: object
required:
- es
additionalProperties: false
patternProperties:
(es|ca|gl|eu|an|ast|oc):
type: string
service:
type: object
required:
- name
- description
additionalProperties: false
properties:
name:
$ref: "#/definitions/translatable"
description:
$ref: "#/definitions/translatable"
fields:
description: Fields to be transferred to activate the service
$ref: "#/definitions/transferFields"
# vim: et ts=2 sw=2