Android-cuttlefish cvd tool
luci_credential_helper_source.h
Go to the documentation of this file.
1//
2// Copyright (C) 2026 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
26
27namespace cuttlefish {
28
29// OAuth2 credentials obtained from a LUCI-compatible credential helper binary
30// (https://chromium.googlesource.com/infra/luci/luci-go/+/refs/heads/main/auth/credhelperpb/credhelper.proto).
32 public:
33 static std::unique_ptr<CredentialSource> Make(const std::string& scope);
34
35 private:
36 LuciCredentialHelperSource(std::string helper_bin, std::string scope);
37
39
40 std::string helper_bin_;
41 std::string scope_;
42};
43
44} // namespace cuttlefish
Definition: luci_credential_helper_source.h:31
static std::unique_ptr< CredentialSource > Make(const std::string &scope)
Definition: luci_credential_helper_source.cc:42
std::string helper_bin_
Definition: luci_credential_helper_source.h:40
LuciCredentialHelperSource(std::string helper_bin, std::string scope)
Definition: luci_credential_helper_source.cc:53
Result< std::pair< std::string, std::chrono::seconds > > Refresh() override
Definition: luci_credential_helper_source.cc:58
std::string scope_
Definition: luci_credential_helper_source.h:41
Definition: refreshing_credential_source.h:30
Definition: alloc_driver.h:21
tl::expected< T, StackTraceError< E > > Result
Definition: result_type.h:30