File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Sources/ContainerRegistry Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ func parseChallenge(_ s: String) throws -> BearerChallenge {
110110 return res
111111}
112112
113+ /// AuthChallenge represents an HTTP `WWW-Authenticate` challenge header.
113114public enum AuthChallenge : Equatable {
114115 case none
115116 case basic( String )
@@ -156,6 +157,15 @@ public struct AuthHandler {
156157 return nil
157158 }
158159
160+ /// Respond to an HTTP `WWW-Authenticate` challenge header sent by a container registry.
161+ /// - Parameters:
162+ /// - registry: The registry which issued the challenge.
163+ /// - repository: The repository path within the registry for which permission is to be requested.
164+ /// - actions: The repository actions for which permission is to be requested.
165+ /// - scheme: The challenge header to which to respond.
166+ /// - client: An HTTPClient instance to use when contacting the registry.
167+ /// - Returns: An `Authorization` header appropriate to the challenge.
168+ /// - Throws: If scheme is `Bearer` and an error occurs when contacting the OAuth server.
159169 public func auth(
160170 registry: URL ,
161171 repository: ImageReference . Repository ,
You can’t perform that action at this time.
0 commit comments