-
Notifications
You must be signed in to change notification settings - Fork 1
/
openrpc.json
147 lines (147 loc) · 3.95 KB
/
openrpc.json
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
138
139
140
141
142
143
144
145
146
147
{
"openrpc": "1.2.4",
"info": {
"title": "Authentication with DID",
"version": "1.0.0"
},
"methods": [
{
"name": "login",
"description": "Logs in the user with a DID token",
"params": [
{
"name": "DIDTokenString",
"schema": {
"type": "string"
}
}
],
"result": {
"name": "JWTToken",
"description": "JWT Token for the user to use as a session.",
"schema": {
"type": "string",
"description": "JWT Token"
}
}
},
{
"name": "auth_login_with_address",
"description": "Prompts the user to login by signing a claim with their address",
"params": [
{
"name": "address",
"description": "address the user claims to own",
"schema": {
"pattern": "^0x[a-fA-F\\d]{40}$",
"title": "address",
"type": "string"
}
}
],
"result": {
"name": "claim",
"description": "the claim for the user to sign",
"schema": {
"$ref": "#/components/schemas/DIDTokenClaim"
}
},
"examples": [
{
"name": "exampleAuthLoginWithAddress",
"params": [
{
"name": "address",
"value": "0xA4d1e7f6642Df0330890c70372F3516797f11f2C"
}
],
"result": {
"name": "result",
"value": {
"iat": 1599245366,
"ext": 1599255366,
"iss": "did:ethr:0xA4d1e7f6642Df0330890c70372F3516797f11f2C",
"sub": "did:sig.tools:login",
"aud": "did:sig.tools:8066696d-7fb1-4a45-91a6-d43890c5c131",
"nbf": 1599245366,
"tid": "a1997f88-71ca-4d96-b220-df372b65b07b"
}
}
}
]
},
{
"name": "auth_required_method",
"description": "a route that requires a user to have recieved a JWT token from the login method",
"params": [
{
"name": "JWTToken",
"schema": {
"type": "string"
}
}
],
"result": {
"name": "authRequiredMethodResult",
"description": "Data returned from the authentication required method",
"schema": {
"type": "string",
"description": "random string data returned from auth required method"
}
}
}
],
"components": {
"schemas": {
"DIDTokenClaim": {
"title": "DIDTokenClaim",
"type": "object",
"properties": {
"iat": {
"title": "IssuedAt",
"description": "Issued at timestamp",
"type": "number"
},
"ext": {
"title": "Expiration",
"description": "Expiration timestamp",
"type": "number"
},
"nbf": {
"title": "NotValidBefore",
"description": "Not valid before timestamp",
"type": "number"
},
"iss": {
"title": "Issuer",
"description": "Issuer - Decentralized Identifier: https://w3c-ccg.github.io/did-primer/#the-format-of-a-did",
"type": "string",
"format": "^did:"
},
"sub": {
"title": "Subject",
"description": "Subject of the request, could be a nonce or uuid provided by the server.",
"type": "string",
"format": "^did:"
},
"aud": {
"title": "Audience",
"description": "Audience",
"type": "string",
"format": "^did:"
},
"add": {
"title": "Additional",
"description": "Optiona, additional signed data",
"type": "string"
},
"tid": {
"title": "TokenID",
"description": "DID TokenID",
"type": "string"
}
}
}
}
}
}