forked from microsoft/WSL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWslcCredentialStore.h
More file actions
30 lines (18 loc) · 819 Bytes
/
WslcCredentialStore.h
File metadata and controls
30 lines (18 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
WslcCredentialStore.h
Abstract:
Helpers for building Docker/OCI registry credential payloads.
--*/
#pragma once
#include <string>
namespace wsl::windows::common {
// Builds the base64-encoded X-Registry-Auth header value used by Docker APIs
// (PullImage, PushImage, etc.) from the given credentials.
std::string BuildRegistryAuthHeader(const std::string& username, const std::string& password, const std::string& serverAddress);
// Builds the base64-encoded X-Registry-Auth header value from an identity token
// returned by Authenticate().
std::string BuildRegistryAuthHeader(const std::string& identityToken, const std::string& serverAddress);
// TODO: Implement credential storage using WinCred
} // namespace wsl::windows::common