Skip to content

Commit 5d7d529

Browse files
authored
support protobuf versioning (#262)
* update protos * use versioned protos * update dependencies * update proto submodule * handle new proto structure * update protos * update protos * update proto submodule
1 parent 110bd04 commit 5d7d529

File tree

6 files changed

+38
-13
lines changed

6 files changed

+38
-13
lines changed

build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2727
// Make all messages serde-serializable.
2828
.type_attribute(".", "#[derive(serde::Serialize,serde::Deserialize)]")
2929
// Compiling protos using path on build time.
30-
.compile_protos(&["proto/core/proxy.proto"], &["proto/core"])?;
30+
.compile_protos(
31+
&[
32+
"proto/v2/proxy.proto",
33+
"proto/v2/common.proto",
34+
"proto/common/client_types.proto",
35+
],
36+
&["proto"],
37+
)?;
3138

3239
println!("cargo:rerun-if-changed=proto");
3340
Ok(())

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/enterprise/handlers/desktop_client_mfa.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ pub(super) async fn mfa_auth_callback(
8080
code: payload.code,
8181
nonce,
8282
state: payload.state,
83-
#[allow(deprecated)]
84-
callback_url: String::new(),
8583
};
8684

8785
debug!("Sending MFA OIDC authenticate request to core service");

src/enterprise/handlers/openid_login.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ async fn auth_callback(
164164
let request = AuthCallbackRequest {
165165
code: payload.code,
166166
nonce,
167-
#[allow(deprecated)]
168-
callback_url: String::new(),
169167
};
170168

171169
let rx = state

src/lib.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,30 @@ pub mod http;
1616
pub mod logging;
1717
mod setup;
1818

19+
pub(crate) mod generated {
20+
pub(crate) mod defguard {
21+
pub(crate) mod proxy {
22+
pub(crate) mod v2 {
23+
tonic::include_proto!("defguard.proxy.v2");
24+
}
25+
}
26+
27+
pub(crate) mod common {
28+
pub(crate) mod v2 {
29+
tonic::include_proto!("defguard.common.v2");
30+
}
31+
}
32+
33+
pub mod client_types {
34+
tonic::include_proto!("defguard.client_types");
35+
}
36+
}
37+
}
38+
1939
pub(crate) mod proto {
20-
tonic::include_proto!("defguard.proxy");
40+
pub(crate) use crate::generated::defguard::client_types::*;
41+
pub(crate) use crate::generated::defguard::common::v2::*;
42+
pub(crate) use crate::generated::defguard::proxy::v2::*;
2143
}
2244

2345
#[macro_use]

0 commit comments

Comments
 (0)