Git repository hosting, collaboration, and discovery for the Fediverse.
Add connection pool
parent: tbd commit: 98d3b04
1 | use FromStr; |
2 | |
3 | use ; |
4 | use |
5 | , | Instance
6 | , |
7 | , | User
8 | ; |
9 | use ; |
10 | use ; |
11 | // use jwt::SignWithKey; |
12 | |
13 | |
14 | extern crate tracing; |
15 | |
16 | |
17 | async |
18 | ; | init
19 | |
20 | let pool = connect .unwrap; |
21 | |
22 | let mut api = from_local |
23 | .unwrap |
24 | .private_key |
25 | .public_key |
26 | .build |
27 | .await |
28 | .unwrap; |
29 | |
30 | info!; |
31 | |
32 | let response = api |
33 | .register |
34 | String from, |
35 | None, |
36 | String from, |
37 | &pool, |
38 | |
39 | .await; |
40 | |
41 | info!; |
42 | |
43 | let token = api |
44 | .authentication_token |
45 | String from, |
46 | String from, |
47 | String from, |
48 | &pool, |
49 | |
50 | .await |
51 | .unwrap; |
52 | |
53 | println!; |
54 | |
55 | let public_key = api.public_key .await; |
56 | |
57 | println!; |
58 | let verification_key = from_rsa_pem .unwrap; |
59 | let data: = decode |
60 | &token, |
61 | &verification_key, |
62 | & new, |
63 | |
64 | .unwrap; |
65 | |
66 | println!; |
67 | |
68 | info!; |
69 | |
70 | let new_token = api |
71 | .extend_token |
72 | .await |
73 | .unwrap; |
74 | info!; |
75 | |
76 | info!; |
77 | |
78 | let repository = api |
79 | .create_repository |
80 | new_token.unwrap, |
81 | String from, |
82 | None, |
83 | , | Public
84 | String from, |
85 | unwrap, | from_str .
86 | &pool, |
87 | |
88 | .await |
89 | .unwrap; |
90 | |
91 | assert!; |
92 | |
93 | info!; |
94 | |
95 | let view = api |
96 | .repository_info |
97 | &token, |
98 | unwrap, | from_str .
99 | &pool, |
100 | |
101 | .await |
102 | .unwrap; |
103 | |
104 | info!; |
105 | |
106 | Ok |
107 | |
108 | |
109 | |
110 | |
111 | user: User, |
112 | generated_for: Instance, |
113 | exp: u64, |
114 | |
115 |