-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional Terms Of Services APIs and libparsec support #8471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get exactly why eula is it's own kind of commands. It's because it's only part of the auth process ?
@touilleMan see #8513 for the old invitation system artifacts |
@AureliaDolo the issue is the So the commands to retrieve and accept the Terms Of Service must go through a different cmds family that does the same authentication checks, except for the acceptation of the Terms Of Service part. |
ff6d493
to
4441fa8
Compare
server/parsec/components/postgresql/organization_test_dump_organizations.py
Outdated
Show resolved
Hide resolved
As discussed with @touilleMan we should add a (minimal?) RFC describing how this works |
9615886
to
4ac273e
Compare
@@ -11,8 +11,14 @@ pub type Integer = i64; | |||
#[derive(serde::Deserialize, serde::Serialize, Clone, Debug, PartialEq, Eq)] | |||
pub struct DeviceID(pub String); | |||
|
|||
#[allow(unused)] | |||
pub enum ProtocolFamily { | |||
Family, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this mock needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used for testing the crate itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the libparsec_serialization_format
crate generates in its proc macros some code that makes uses of the types in libparsec_types
.
So that means libparsec_serialization_format
's tests requires libparsec_types
as dependencies, but this is cumbersome (don't remember the specifics, but I guess it has to do with circular dependencies).
So instead of directly relying on libparsec_types
, the generated code refers to something like super::libparsec_types
. This way the user of the proc macro can define whath is libparsec_types
should be:
- a mock (the code you were pointing out) in case of
libparsec_serialization_format
's tests - the real
libparsec_types
crate for all other cases
libparsec/crates/client_connection/src/authenticated_cmds/mod.rs
Outdated
Show resolved
Hide resolved
743b789
to
d6fbd7b
Compare
c905abd
to
c459cc7
Compare
Changes:
eula_get
(to retreive the EULA url that should be displayed to the user) andeula_accept
(to accept the EULA, once done the authenticated cmds can be used)client_get_eula
andclient_accept_eula
are now part oflibparsec
What is left:
Currently
libparsec_client
doesn't correctly handle HTTP errors coming from the server (see #8472 ).This means the HTTP 463 error coming from the server in case the EULA hasn't been accept is currently translated into an internal error (instead of being a proper dedicated error).