You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: - add support for Windows when regex function available
18
+
#endif
19
+
20
+
#if os(Linux)
21
+
// FIXME: - add support for Linux when regex function available
22
+
#endif
23
+
24
+
#if os(macOS)
25
+
/*
26
+
Netrc feature depends upon `NSTextCheckingResult.range(withName name: String) -> NSRange`,
27
+
which is only available in macOS 10.13+ at this time.
28
+
*/
17
29
@available(OSX 10.13,*)
18
30
/// Container of parsed netrc connection settings
19
31
publicstructNetrc:AuthorizationProviding{
20
-
21
-
/// Representation of `machine` connection settings & `default` connection settings. If `default` connection settings present, they will be last element.
32
+
/// Representation of `machine` connection settings & `default` connection settings.
33
+
/// If `default` connection settings present, they will be last element.
22
34
publicletmachines:[Machine]
23
35
24
36
privateinit(machines:[Machine]){
25
37
self.machines = machines
26
38
}
27
39
28
-
// /// Testing API. Not for productive use.
29
-
// /// See: [Remove @testable from codebase](https://github.com/apple/swift-package-manager/commit/b6349d516d2f9b2f26ddae9de2c594ede24af7d6)
30
-
// public static var _mock: Netrc? = nil
31
-
32
40
/// Basic authorization header string
33
41
/// - Parameter url: URI of network resource to be accessed
34
42
/// - Returns: (optional) Basic Authorization header string to be added to the request
@@ -40,11 +48,10 @@ public struct Netrc: AuthorizationProviding {
40
48
return"Basic \(authData.base64EncodedString())"
41
49
}
42
50
43
-
///
51
+
/// Reads file at path or default location, and returns parsed Netrc representation
44
52
/// - Parameter fileURL: Location of netrc file, defaults to `~/.netrc`
45
53
/// - Returns: `Netrc` container with parsed connection settings, or error
0 commit comments