envoy-types 0.7.3

Collection of protobuf types and other assets to work with the Envoy Proxy through Rust gRPC services.
Documentation
// 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()
    }
}