-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathic_backend.did
55 lines (47 loc) · 1.14 KB
/
ic_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
type UserSub = text;
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 AuthenticatedResponse = record {
user_sub : UserSub;
user_principal : principal;
};
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;
};
service : {
"prepare_delegation" : (text) -> (PrepareDelegationResponse);
"get_delegation" : (text, Timestamp) -> (GetDelegationResponse) query;
"authenticated" : () -> (AuthenticatedResponse) query;
"sync_jwks" : () -> ();
"set_jwks" : (Auth0JWKS) -> ();
"get_jwks" : () -> (opt Auth0JWKS) query;
};