44 inline static const std::string kAuthType =
"rest.auth.type";
45 inline static const std::string kAuthTypeNone =
"none";
46 inline static const std::string kAuthTypeBasic =
"basic";
47 inline static const std::string kAuthTypeOAuth2 =
"oauth2";
48 inline static const std::string kAuthTypeSigV4 =
"sigv4";
52 inline static const std::string kBasicUsername =
"rest.auth.basic.username";
53 inline static const std::string kBasicPassword =
"rest.auth.basic.password";
57 inline static const std::string kSigV4Region =
"rest.auth.sigv4.region";
58 inline static const std::string kSigV4Service =
"rest.auth.sigv4.service";
59 inline static const std::string kSigV4DelegateAuthType =
60 "rest.auth.sigv4.delegate-auth-type";
64 inline static Entry<std::string> kToken{
"token",
""};
65 inline static Entry<std::string> kCredential{
"credential",
""};
66 inline static Entry<std::string> kScope{
"scope",
"catalog"};
67 inline static Entry<std::string> kOAuth2ServerUri{
"oauth2-server-uri",
69 inline static Entry<bool> kKeepRefreshed{
"token-refresh-enabled",
true};
70 inline static Entry<bool> kExchangeEnabled{
"token-exchange-enabled",
true};
71 inline static Entry<std::string> kAudience{
"audience",
""};
72 inline static Entry<std::string> kResource{
"resource",
""};
75 static Result<AuthProperties> FromProperties(
76 const std::unordered_map<std::string, std::string>& properties);
79 std::string
token()
const {
return Get(kToken); }
81 std::string
credential()
const {
return Get(kCredential); }
83 std::string
scope()
const {
return Get(kScope); }
92 const std::string&
client_id()
const {
return client_id_; }
97 std::unordered_map<std::string, std::string> optional_oauth_params()
const;
100 std::string client_id_;
101 std::string client_secret_;
102 std::string token_type_;
103 std::optional<int64_t> expires_at_millis_;