remove unnecessary JwtToken subclass

pull/37544/head
Mark D. Roth 6 months ago
parent 8863ba4d19
commit a6b03f08ab
  1. 2
      src/core/lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.cc
  2. 18
      src/core/lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.h

@ -122,7 +122,7 @@ class JwtTokenFetcherCallCredentials::HttpFetchRequest final
Timestamp expiration_time =
Timestamp::FromTimespecRoundDown(ts) - Duration::Minutes(1);
// Return token object.
self->on_done_(MakeRefCounted<JwtToken>(
self->on_done_(MakeRefCounted<Token>(
Slice::FromCopiedString(absl::StrCat("Bearer ", body)),
expiration_time));
}

@ -38,24 +38,6 @@
namespace grpc_core {
// A JWT token.
class JwtToken : public TokenFetcherCredentials::Token {
public:
JwtToken(Slice token, Timestamp expiration)
: token_(std::move(token)), expiration_(expiration) {}
Timestamp ExpirationTime() override { return expiration_; }
void AddTokenToClientInitialMetadata(ClientMetadata& metadata) override {
metadata.Append(GRPC_AUTHORIZATION_METADATA_KEY, token_.Ref(),
[](absl::string_view, const Slice&) { abort(); });
}
private:
Slice token_;
Timestamp expiration_;
};
// A base class for JWT token fetching credentials.
// Subclasses must implement StartHttpRequest().
class JwtTokenFetcherCallCredentials : public TokenFetcherCredentials {

Loading…
Cancel
Save