Exploit database

GH-0796e1841535bb9008bc5c3b1e3baf27

42bytelabs/konarr

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-44228

465 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files6
42bytelabs/konarrRevision ead94a5a437a

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/utils/config/client.rs

Rust · 1,080 bytes
use super::{Config, ServerConfig};
use crate::KonarrClient;

impl Config {
    #[cfg(feature = "models")]
    /// Get Database Connection
    pub async fn database(&self) -> Result<geekorm::ConnectionManager, crate::KonarrError> {
        self.database.database().await
    }
}

impl ServerConfig {
    /// Get the Konarr Client
    pub fn client(&self) -> Result<KonarrClient, crate::KonarrError> {
        Ok(KonarrClient::init().base(self.api_url()?)?.build()?)
    }

    /// Get the Konarr Client with Token
    pub fn client_with_token(&self, token: String) -> Result<KonarrClient, crate::KonarrError> {
        Ok(KonarrClient::init()
            .base(self.api_url()?)?
            .token(token)
            .build()?)
    }

    /// Get the Konarr Client with Credentials
    pub fn client_with_credentials(
        &self,
        username: String,
        password: String,
    ) -> Result<KonarrClient, crate::KonarrError> {
        Ok(KonarrClient::init()
            .base(self.api_url()?)?
            .credentials(username, password)
            .build()?)
    }
}