Skip to content

Commit 9b66550

Browse files
committed
Docs: Add missing documentation comments for public declarations in AuthHandler.swift
1 parent 9417b63 commit 9b66550

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/ContainerRegistry/AuthHandler.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
113114
public 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,

0 commit comments

Comments
 (0)