login method
Authenticates with a Docker registry.
Sends POST /auth with the credentials from auth. A 200 response
(optionally containing an identity token) indicates success; any 4xx/5xx
status throws HttpException.
Parameters:
auth— registry credentials produced by parseDockerAuthConfig.
Implementation
Future<void> login(DockerAuthInfo auth) async {
final resp = await _request(
'POST',
'/auth',
body: {
'username': auth.username,
'password': auth.password,
'serveraddress': auth.registry,
},
);
if (resp.statusCode != 200 && resp.statusCode != 204) {
_throwIfError(resp);
}
}