WIP: Make admin token optional

This commit is contained in:
ViViDboarder 2019-10-02 13:05:35 -07:00
parent 829ed5585c
commit 2bcc971e83
2 changed files with 4 additions and 4 deletions

View File

@ -30,14 +30,14 @@ impl User {
pub struct Client {
url: String,
admin_token: String,
admin_token: Option<String>,
cookie: Option<String>,
cookie_created: Option<Instant>,
}
impl Client {
/// Create new instance of client
pub fn new(url: String, admin_token: String) -> Client {
pub fn new(url: String, admin_token: Option<String>) -> Client {
Client {
url,
admin_token,

View File

@ -37,7 +37,7 @@ pub fn read_config() -> Config {
pub struct Config {
// Bitwarden connection config
bitwarden_url: String,
bitwarden_admin_token: String,
bitwarden_admin_token: Option<String>,
// LDAP Connection config
ldap_host: String,
ldap_scheme: Option<String>,
@ -67,7 +67,7 @@ impl Config {
self.bitwarden_url.clone()
}
pub fn get_bitwarden_admin_token(&self) -> String {
pub fn get_bitwarden_admin_token(&self) -> Option<String> {
self.bitwarden_admin_token.clone()
}