1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct HealthCheckRequest {}
4#[derive(Clone, Copy, PartialEq, ::prost::Message)]
5pub struct HealthCheckResponse {
6 #[prost(bool, tag = "1")]
9 pub will_expire: bool,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct GetOidcInitRequest {}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct GetOidcInitResponse {
15 #[prost(string, tag = "1")]
18 pub client_id: ::prost::alloc::string::String,
19 #[prost(string, tag = "2")]
27 pub login_url: ::prost::alloc::string::String,
28 #[prost(string, repeated, tag = "3")]
31 pub redirect_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct ExchangeAuthorizationCodeRequest {
35 #[prost(string, tag = "1")]
36 pub client_id: ::prost::alloc::string::String,
37 #[prost(string, tag = "2")]
38 pub code: ::prost::alloc::string::String,
39 #[prost(string, tag = "3")]
40 pub redirect_uri: ::prost::alloc::string::String,
41 #[prost(string, tag = "4")]
42 pub code_verifier: ::prost::alloc::string::String,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct ExchangeAuthorizationCodeResponse {
46 #[prost(string, tag = "1")]
47 pub id_token: ::prost::alloc::string::String,
48 #[prost(int32, optional, tag = "2")]
49 pub expires_in: ::core::option::Option<i32>,
50 #[prost(string, optional, tag = "3")]
51 pub scope: ::core::option::Option<::prost::alloc::string::String>,
52}
53#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
54#[repr(i32)]
55pub enum PublicAppAuthenticationError {
56 Unspecified = 0,
57 NotSupported = 1,
58 Unauthenticated = 2,
59 Expired = 3,
60 UnknownClient = 4,
61 UnknownRedirectUri = 5,
62 InvalidGrant = 6,
63 InvalidClientCredentials = 7,
64}
65impl PublicAppAuthenticationError {
66 pub fn as_str_name(&self) -> &'static str {
71 match self {
72 Self::Unspecified => "PUBLIC_APP_AUTHENTICATION_ERROR_UNSPECIFIED",
73 Self::NotSupported => "PUBLIC_APP_AUTHENTICATION_ERROR_NOT_SUPPORTED",
74 Self::Unauthenticated => "PUBLIC_APP_AUTHENTICATION_ERROR_UNAUTHENTICATED",
75 Self::Expired => "PUBLIC_APP_AUTHENTICATION_ERROR_EXPIRED",
76 Self::UnknownClient => "PUBLIC_APP_AUTHENTICATION_ERROR_UNKNOWN_CLIENT",
77 Self::UnknownRedirectUri => {
78 "PUBLIC_APP_AUTHENTICATION_ERROR_UNKNOWN_REDIRECT_URI"
79 }
80 Self::InvalidGrant => "PUBLIC_APP_AUTHENTICATION_ERROR_INVALID_GRANT",
81 Self::InvalidClientCredentials => {
82 "PUBLIC_APP_AUTHENTICATION_ERROR_INVALID_CLIENT_CREDENTIALS"
83 }
84 }
85 }
86 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
88 match value {
89 "PUBLIC_APP_AUTHENTICATION_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
90 "PUBLIC_APP_AUTHENTICATION_ERROR_NOT_SUPPORTED" => Some(Self::NotSupported),
91 "PUBLIC_APP_AUTHENTICATION_ERROR_UNAUTHENTICATED" => {
92 Some(Self::Unauthenticated)
93 }
94 "PUBLIC_APP_AUTHENTICATION_ERROR_EXPIRED" => Some(Self::Expired),
95 "PUBLIC_APP_AUTHENTICATION_ERROR_UNKNOWN_CLIENT" => Some(Self::UnknownClient),
96 "PUBLIC_APP_AUTHENTICATION_ERROR_UNKNOWN_REDIRECT_URI" => {
97 Some(Self::UnknownRedirectUri)
98 }
99 "PUBLIC_APP_AUTHENTICATION_ERROR_INVALID_GRANT" => Some(Self::InvalidGrant),
100 "PUBLIC_APP_AUTHENTICATION_ERROR_INVALID_CLIENT_CREDENTIALS" => {
101 Some(Self::InvalidClientCredentials)
102 }
103 _ => None,
104 }
105 }
106}
107pub mod public_app_authentication_service_client {
109 #![allow(
110 unused_variables,
111 dead_code,
112 missing_docs,
113 clippy::wildcard_imports,
114 clippy::let_unit_value,
115 )]
116 use tonic::codegen::*;
117 use tonic::codegen::http::Uri;
118 #[derive(Debug, Clone)]
120 pub struct PublicAppAuthenticationServiceClient<T> {
121 inner: tonic::client::Grpc<T>,
122 }
123 impl PublicAppAuthenticationServiceClient<tonic::transport::Channel> {
124 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
126 where
127 D: TryInto<tonic::transport::Endpoint>,
128 D::Error: Into<StdError>,
129 {
130 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
131 Ok(Self::new(conn))
132 }
133 }
134 impl<T> PublicAppAuthenticationServiceClient<T>
135 where
136 T: tonic::client::GrpcService<tonic::body::Body>,
137 T::Error: Into<StdError>,
138 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
139 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
140 {
141 pub fn new(inner: T) -> Self {
142 let inner = tonic::client::Grpc::new(inner);
143 Self { inner }
144 }
145 pub fn with_origin(inner: T, origin: Uri) -> Self {
146 let inner = tonic::client::Grpc::with_origin(inner, origin);
147 Self { inner }
148 }
149 pub fn with_interceptor<F>(
150 inner: T,
151 interceptor: F,
152 ) -> PublicAppAuthenticationServiceClient<InterceptedService<T, F>>
153 where
154 F: tonic::service::Interceptor,
155 T::ResponseBody: Default,
156 T: tonic::codegen::Service<
157 http::Request<tonic::body::Body>,
158 Response = http::Response<
159 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
160 >,
161 >,
162 <T as tonic::codegen::Service<
163 http::Request<tonic::body::Body>,
164 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
165 {
166 PublicAppAuthenticationServiceClient::new(
167 InterceptedService::new(inner, interceptor),
168 )
169 }
170 #[must_use]
175 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
176 self.inner = self.inner.send_compressed(encoding);
177 self
178 }
179 #[must_use]
181 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
182 self.inner = self.inner.accept_compressed(encoding);
183 self
184 }
185 #[must_use]
189 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
190 self.inner = self.inner.max_decoding_message_size(limit);
191 self
192 }
193 #[must_use]
197 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
198 self.inner = self.inner.max_encoding_message_size(limit);
199 self
200 }
201 pub async fn health_check(
203 &mut self,
204 request: impl tonic::IntoRequest<super::HealthCheckRequest>,
205 ) -> std::result::Result<
206 tonic::Response<super::HealthCheckResponse>,
207 tonic::Status,
208 > {
209 self.inner
210 .ready()
211 .await
212 .map_err(|e| {
213 tonic::Status::unknown(
214 format!("Service was not ready: {}", e.into()),
215 )
216 })?;
217 let codec = tonic::codec::ProstCodec::default();
218 let path = http::uri::PathAndQuery::from_static(
219 "/nominal.public_app.authentication.v1.PublicAppAuthenticationService/HealthCheck",
220 );
221 let mut req = request.into_request();
222 req.extensions_mut()
223 .insert(
224 GrpcMethod::new(
225 "nominal.public_app.authentication.v1.PublicAppAuthenticationService",
226 "HealthCheck",
227 ),
228 );
229 self.inner.unary(req, path, codec).await
230 }
231 pub async fn get_oidc_init(
233 &mut self,
234 request: impl tonic::IntoRequest<super::GetOidcInitRequest>,
235 ) -> std::result::Result<
236 tonic::Response<super::GetOidcInitResponse>,
237 tonic::Status,
238 > {
239 self.inner
240 .ready()
241 .await
242 .map_err(|e| {
243 tonic::Status::unknown(
244 format!("Service was not ready: {}", e.into()),
245 )
246 })?;
247 let codec = tonic::codec::ProstCodec::default();
248 let path = http::uri::PathAndQuery::from_static(
249 "/nominal.public_app.authentication.v1.PublicAppAuthenticationService/GetOidcInit",
250 );
251 let mut req = request.into_request();
252 req.extensions_mut()
253 .insert(
254 GrpcMethod::new(
255 "nominal.public_app.authentication.v1.PublicAppAuthenticationService",
256 "GetOidcInit",
257 ),
258 );
259 self.inner.unary(req, path, codec).await
260 }
261 pub async fn exchange_authorization_code(
263 &mut self,
264 request: impl tonic::IntoRequest<super::ExchangeAuthorizationCodeRequest>,
265 ) -> std::result::Result<
266 tonic::Response<super::ExchangeAuthorizationCodeResponse>,
267 tonic::Status,
268 > {
269 self.inner
270 .ready()
271 .await
272 .map_err(|e| {
273 tonic::Status::unknown(
274 format!("Service was not ready: {}", e.into()),
275 )
276 })?;
277 let codec = tonic::codec::ProstCodec::default();
278 let path = http::uri::PathAndQuery::from_static(
279 "/nominal.public_app.authentication.v1.PublicAppAuthenticationService/ExchangeAuthorizationCode",
280 );
281 let mut req = request.into_request();
282 req.extensions_mut()
283 .insert(
284 GrpcMethod::new(
285 "nominal.public_app.authentication.v1.PublicAppAuthenticationService",
286 "ExchangeAuthorizationCode",
287 ),
288 );
289 self.inner.unary(req, path, codec).await
290 }
291 }
292}