1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// This file is @generated by prost-build.
/// OAuth2 extension can be used to retrieve an OAuth2 access token from an authorization server and inject it into the
/// proxied requests.
/// Currently, only the Client Credentials Grant flow is supported.
/// The access token will be injected into the request headers using the `Authorization` header as a bearer token.
/// \[\#next-free-field: 6\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OAuth2 {
/// Endpoint on the authorization server to retrieve the access token from.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-3.2>) for details.
#[prost(message, optional, tag = "1")]
pub token_endpoint: ::core::option::Option<
super::super::super::super::super::config::core::v3::HttpUri,
>,
/// Optional list of OAuth scopes to be claimed in the authorization request.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-4.4.2>) for details.
#[prost(string, repeated, tag = "2")]
pub scopes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The interval between two successive retries to fetch token from Identity Provider. Default is 2 secs.
/// The interval must be at least 1 second.
#[prost(message, optional, tag = "4")]
pub token_fetch_retry_interval: ::core::option::Option<
super::super::super::super::super::super::google::protobuf::Duration,
>,
/// Optional list of additional parameters to send to the token endpoint.
/// These parameters will be URL-encoded and included in the token request body.
#[prost(message, repeated, tag = "5")]
pub endpoint_params: ::prost::alloc::vec::Vec<o_auth2::EndpointParameter>,
#[prost(oneof = "o_auth2::FlowType", tags = "3")]
pub flow_type: ::core::option::Option<o_auth2::FlowType>,
}
/// Nested message and enum types in `OAuth2`.
pub mod o_auth2 {
/// Credentials to authenticate client to the authorization server.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-2.3>) for details.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientCredentials {
/// Client ID.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1>) for details.
#[prost(string, tag = "1")]
pub client_id: ::prost::alloc::string::String,
/// Client secret.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1>) for details.
#[prost(message, optional, tag = "2")]
pub client_secret: ::core::option::Option<
super::super::super::super::super::transport_sockets::tls::v3::SdsSecretConfig,
>,
/// The method to use when sending credentials to the authorization server.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1>) for details.
#[prost(enumeration = "AuthType", tag = "3")]
pub auth_type: i32,
}
impl ::prost::Name for ClientCredentials {
const NAME: &'static str = "ClientCredentials";
const PACKAGE: &'static str = "envoy.extensions.http.injected_credentials.oauth2.v3";
fn full_name() -> ::prost::alloc::string::String {
"envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials"
.into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials"
.into()
}
}
/// Optional additional parameters to include in the token endpoint request body.
/// These parameters will be URL-encoded and added to the request body along with the standard OAuth2 parameters.
/// Refer to your authorization server's documentation for supported parameters.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EndpointParameter {
/// Parameter name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Parameter value.
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
impl ::prost::Name for EndpointParameter {
const NAME: &'static str = "EndpointParameter";
const PACKAGE: &'static str = "envoy.extensions.http.injected_credentials.oauth2.v3";
fn full_name() -> ::prost::alloc::string::String {
"envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.EndpointParameter"
.into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2.EndpointParameter"
.into()
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AuthType {
/// The `client_id` and `client_secret` will be sent using HTTP Basic authentication scheme.
BasicAuth = 0,
/// The `client_id` and `client_secret` will be sent in the URL encoded request body.
/// This type should only be used when Auth server does not support Basic authentication.
UrlEncodedBody = 1,
}
impl AuthType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::BasicAuth => "BASIC_AUTH",
Self::UrlEncodedBody => "URL_ENCODED_BODY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BASIC_AUTH" => Some(Self::BasicAuth),
"URL_ENCODED_BODY" => Some(Self::UrlEncodedBody),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum FlowType {
/// Client Credentials Grant.
/// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](<https://www.rfc-editor.org/rfc/rfc6749#section-4.4>) for details.
#[prost(message, tag = "3")]
ClientCredentials(ClientCredentials),
}
}
impl ::prost::Name for OAuth2 {
const NAME: &'static str = "OAuth2";
const PACKAGE: &'static str = "envoy.extensions.http.injected_credentials.oauth2.v3";
fn full_name() -> ::prost::alloc::string::String {
"envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/envoy.extensions.http.injected_credentials.oauth2.v3.OAuth2"
.into()
}
}