Android-cuttlefish cvd tool
gce_metadata_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 <chrono>
19#include <memory>
20#include <string>
21#include <utility>
22
27
28namespace cuttlefish {
29
30// OAuth2 credentials from the GCE metadata server.
31//
32// -
33// https://cloud.google.com/compute/docs/access/authenticate-workloads#applications
34// - https://cloud.google.com/compute/docs/metadata/overview
36 public:
37 static std::unique_ptr<CredentialSource> Make(HttpClient&);
38
39 private:
41
43
45};
46
47} // namespace cuttlefish
Definition: gce_metadata_credential_source.h:35
static std::unique_ptr< CredentialSource > Make(HttpClient &)
Definition: gce_metadata_credential_source.cc:62
Result< std::pair< std::string, std::chrono::seconds > > Refresh() override
Definition: gce_metadata_credential_source.cc:40
HttpClient & http_client_
Definition: gce_metadata_credential_source.h:44
GceMetadataCredentialSource(HttpClient &)
Definition: gce_metadata_credential_source.cc:35
Definition: http_client.h:100
Definition: refreshing_credential_source.h:30
Definition: alloc_driver.h:21
tl::expected< T, StackTraceError< E > > Result
Definition: result_type.h:30