Skip to content

Commit

Permalink
Merge pull request #20 from MrSpock/master
Browse files Browse the repository at this point in the history
added option for disabling authentication to ACS
  • Loading branch information
guillaumepellegrino authored Aug 15, 2024
2 parents 0df3418 + 7412933 commit f9f67f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/acs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ impl Acs {
identity_password: String::from("ACSRS"),
secure_address: String::from("[::0]:8443"),
management_address: String::from("127.0.0.1:8000"),
noauth: false
},
basicauth: Self::basicauth(&username, &password),
cpe_list: HashMap::new(),
Expand Down
1 change: 1 addition & 0 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub struct AcsConfig {
pub secure_address: String,
pub unsecure_address: String,
pub management_address: String,
pub noauth: bool,
}

#[derive(Debug, PartialEq, Default, Deserialize, Serialize)]
Expand Down
8 changes: 5 additions & 3 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,11 @@ impl TR069Session {
req: &mut Request<IncomingBody>,
) -> Result<Response<Full<Bytes>>> {
self.counter += 1;

if let Some(reply) = self.authorization_error(req).await {
return reply;
let noauth = self.acs.read().await.config.noauth;
if !noauth {
if let Some(reply) = self.authorization_error(req).await {
return reply;
}
}

let command = utils::req_path(req, 1);
Expand Down

0 comments on commit f9f67f1

Please sign in to comment.