-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssp_backend.did
129 lines (109 loc) · 2.84 KB
/
ssp_backend.did
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
type PublicKey = blob;
type UserKey = PublicKey;
type Timestamp = nat64;
type Signature = blob;
type PrepareDelegationResponse = record {
user_key : UserKey;
expiration : Timestamp;
};
type Delegation = record {
pubkey : PublicKey;
expiration : Timestamp;
targets : opt vec principal;
};
type SignedDelegation = record {
delegation : Delegation;
signature : Signature;
};
type GetDelegationResponse = variant {
signed_delegation : SignedDelegation;
no_such_delegation;
};
type Auth0JWK = record {
kty : text;
use : text;
n : text;
e : text;
kid : text;
x5t : text;
x5c : vec text;
alg : text;
};
type Auth0JWKS = record {
keys : vec Auth0JWK;
};
type Config = record {
backend_principal : opt principal;
};
type User = record {
sub : text;
db_id : text;
created_at : text;
};
type CertificateContent = record {
name : text;
issued_at : text;
sport_category : text;
notes : opt text;
file_uri : opt text;
external_id : opt text;
issuer_full_name : opt text;
issuer_club_name : opt text;
};
type Certificate = record {
user_principal : principal;
created_at : text;
content : CertificateContent;
managed_user_id : opt text;
};
type CreateCertificateContentRequest = record {
name : text;
issued_at : Timestamp;
sport_category : text;
notes : opt text;
file_uri : opt text;
external_id : opt text;
issuer_full_name : opt text;
issuer_club_name : opt text;
};
type CreateCertificateRequest = record {
user_db_id : text;
content : CreateCertificateContentRequest;
managed_user_db_id : opt text;
};
type CreateCertificateResponse = record {
id : text;
};
type GetUserCertificatesRequest = record {
user_principal : opt principal;
user_db_id : opt text;
};
type CertificatePreviewWithId = record {
id : text;
name : text;
};
type GetUserCertificatesResponse = record {
certificates : vec CertificatePreviewWithId;
};
type CertificateWithId = record {
id : text;
certificate_cbor_hex : text;
};
type GetCertificateResponse = record {
certificate : CertificateWithId;
ic_certificate : blob;
ic_certificate_witness : blob;
};
service : {
"prepare_delegation" : (text) -> (PrepareDelegationResponse);
"get_delegation" : (text, Timestamp) -> (GetDelegationResponse) query;
"sync_jwks" : () -> ();
"set_jwks" : (Auth0JWKS) -> ();
"get_jwks" : () -> (opt Auth0JWKS) query;
"set_backend_principal" : (principal) -> ();
"get_config" : () -> (Config) query;
"get_my_user" : () -> (User) query;
"create_certificate" : (CreateCertificateRequest) -> (CreateCertificateResponse);
"get_user_certificates" : (GetUserCertificatesRequest) -> (GetUserCertificatesResponse) query;
"get_certificate" : (text) -> (GetCertificateResponse) query;
};