Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions google/cloud/internal/http_header_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// TODO(#16171): MSVC is a lot pickier about the conversion operators.
// Skip for now.
#ifndef _WIN32

#include "google/cloud/internal/http_header.h"
#include <gmock/gmock.h>

Expand Down Expand Up @@ -179,3 +183,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace rest_internal
} // namespace cloud
} // namespace google

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// TODO(#16172): GDCH is not currently supported on Windows.
#ifndef _WIN32

#include "google/cloud/internal/oauth2_gdch_service_account_credentials.h"
#include "google/cloud/credentials.h"
#include "google/cloud/internal/base64_transforms.h"
Expand Down Expand Up @@ -464,3 +467,5 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace oauth2_internal
} // namespace cloud
} // namespace google

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ TEST(MinimalIamCredentialsRestTest, AllowedLocationsAuthorizationFailure) {
EXPECT_THAT(access_token, StatusIs(StatusCode::kPermissionDenied));
}

// TODO(#16177): Update these tests to compile with MSVC.
#ifndef _WIN32

TEST(MinimalIamCredentialsRestTest, AllowedLocationsMalformedResponseFailure) {
std::string service_account = "foo@somewhere.com";
std::chrono::seconds lifetime(3600);
Expand Down Expand Up @@ -560,6 +563,8 @@ TEST(MinimalIamCredentialsRestTest, WorkforceIdentityAllowedLocations) {
EXPECT_THAT(allowed_locations->encoded_locations, Eq("0xA30"));
}

#endif

} // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace oauth2_internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,21 @@ class RegionalAccessBoundaryTokenManager
promise<Status> pending_refresh;
pending_refresh_ = pending_refresh.get_future();
auto constexpr kLocation = __func__;
#ifdef _WIN32
auto pending_refresh_fn = [p = std::move(pending_refresh),
weak = weak_from_this(), request,
stub = iam_stub_,
retry_policy = retry_policy_->clone(),
backoff_policy = backoff_policy_->clone(),
options = options_, kLocation]() mutable {
#else
auto pending_refresh_fn = [p = std::move(pending_refresh),
weak = weak_from_this(), request,
stub = iam_stub_,
retry_policy = retry_policy_->clone(),
backoff_policy = backoff_policy_->clone(),
options = options_]() mutable {
#endif
auto refresh_attempt_fn = [stub](rest_internal::RestContext&,
Options const&, Request const& request) {
return stub->AllowedLocations(request);
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/internal/rest_opentelemetry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span> MakeSpanHttp(
{/*sc::kUrlFull=*/"url.full", request.path()}},
options);
for (auto const& kv : request.headers()) {
auto const name = "http.request.header." + std::string{kv.first};
auto const name = absl::StrCat("http.request.header.", kv.first.name());
if (kv.second.EmptyValues()) {
span->SetAttribute(name, "");
continue;
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/internal/tracing_rest_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ StatusOr<std::unique_ptr<RestResponse>> EndResponseSpan(
*context.local_port());
}
for (auto const& kv : context.headers()) {
auto const name = "http.request.header." + std::string{kv.first};
auto const name = absl::StrCat("http.request.header.", kv.first.name());
if (kv.second.EmptyValues()) {
span->SetAttribute(name, "");
continue;
Expand Down
5 changes: 5 additions & 0 deletions google/cloud/internal/unified_rest_credentials_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ TEST(UnifiedRestCredentialsTest, ApiKey) {
IsOkAndHolds(Contains(HttpHeader("x-goog-api-key", "api-key"))));
}

// TODO(#16172): GDCH is not currently supported on Windows.
#ifndef _WIN32

TEST(UnifiedRestCredentialsTest, MakeGDCHServiceAccountUsesAudienceParameter) {
auto constexpr kAudience = "test-audience";
auto const post_response = std::string{R"""({
Expand Down Expand Up @@ -617,6 +620,8 @@ TEST(UnifiedRestCredentialsTest, MakeGDCHServiceAccountUsesAudienceParameter) {
"Authorization", "Bearer access-token-value"))));
}

#endif

TEST(UnifiedRestCredentialsTest, LoadError) {
// Create a name for a non-existing file, try to load it, and verify it
// returns errors.
Expand Down
4 changes: 3 additions & 1 deletion google/cloud/internal/win32/sign_using_sha256.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ StatusOr<std::vector<std::uint8_t>> SignSha256Digest(BCRYPT_KEY_HANDLE key,

} // namespace

// TODO(#16172): GDCH is not currently supported on Windows.
// Only supports RAW signature format as only RSA keys are supported.
StatusOr<std::vector<std::uint8_t>> SignUsingSha256(
std::string const& str, std::string const& pem_contents) {
std::string const& str, std::string const& pem_contents, SignatureFormat) {
auto pem_buffer = DecodePem(pem_contents);
if (!pem_buffer) return std::move(pem_buffer).status();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,9 @@ TEST_F(AsyncConnectionImplAppendableTest,
next.first.set_value(true);
}

// TODO(#16174): Figure out why this test fails to compile in MSVC.
#ifndef _WIN32

TEST_F(AsyncConnectionImplAppendableTest,
ResumeAppendableObjectUploadWithChecksum) {
auto constexpr kRequestText = R"pb(
Expand Down Expand Up @@ -882,6 +885,8 @@ TEST_F(AsyncConnectionImplAppendableTest,
next.first.set_value(true);
}

#endif

} // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace storage_internal
Expand Down
Loading