Go to the documentation of this file.
30 #include "absl/status/status.h"
31 #include "absl/strings/str_cat.h"
79 refresh_threshold) > 0)) {
80 jwt_value =
cached_->jwt_value.Ref();
117 if (
gpr_time_cmp(token_lifetime, max_token_lifetime) > 0) {
119 "Cropping token lifetime to maximum allowed value (%d secs).",
120 static_cast<int>(max_token_lifetime.
tv_sec));
139 return grpc_core::MakeRefCounted<grpc_service_account_jwt_access_credentials>(
140 key, token_lifetime);
155 const char* json_key,
gpr_timespec token_lifetime,
void* reserved) {
159 "grpc_service_account_jwt_access_credentials_create("
162 "gpr_timespec { tv_sec: %" PRId64
163 ", tv_nsec: %d, clock_type: %d }, "
166 static_cast<int>(token_lifetime.
clock_type), reserved);
182 return parsed.status();
184 return absl::StrFormat(
"%s://%s/", parsed->scheme(), parsed->authority());
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec< Args... > &format, const Args &... args)
static grpc_core::UniqueTypeName Type()
grpc_service_account_jwt_access_credentials(grpc_auth_json_key key, gpr_timespec token_lifetime)
char * grpc_jwt_encode_and_sign(const grpc_auth_json_key *json_key, const char *audience, gpr_timespec token_lifetime, const char *scope)
GPRAPI void gpr_free(void *ptr)
Object * mutable_object()
void grpc_auth_json_key_destruct(grpc_auth_json_key *json_key)
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
grpc_call_credentials * grpc_service_account_jwt_access_credentials_create(const char *json_key, gpr_timespec token_lifetime, void *reserved)
#define GRPC_TRACE_FLAG_ENABLED(f)
grpc_auth_json_key grpc_auth_json_key_create_from_string(const char *json_string)
Status UnauthenticatedError(absl::string_view message)
GPRAPI void gpr_mu_destroy(gpr_mu *mu)
static Slice FromCopiedString(const char *s)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
int grpc_auth_json_key_is_valid(const grpc_auth_json_key *json_key)
GPRAPI int gpr_time_cmp(gpr_timespec a, gpr_timespec b)
constexpr bool has_value() const noexcept
JSON (JavaScript Object Notation).
#define GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS
GPRAPI gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b)
GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
GPRAPI void gpr_mu_init(gpr_mu *mu)
grpc_core::ArenaPromise< absl::StatusOr< grpc_core::ClientMetadataHandle > > GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata, const GetRequestMetadataArgs *args) override
absl::StatusOr< std::string > RemoveServiceNameFromJwtUri(absl::string_view uri)
~grpc_service_account_jwt_access_credentials() override
#define GRPC_AUTHORIZATION_METADATA_KEY
grpc_core::RefCountedPtr< grpc_call_credentials > grpc_service_account_jwt_access_credentials_create_from_auth_json_key(grpc_auth_json_key key, gpr_timespec token_lifetime)
GPRAPI void gpr_mu_lock(gpr_mu *mu)
bool Parse(FlagOpFn op, absl::string_view text, void *dst, std::string *error)
static char * redact_private_key(const char *json_key)
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
absl::optional< Cache > cached_
gpr_clock_type clock_type
std::string MakeJwtServiceUrl(const ClientMetadataHandle &initial_metadata, const grpc_call_credentials::GetRequestMetadataArgs *args)
gpr_timespec jwt_lifetime_
ABSL_MUST_USE_RESULT bool ok() const
grpc_core::TraceFlag grpc_api_trace(false, "api")
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
grpc_core::ExecCtx exec_ctx
#define GRPC_ERROR_UNREF(err)
GPRAPI char * gpr_strdup(const char *src)
promise_detail::Immediate< T > Immediate(T value)
std::string Dump(int indent=0) const
const Status & status() const &
GPRAPI gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type clock_type)
#define GRPC_ERROR_IS_NONE(err)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:14