feat: switch conductor to use bearer auth
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Aravinth Manivannan 2022-12-29 17:41:19 +05:30
parent ce5b28292e
commit 998060777f
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
3 changed files with 2 additions and 3 deletions

View file

@ -4,7 +4,7 @@ allow_registration = true
source_code = "https://git.batsense.net/LibrePages/pages"
support_email = "support@librepages.example.org"
conductors = [
{ username = "librepages_api", api_key = "longrandomlygeneratedpassword", url = "http://localhost:5000"}
{ api_key = "longrandomlygeneratedpassword", url = "http://localhost:5000"}
]
[server]

View file

@ -45,7 +45,7 @@ impl Conductor {
event_url.set_path("/api/v1/events/new");
self.client
.post(event_url)
.basic_auth(&c.username, Some(&c.api_key))
.bearer_auth(&c.api_key)
.json(e)
.send()
.await

View file

@ -88,7 +88,6 @@ pub struct Settings {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Conductor {
pub username: String,
pub api_key: String,
pub url: Url,
}