-
Notifications
You must be signed in to change notification settings - Fork 4
Implement projects as groups #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Ok(()) | ||
} | ||
|
||
pub fn add_user_to_groups(user: &str, groups: &[String]) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this function be changed so that it is OS agnostic?
src/lib/logger.rs
Outdated
use crate::config::read_config; | ||
use crate::utils::parse_offset; | ||
|
||
pub fn log(filepath: &str, status: &str, message: &str) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using a log library would be better instead of writing our own logger. That way we can also have fine control over the required log level.
src/update.rs
Outdated
|
||
pub fn handle_update() -> Result<()> { | ||
let mut users: Vec<String>= Vec::new(); | ||
logger::logln("in handle_update"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also wouldn't need these lines if we use a logging crate.
src/lib/utils.rs
Outdated
use crate::{errors::*, logger}; | ||
|
||
use crate::errors::*; | ||
pub const AUTH_LOG_PATH: &str = "/opt/watchdog/custom-logs/auth.logs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be defined in another file, as they are not utilities.
src/ssh.rs
Outdated
use lib::keyhouse::get_name; | ||
use lib::notifier; | ||
use lib::utils::clear_file; | ||
//use lib::utils::clear_file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove the unused use
statement.
toml_edit="0.1.5" | ||
nix = "0.9.0" | ||
openssl = "0.10" | ||
openssl-sys = "0.9.58" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see these used anywhere. Is there a reason for including openssl?
src/lib/keyhouse.rs
Outdated
logger::logln(&format!("Projects: {:?}", projects)); | ||
Ok(projects) | ||
} else { | ||
logger::logln(&format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logging should ideally be done by the caller, after handling the returned error. Both logging it and returning the same error does not make sense.
nit: an empty line separating relevant sections of code would be nice to enhance readability. Also, it seems to me that some files have not been formatted. Although, that might just be because we use different formatting settings. |
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
Signed-off-by: Arshdeep54 <[email protected]>
No description provided.