Skip to content

Commit d9d467e

Browse files
committed
feat: Allow overriding authentication scheme
1 parent 1a4e18e commit d9d467e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dockerHashing/src/main/scala/cromwell/docker/registryv2/DockerRegistryV2Abstract.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ abstract class DockerRegistryV2Abstract(override val config: DockerRegistryConfi
157157
.handleErrorWith(tryOCIManifest)
158158
}
159159

160+
/**
161+
* Gets the authorization scheme to use for the token request.
162+
*/
163+
protected def getAuthorizationScheme(dockerImageIdentifier: DockerImageIdentifier): AuthScheme = AuthScheme.Bearer
164+
160165
/**
161166
* Returns true if this flow is able to process this docker image,
162167
* false otherwise
@@ -241,7 +246,7 @@ abstract class DockerRegistryV2Abstract(override val config: DockerRegistryConfi
241246
manifestHeader: Accept
242247
): IO[Request[IO]] = {
243248
val authorizationHeader: Option[Authorization] =
244-
token.map(t => Authorization(Credentials.Token(AuthScheme.Bearer, t)))
249+
token.map(t => Authorization(Credentials.Token(getAuthorizationScheme(imageId), t)))
245250
val request = Method.GET(
246251
buildManifestUri(imageId),
247252
List(

0 commit comments

Comments
 (0)