Git repository hosting, collaboration, and discovery for the Fediverse.
Add authentication back into the API
parent: tbd commit: c3639d1
1 | use FromStr; |
2 | |
3 | use ; |
4 | use |
5 | , |
6 | , | Instance
7 | , | ObjectBackend
8 | , |
9 | , | AnySetting
10 | , |
11 | ; |
12 | |
13 | use Result; |
14 | use ; |
15 | use info; |
16 | |
17 | |
18 | async |
19 | ; | init
20 | ?; | install
21 | |
22 | let pool = connect_other |
23 | ?, | from_str
24 | parse .unwrap, | .
25 | |
26 | .unwrap; |
27 | |
28 | let mut operation_state = new; |
29 | |
30 | let mut user = pool |
31 | . |
32 | .await?; |
33 | |
34 | info!; |
35 | |
36 | let display_name = user. .await?; |
37 | |
38 | info!; |
39 | |
40 | let repositories = user |
41 | .repositories |
42 | & from_str .unwrap, |
43 | &operation_state, |
44 | |
45 | .await?; |
46 | |
47 | // info!("Repository: {:#?}", repositories); |
48 | |
49 | let mut repository = pool |
50 | . |
51 | &repositories.first .unwrap .repository.to_string, |
52 | &operation_state, |
53 | |
54 | .await?; |
55 | |
56 | // info!("First repository: {}", repository.object().to_string()); |
57 | |
58 | // info!("First repository description: {}", repository.get::<Description>().await?); |
59 | // info!("First repository visibility: {:?}", repository.get::<Visibility>().await?); |
60 | // info!("First repository default branch: {}", repository.get::<DefaultBranch>().await?); |
61 | |
62 | info! |
63 | "First repository info: {:#?}", |
64 | repository.info .await? |
65 | ; |
66 | |
67 | Ok |
68 | |
69 |