Compare commits
2 commits
7bd6347dd8
...
5e4e287562
Author | SHA1 | Date | |
---|---|---|---|
|
5e4e287562 | ||
|
6a0e0580dc |
9 changed files with 114 additions and 94 deletions
159
Cargo.lock
generated
159
Cargo.lock
generated
|
@ -34,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -56,7 +56,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -234,7 +234,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -339,7 +339,7 @@ dependencies = [
|
|||
"ident_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -462,7 +462,7 @@ dependencies = [
|
|||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -635,7 +635,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -646,7 +646,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
|
|||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -696,7 +696,7 @@ checksum = "841ea25b31404c50f2ddc92e028984a42d0fc818c10afee0b1fbda27c995f028"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -716,7 +716,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1087,7 +1087,7 @@ checksum = "8066dc2ef3bd0e2bfb84b4a2b0b04f216ffb97390e09fab0752bf0ba943dacc6"
|
|||
dependencies = [
|
||||
"doc-comment",
|
||||
"unicase",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1120,8 +1120,8 @@ dependencies = [
|
|||
"rand",
|
||||
"ratatui",
|
||||
"regex",
|
||||
"rstest",
|
||||
"secrecy",
|
||||
"rstest 0.23.0",
|
||||
"secrecy 0.10.3",
|
||||
"sendmail",
|
||||
"serde_json",
|
||||
"standardwebhooks",
|
||||
|
@ -1154,7 +1154,7 @@ dependencies = [
|
|||
"pike",
|
||||
"pretty_assertions",
|
||||
"rand",
|
||||
"secrecy",
|
||||
"secrecy 0.10.3",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"take-until",
|
||||
|
@ -1175,7 +1175,7 @@ dependencies = [
|
|||
"git-next-core",
|
||||
"kxio",
|
||||
"rand",
|
||||
"secrecy",
|
||||
"secrecy 0.10.3",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
|
@ -1195,7 +1195,7 @@ dependencies = [
|
|||
"hmac",
|
||||
"kxio",
|
||||
"rand",
|
||||
"secrecy",
|
||||
"secrecy 0.10.3",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
|
@ -1288,7 +1288,7 @@ dependencies = [
|
|||
"gix-utils",
|
||||
"itoa",
|
||||
"thiserror",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1384,7 +1384,7 @@ dependencies = [
|
|||
"smallvec",
|
||||
"thiserror",
|
||||
"unicode-bom",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1669,7 +1669,7 @@ dependencies = [
|
|||
"itoa",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1793,7 +1793,7 @@ dependencies = [
|
|||
"gix-utils",
|
||||
"maybe-async",
|
||||
"thiserror",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1825,7 +1825,7 @@ dependencies = [
|
|||
"gix-validate",
|
||||
"memmap2",
|
||||
"thiserror",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2486,7 +2486,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2611,7 +2611,7 @@ dependencies = [
|
|||
"http 1.1.0",
|
||||
"path-clean",
|
||||
"reqwest",
|
||||
"secrecy",
|
||||
"secrecy 0.8.0",
|
||||
"serde",
|
||||
"serde-xml-rs",
|
||||
"serde_json",
|
||||
|
@ -2746,7 +2746,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2852,7 +2852,7 @@ dependencies = [
|
|||
"cfg-if",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3032,7 +3032,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3135,7 +3135,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3215,11 +3215,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "3.1.0"
|
||||
version = "3.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
|
||||
checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b"
|
||||
dependencies = [
|
||||
"toml_edit 0.21.1",
|
||||
"toml_edit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3523,7 +3523,19 @@ checksum = "7b423f0e62bdd61734b67cd21ff50871dfaeb9cc74f869dcd6af974fbcb19936"
|
|||
dependencies = [
|
||||
"futures",
|
||||
"futures-timer",
|
||||
"rstest_macros",
|
||||
"rstest_macros 0.22.0",
|
||||
"rustc_version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rstest"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a2c585be59b6b5dd66a9d2084aa1d8bd52fbdb806eafdeffb52791147862035"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"futures-timer",
|
||||
"rstest_macros 0.23.0",
|
||||
"rustc_version",
|
||||
]
|
||||
|
||||
|
@ -3541,7 +3553,25 @@ dependencies = [
|
|||
"regex",
|
||||
"relative-path",
|
||||
"rustc_version",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rstest_macros"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "825ea780781b15345a146be27eaefb05085e337e869bff01b4306a4fd4a9ad5a"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"glob",
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"relative-path",
|
||||
"rustc_version",
|
||||
"syn 2.0.82",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
|
@ -3571,9 +3601,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
|
|||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
|
||||
dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
@ -3683,6 +3713,15 @@ dependencies = [
|
|||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "secrecy"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a"
|
||||
dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.11.1"
|
||||
|
@ -3747,7 +3786,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3969,7 +4008,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3991,9 +4030,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.76"
|
||||
version = "2.0.82"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525"
|
||||
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -4074,7 +4113,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4094,7 +4133,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4167,7 +4206,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4225,7 +4264,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"toml_edit 0.22.20",
|
||||
"toml_edit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4237,17 +4276,6 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.21.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"toml_datetime",
|
||||
"winnow 0.5.40",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.22.20"
|
||||
|
@ -4258,7 +4286,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"winnow 0.6.18",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4308,7 +4336,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4374,7 +4402,7 @@ checksum = "27a65189ac0c5f8af32660c453a1babae3ac7e72791b9dbeb1221073569f44ea"
|
|||
dependencies = [
|
||||
"indoc",
|
||||
"ratatui",
|
||||
"rstest",
|
||||
"rstest 0.22.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4445,9 +4473,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217"
|
|||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
version = "1.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-normalization"
|
||||
|
@ -4616,7 +4644,7 @@ dependencies = [
|
|||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
|
@ -4650,7 +4678,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
@ -4961,15 +4989,6 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.5.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.6.18"
|
||||
|
@ -5018,7 +5037,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.76",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -68,7 +68,7 @@ serde_json = "1.0"
|
|||
toml = "0.8"
|
||||
|
||||
# Secrets and Password
|
||||
secrecy = "0.8"
|
||||
secrecy = "0.10"
|
||||
|
||||
# Conventional Commit check
|
||||
git-conventional = "0.12"
|
||||
|
@ -118,4 +118,4 @@ pretty_assertions = "1.4"
|
|||
rand = "0.8"
|
||||
mockall = "0.13"
|
||||
test-log = "0.2"
|
||||
rstest = { version = "0.22", features = ["async-timeout"] }
|
||||
rstest = { version = "0.23", features = ["async-timeout"] }
|
||||
|
|
|
@ -6,7 +6,7 @@ use git_next_core::{
|
|||
ApiToken, ForgeType, GitDir, Hostname, RepoBranches, RepoConfig, RepoConfigSource, RepoPath,
|
||||
StoragePathType, User,
|
||||
};
|
||||
use secrecy::Secret;
|
||||
use secrecy::SecretString;
|
||||
|
||||
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
|
||||
|
||||
|
@ -59,7 +59,7 @@ fn repo_details_find_default_push_remote_finds_correct_remote() -> Result<()> {
|
|||
repo_details.forge = repo_details
|
||||
.forge
|
||||
.with_user(User::new("git".to_string()))
|
||||
.with_token(ApiToken::new(Secret::new(String::new())))
|
||||
.with_token(ApiToken::new(SecretString::from(String::new())))
|
||||
.with_hostname(Hostname::new("git.kemitix.net"));
|
||||
repo_details.repo_path = RepoPath::new("kemitix/git-next".to_string());
|
||||
let Ok(open_repository) = git::repository::factory::real().open(&repo_details) else {
|
||||
|
@ -95,7 +95,7 @@ fn gitdir_validate_should_pass_a_valid_git_repo() -> Result<()> {
|
|||
repo_details.forge = repo_details
|
||||
.forge
|
||||
.with_user(User::new("git".to_string()))
|
||||
.with_token(ApiToken::new(Secret::new(String::new())))
|
||||
.with_token(ApiToken::new(SecretString::from(String::new())))
|
||||
.with_hostname(Hostname::new("git.kemitix.net"));
|
||||
tracing::debug!("opening...");
|
||||
let Ok(repository) = git::repository::factory::real().open(&repo_details) else {
|
||||
|
@ -129,7 +129,7 @@ fn gitdir_validate_should_fail_a_git_repo_with_wrong_remote() {
|
|||
repo_details.forge = repo_details
|
||||
.forge
|
||||
.with_user(User::new("git".to_string()))
|
||||
.with_token(ApiToken::new(Secret::new(String::new())))
|
||||
.with_token(ApiToken::new(SecretString::from(String::new())))
|
||||
.with_hostname(Hostname::new("git.kemitix.net"));
|
||||
let Ok(repository) = git::repository::factory::real().open(&repo_details) else {
|
||||
// .git directory may not be present on dev environment
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/// `ForgeJo`: <https://{hostname}/user/settings/applications>
|
||||
/// `Github`: <https://github.com/settings/tokens>
|
||||
#[derive(Clone, Debug, derive_more::Constructor)]
|
||||
pub struct ApiToken(secrecy::Secret<String>);
|
||||
pub struct ApiToken(secrecy::SecretString);
|
||||
/// The API Token is in effect a password, so it must be explicitly exposed to access its value
|
||||
impl secrecy::ExposeSecret<String> for ApiToken {
|
||||
fn expose_secret(&self) -> &String {
|
||||
impl secrecy::ExposeSecret<str> for ApiToken {
|
||||
fn expose_secret(&self) -> &str {
|
||||
self.0.expose_secret()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ use std::{
|
|||
|
||||
use derive_more::{Constructor, Display};
|
||||
use kxio::fs::FileSystem;
|
||||
use secrecy::Secret;
|
||||
use secrecy::SecretString;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tracing::info;
|
||||
|
||||
|
@ -242,8 +242,11 @@ impl Shout {
|
|||
self.webhook.clone().map(|x| x.url)
|
||||
}
|
||||
|
||||
pub fn webhook_secret(&self) -> Option<Secret<String>> {
|
||||
self.webhook.clone().map(|x| x.secret).map(Secret::new)
|
||||
pub fn webhook_secret(&self) -> Option<SecretString> {
|
||||
self.webhook
|
||||
.clone()
|
||||
.map(|x| x.secret)
|
||||
.map(SecretString::from)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
|
@ -278,8 +281,8 @@ impl OutboundWebhook {
|
|||
self.url.as_ref()
|
||||
}
|
||||
#[must_use]
|
||||
pub fn secret(&self) -> Secret<String> {
|
||||
Secret::new(self.secret.clone())
|
||||
pub fn secret(&self) -> SecretString {
|
||||
SecretString::from(self.secret.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -539,7 +539,7 @@ mod server {
|
|||
let shout_webhook_url = shout.webhook_url().unwrap_or_default();
|
||||
let shout_webhook_secret = shout
|
||||
.webhook_secret()
|
||||
.map(|secret| secret.expose_secret().clone())
|
||||
.map(|secret| secret.expose_secret().to_string())
|
||||
.unwrap_or_default();
|
||||
let_assert!(Some(shout_email) = shout.email());
|
||||
let shout_email_from = shout_email.from();
|
||||
|
|
|
@ -11,7 +11,7 @@ use crate::{
|
|||
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
use secrecy::{ExposeSecret, Secret};
|
||||
use secrecy::{ExposeSecret, SecretString};
|
||||
use tracing::instrument;
|
||||
|
||||
/// The derived information about a repo, used to interact with it
|
||||
|
@ -53,7 +53,7 @@ impl RepoDetails {
|
|||
),
|
||||
}
|
||||
}
|
||||
pub(crate) fn origin(&self) -> secrecy::Secret<String> {
|
||||
pub(crate) fn origin(&self) -> secrecy::SecretString {
|
||||
let repo_details = self;
|
||||
let user = &repo_details.forge.user();
|
||||
let hostname = &repo_details.forge.hostname();
|
||||
|
@ -78,7 +78,7 @@ impl RepoDetails {
|
|||
}
|
||||
|
||||
// url is a secret as it contains auth token
|
||||
pub(crate) fn url(&self) -> Secret<String> {
|
||||
pub(crate) fn url(&self) -> SecretString {
|
||||
let user = self.forge.user();
|
||||
let token = self.forge.token().expose_secret();
|
||||
let auth_delim = if token.is_empty() { "" } else { ":" };
|
||||
|
|
|
@ -60,11 +60,9 @@ impl RepositoryFactory for RealRepositoryFactory {
|
|||
|
||||
fn git_clone(&self, repo_details: &RepoDetails) -> Result<Box<dyn OpenRepositoryLike>> {
|
||||
tracing::info!("creating");
|
||||
let (gix_repo, _outcome) = gix::prepare_clone_bare(
|
||||
repo_details.origin().expose_secret().as_str(),
|
||||
&*repo_details.gitdir,
|
||||
)?
|
||||
.fetch_only(gix::progress::Discard, &AtomicBool::new(false))?;
|
||||
let (gix_repo, _outcome) =
|
||||
gix::prepare_clone_bare(repo_details.origin().expose_secret(), &*repo_details.gitdir)?
|
||||
.fetch_only(gix::progress::Discard, &AtomicBool::new(false))?;
|
||||
tracing::info!("created");
|
||||
let repo = RealOpenRepository::new(
|
||||
Arc::new(RwLock::new(gix_repo.into())),
|
||||
|
|
|
@ -112,7 +112,7 @@ impl super::OpenRepositoryLike for RealOpenRepository {
|
|||
}
|
||||
};
|
||||
// INFO: never log the command as it contains the API token within the 'origin'
|
||||
let command: secrecy::Secret<String> = format!(
|
||||
let command: secrecy::SecretString = format!(
|
||||
"/usr/bin/git push {} {to_commit}:{branch_name} {force}",
|
||||
origin.expose_secret()
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue