File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ impl From<Option<String>> for Username {
72
72
pub struct Password ( String ) ;
73
73
74
74
impl Password {
75
+ pub fn new ( password : String ) -> Self {
76
+ Self ( password)
77
+ }
78
+
75
79
pub fn as_str ( & self ) -> & str {
76
80
self . 0 . as_str ( )
77
81
}
Original file line number Diff line number Diff line change @@ -538,6 +538,8 @@ mod tests {
538
538
use wiremock:: matchers:: { basic_auth, method, path_regex} ;
539
539
use wiremock:: { Mock , MockServer , ResponseTemplate } ;
540
540
541
+ use crate :: credentials:: Password ;
542
+
541
543
use super :: * ;
542
544
543
545
type Error = Box < dyn std:: error:: Error > ;
@@ -1868,7 +1870,7 @@ mod tests {
1868
1870
// Log username but mask password if a password is present
1869
1871
let creds = Credentials :: Basic {
1870
1872
username : Username :: new ( Some ( String :: from ( "user" ) ) ) ,
1871
- password : Some ( String :: from ( "password" ) ) ,
1873
+ password : Some ( Password :: new ( String :: from ( "password" ) ) ) ,
1872
1874
} ;
1873
1875
let req = create_request ( "https://pypi-proxy.fly.dev/basic-auth/simple" ) ;
1874
1876
assert_eq ! (
You can’t perform that action at this time.
0 commit comments