Skip to content

Commit 96716a3

Browse files
feat: Add schema for Google Digital Assetlinks (SchemaStore#4598)
* feat: Add schema for Google Digital Assetlinks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d5282fd commit 96716a3

File tree

4 files changed

+123
-0
lines changed

4 files changed

+123
-0
lines changed

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7839,6 +7839,12 @@
78397839
"description": "A Contextive Domain Language Glossary",
78407840
"fileMatch": ["**/.contextive/definitions.yml", "*.glossary.yml"],
78417841
"url": "https://json.schemastore.org/contextive-glossary.json"
7842+
},
7843+
{
7844+
"name": "Google Digital Assetlinks",
7845+
"description": "JSON-encoded statement list in a well-known location on a principal",
7846+
"fileMatch": ["assetlinks.json"],
7847+
"url": "https://json.schemastore.org/assetlinks.json"
78427848
}
78437849
]
78447850
}

src/schema-validation.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"$schema": "./schema-validation.schema.json",
33
"ajvNotStrictMode": [
4+
"assetlinks.json",
45
"anywork-ac-1.0.json",
56
"anywork-ac-1.1.json",
67
"apibuilder.json",

src/schemas/json/assetlinks.json

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/assetlinks.json",
4+
"$defs": {
5+
"android_app": {
6+
"description": "The target asset belong to an android application",
7+
"type": "object",
8+
"additionalProperties": false,
9+
"required": ["namespace", "package_name", "sha256_cert_fingerprints"],
10+
"properties": {
11+
"namespace": {
12+
"description": "Must be android_app for Android apps",
13+
"type": "string",
14+
"const": "android_app"
15+
},
16+
"package_name": {
17+
"description": "Android application's package name",
18+
"type": "string",
19+
"pattern": "^([A-Za-z]{1}[A-Za-z\\d_]*\\.)+[A-Za-z][A-Za-z\\d_]*$"
20+
},
21+
"sha256_cert_fingerprints": {
22+
"description": "SHA256s from keystore",
23+
"type": "array",
24+
"uniqueItems": true,
25+
"items": {
26+
"type": "string",
27+
"minItems": 1,
28+
"pattern": "^(?:[A-F0-9]{2}:){31}[A-F0-9]{2}$"
29+
}
30+
}
31+
}
32+
},
33+
"web": {
34+
"description": "The target asset belong to a web application",
35+
"type": "object",
36+
"additionalProperties": false,
37+
"required": ["namespace", "site"],
38+
"properties": {
39+
"namespace": {
40+
"description": "Must be web for websites",
41+
"type": "string",
42+
"const": "web"
43+
},
44+
"site": {
45+
"description": "Website's uri that following the format http[s]://<hostname>[:<port>]",
46+
"type": "string"
47+
}
48+
}
49+
},
50+
"relation": {
51+
"description": "Describe the relation being declared about the target",
52+
"type": "array",
53+
"items": {
54+
"minItems": 1,
55+
"oneOf": [
56+
{
57+
"const": "delegate_permission/common.handle_all_urls",
58+
"description": "Grants the target permission to handle all URLs that the source can handle"
59+
},
60+
{
61+
"const": "delegate_permission/common.get_login_creds",
62+
"description": "Grants the target permission to retrieve sign-in credentials stored for the source"
63+
}
64+
]
65+
}
66+
}
67+
},
68+
"title": "Google Digital Assetlinks",
69+
"description": "Google Digital Assetlinks Schema",
70+
"type": "array",
71+
"items": {
72+
"title": "Statement list",
73+
"description": "Website or app statements as JSON objects",
74+
"type": "object",
75+
"additionalProperties": false,
76+
"minItems": 1,
77+
"properties": {
78+
"relation": {
79+
"$ref": "#/$defs/relation"
80+
},
81+
"target": {
82+
"description": "The target asset to whom this statement applies",
83+
"type": "object",
84+
"oneOf": [
85+
{
86+
"$ref": "#/$defs/android_app"
87+
},
88+
{
89+
"$ref": "#/$defs/web"
90+
}
91+
]
92+
}
93+
}
94+
}
95+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[
2+
{
3+
"relation": ["delegate_permission/common.get_login_creds"],
4+
"target": {
5+
"namespace": "web",
6+
"site": "https://example.com"
7+
}
8+
},
9+
{
10+
"relation": ["delegate_permission/common.handle_all_urls"],
11+
"target": {
12+
"namespace": "android_app",
13+
"package_name": "com.example.app",
14+
"sha256_cert_fingerprints": [
15+
"F4:D5:50:A6:AC:6A:DD:74:71:A3:13:60:F5:2F:59:8A:24:58:D5:AE:45:20:13:3A:20:ED:66:5A:3D:4B:D1:C2",
16+
"86:BC:8E:C4:BD:E2:1E:08:76:AF:38:E8:47:78:C9:C7:3B:05:D6:64:87:87:AB:DE:B7:BA:E5:52:73:4C:85:6B",
17+
"1D:5E:3A:46:76:2A:8C:1F:B2:FC:65:07:16:F6:84:0A:2C:A9:AD:1B:AD:68:8D:E3:A5:19:81:F1:B9:3F:EA:7B"
18+
]
19+
}
20+
}
21+
]

0 commit comments

Comments
 (0)