-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,001 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Added | ||
body: Initial code for artemis client | ||
time: 2024-04-09T22:01:12.716881-04:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Added | ||
body: Initial script for macOS app sigining | ||
time: 2024-04-09T22:01:42.622749-04:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "client" | ||
license = { workspace = true } | ||
edition = { workspace = true } | ||
version = { workspace = true } | ||
homepage = { workspace = true } | ||
repository = { workspace = true } | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tokio = { workspace = true } | ||
log = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
uuid = { workspace = true } | ||
toml = { workspace = true } | ||
reqwest = { workspace = true } | ||
sysinfo = { workspace = true } | ||
|
||
common = { path = "../common" } | ||
|
||
tokio-tungstenite = "0.21.0" | ||
|
||
[dev-dependencies] | ||
httpmock = "0.7.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use client::client::start; | ||
use std::{env, path::Path}; | ||
|
||
fn main() { | ||
let args: Vec<String> = env::args().collect(); | ||
|
||
if args.len() == 2 { | ||
let path = &args[1]; | ||
if Path::new(path).is_file() { | ||
start(path); | ||
} else { | ||
println!("Not client config file") | ||
} | ||
} else { | ||
println!("Require TOML config input file. See tests for an example") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use crate::{enrollment::enroll::enroll_client, filesystem::config::read_config}; | ||
use log::error; | ||
|
||
#[tokio::main] | ||
pub async fn start(path: &str) { | ||
let config_result = read_config(path).await; | ||
let mut config = match config_result { | ||
Ok(result) => result, | ||
Err(err) => { | ||
error!("[client] Could not read config at {path}. Cannot start client without a config file: {err:?}"); | ||
return; | ||
} | ||
}; | ||
|
||
let enroll_status = enroll_client(&mut config).await; | ||
if enroll_status.is_err() { | ||
error!( | ||
"[client] Could not read enroll endpoint: {:?}", | ||
enroll_status.unwrap_err() | ||
); | ||
return; | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::start; | ||
use std::path::PathBuf; | ||
|
||
#[test] | ||
#[ignore = "Spawns client"] | ||
fn test_start() { | ||
let mut test_location = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
test_location.push("tests/test_data/client.toml"); | ||
let config_path = test_location.display().to_string(); | ||
start(&config_path) | ||
} | ||
} |
Oops, something went wrong.