Android-cuttlefish cvd tool
credential_source.h
Go to the documentation of this file.
1//
2// Copyright (C) 2019 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
18#include <memory>
19#include <string>
20
23
24namespace cuttlefish {
25
26constexpr char kAndroidBuildApiScope[] =
27 "https://www.googleapis.com/auth/androidbuild.internal";
28
30 public:
31 virtual ~CredentialSource() = default;
33};
34
36 HttpClient& http_client, const std::string& credential_source,
37 const std::string& oauth_filepath, bool use_gce_metadata,
38 const std::string& credential_filepath,
39 const std::string& service_account_filepath);
40
42 HttpClient& http_client, const std::string& client_id,
43 const std::string& client_secret, const std::string& refresh_token);
44}
Definition: expected.h:86
Definition: credential_source.h:29
virtual Result< std::string > Credential()=0
virtual ~CredentialSource()=default
Definition: http_client.h:84
Definition: alloc_utils.cpp:23
Result< std::unique_ptr< CredentialSource > > CreateRefreshTokenCredentialSource(HttpClient &http_client, const std::string &client_id, const std::string &client_secret, const std::string &refresh_token)
Definition: credential_source.cc:576
Result< std::unique_ptr< CredentialSource > > 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)
Definition: credential_source.cc:534
constexpr char kAndroidBuildApiScope[]
Definition: credential_source.h:26