Android-cuttlefish cvd tool
Classes | Namespaces | Functions | Variables
credential_source.cc File Reference
#include "cuttlefish/host/libs/web/credential_source.h"
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <chrono>
#include <memory>
#include <mutex>
#include <optional>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <android-base/logging.h>
#include <android-base/strings.h>
#include <json/reader.h>
#include <json/value.h>
#include <json/writer.h>
#include <openssl/base.h>
#include <openssl/bio.h>
#include <openssl/digest.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include "cuttlefish/common/libs/utils/base64.h"
#include "cuttlefish/common/libs/utils/files.h"
#include "cuttlefish/common/libs/utils/json.h"
#include "cuttlefish/common/libs/utils/result.h"
#include "cuttlefish/host/libs/web/http_client/http_client.h"
#include "cuttlefish/host/libs/web/http_client/http_json.h"
#include "cuttlefish/host/libs/web/http_client/url_escape.h"
Include dependency graph for credential_source.cc:

Classes

class  cuttlefish::anonymous_namespace{credential_source.cc}::RefreshingCredentialSource
 
class  cuttlefish::anonymous_namespace{credential_source.cc}::GceMetadataCredentialSource
 
class  cuttlefish::anonymous_namespace{credential_source.cc}::FixedCredentialSource
 
class  cuttlefish::anonymous_namespace{credential_source.cc}::RefreshTokenCredentialSource
 
class  cuttlefish::anonymous_namespace{credential_source.cc}::ServiceAccountOauthCredentialSource
 

Namespaces

namespace  cuttlefish
 
namespace  cuttlefish::anonymous_namespace{credential_source.cc}
 

Functions

std::unique_ptr< CredentialSource > cuttlefish::anonymous_namespace{credential_source.cc}::TryParseServiceAccount (HttpClient &http_client, const std::string &file_content)
 
Result< std::unique_ptr< CredentialSource > > cuttlefish::anonymous_namespace{credential_source.cc}::GetCredentialSourceLegacy (HttpClient &http_client, const std::string &credential_source, const std::string &oauth_filepath)
 
static std::string cuttlefish::anonymous_namespace{credential_source.cc}::CollectSslErrors ()
 
static Result< std::string > cuttlefish::anonymous_namespace{credential_source.cc}::Base64Url (const char *data, std::size_t size)
 
static Result< std::string > cuttlefish::anonymous_namespace{credential_source.cc}::JsonToBase64Url (const Json::Value &json)
 
static Result< std::string > cuttlefish::anonymous_namespace{credential_source.cc}::CreateJwt (const std::string &email, const std::string &scope, EVP_PKEY *private_key)
 
Result< std::unique_ptr< CredentialSource > > cuttlefish::GetCredentialSource (HttpClient &http_client, const std::string &credential_source, const std::string &oauth_filepath, const bool use_gce_metadata, const std::string &credential_filepath, const std::string &service_account_filepath)
 
Result< std::unique_ptr< CredentialSource > > cuttlefish::CreateRefreshTokenCredentialSource (HttpClient &http_client, const std::string &client_id, const std::string &client_secret, const std::string &refresh_token)
 

Variables

constexpr auto cuttlefish::anonymous_namespace{credential_source.cc}::kRefreshWindow = std::chrono::minutes(2)