-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl(oauth2): port service account credential prerequisites #8343
Conversation
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
7873344
to
caf13d6
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @scotthart)
google/cloud/internal/oauth2_credential_constants.h, line 33 at r1 (raw file):
*/ // NOLINTNEXTLINE(readability-identifier-naming) enum class JwtSigningAlgorithms { RS256 };
Let's remove this enum. It serves no purpose, if we ever need a new signing algorithm we can create a function or enum at the time.
google/cloud/internal/openssl_util.h, line 65 at r1 (raw file):
template <typename Collection> inline std::string UrlsafeBase64Encode(Collection const& bytes) { std::string b64str = Base64Encode(bytes);
Optional: I think it might be cleaner to just use google::cloud::internal::Base64Encoder
directly here, and remove the Base64Encode()
functions?
google/cloud/internal/openssl_util.cc, line 75 at r1 (raw file):
EVP_MD const* digest_type = nullptr; switch (alg) {
If we remove the alg
argument we can cut all this code, maybe it requires renaming the function SignUsingSha256
, the type of the arguments are implicit and don't need to be in the name again.
google/cloud/internal/openssl_util.cc, line 173 at r1 (raw file):
} std::vector<std::uint8_t> MD5Hash(std::string const& payload) {
I suspect this is very GCS specific, I doubt it will see usage in other services. Please remove.
google/cloud/internal/write_base64.h, line 31 at r1 (raw file):
* If it fails, it will throw an exception on badbit. */ void WriteBase64AsBinary(std::string const& filename, char const* data);
AFAICT this is only used in the tests for .p12
key files. We have no plans to support those with GUAC (they don't work with gRPC see #5116). I think we should remove this code and all the support for PKCS #12
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 13 files reviewed, 5 unresolved discussions (waiting on @coryan)
google/cloud/internal/openssl_util.h, line 65 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
Optional: I think it might be cleaner to just use
google::cloud::internal::Base64Encoder
directly here, and remove theBase64Encode()
functions?
Done.
google/cloud/internal/openssl_util.cc, line 75 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
If we remove the
alg
argument we can cut all this code, maybe it requires renaming the functionSignUsingSha256
, the type of the arguments are implicit and don't need to be in the name again.
alg removed; function renamed
google/cloud/internal/openssl_util.cc, line 173 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
I suspect this is very GCS specific, I doubt it will see usage in other services. Please remove.
removed
google/cloud/internal/oauth2_credential_constants.h, line 33 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
Let's remove this enum. It serves no purpose, if we ever need a new signing algorithm we can create a function or enum at the time.
removed
google/cloud/internal/write_base64.h, line 31 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
AFAICT this is only used in the tests for
.p12
key files. We have no plans to support those with GUAC (they don't work with gRPC see #5116). I think we should remove this code and all the support forPKCS #12
.
Done.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
856bcc9
to
0a679ca
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
0a679ca
to
605ef1b
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 11 of 11 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @scotthart)
google/cloud/testing_util/credentials_constants.h, line 1 at r6 (raw file):
// Copyright 2020 Google LLC
Is this file used anywhere? It is only for testing and does not appear to be used in openssl_utils_test.cc
?
google/cloud/testing_util/credentials_constants.h, line 41 at r6 (raw file):
// Delete the service account ID: // gcloud iam service-accounts delete --quiet ${SERVICE_ACCOUNT} char const kP12ServiceAccountId[] = "104849618361176160538";
Are any of these two constants used in the new code? I would expect they are not?
Codecov Report
Continue to review full report at Codecov.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 12 of 16 files reviewed, 2 unresolved discussions (waiting on @coryan)
google/cloud/testing_util/credentials_constants.h, line 1 at r6 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
Is this file used anywhere? It is only for testing and does not appear to be used in
openssl_utils_test.cc
?
it's used in make_jwt_assertion_test and another test file "Not Yet Appearing in this Film", but we don't need a separate file for this constant used in 2 places.
google/cloud/testing_util/credentials_constants.h, line 41 at r6 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
Are any of these two constants used in the new code? I would expect they are not?
No, they are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r7.
Reviewable status: 15 of 16 files reviewed, all discussions resolved (waiting on @coryan)
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r8, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @scotthart)
This PR brings over several oauth2/ssl utility files from google/cloud/storage. These are all necessary for implementing OAuth2.0 service account credentials.
Other than changes to namespaces and include paths, the contents of these files have been copied as-is from google/cloud/storage. Ultimately these file locations will be their permanent homes after GCS has been refactored to use the new REST library.
This change is