MCPcopy Index your code
hub / github.com/endbasic/endbasic / do_login

Method do_login

client/src/cloud.rs:560–566  ·  view source on GitHub ↗

Authenticates against the server using the username and password passed in via environment variables. We need to support multiple test accounts at the same time, so this performs authentication for the test account `i`. Returns the username of the selected test account for convenience.

(&mut self, i: u8)

Source from the content-addressed store, hash-verified

558 ///
559 /// Returns the username of the selected test account for convenience.
560 pub(crate) async fn do_login(&mut self, i: u8) -> String {
561 let username = self.get_username(i);
562 let password = env::var(format!("TEST_ACCOUNT_{}_PASSWORD", i))
563 .expect("Expected env config not found");
564 let _response = self.service.login(&username, &password).await.unwrap();
565 username
566 }
567
568 /// Clears the authentication token to represent a log out.
569 pub(crate) async fn do_logout(&mut self) {

Callers 12

runFunction · 0.45
test_clouddrive_deleteFunction · 0.45
test_clouddrive_getFunction · 0.45
test_clouddrive_get_aclsFunction · 0.45
test_clouddrive_put_newFunction · 0.45
test_clouddrive_put_aclsFunction · 0.45

Calls 2

get_usernameMethod · 0.80
loginMethod · 0.45