-
Notifications
You must be signed in to change notification settings - Fork 69
Rewrite users service from ruby to rust #2937
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
base: api-v2
Are you sure you want to change the base?
Conversation
a186334 to
4fb73c9
Compare
d82fbb1 to
09b2013
Compare
imobachgs
left a comment
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.
The infrastructure of the service looks good, but the logic is wrong. Agama keeps the configuration for the first user (under the user key) and the root (using the root key). There is nothing like a list of users.
Additionally, it does not read the list of users from the underlying system. It just uses its own configuration.
Please, check User and root for further information about the format.
| /// Users config. | ||
| #[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Merge, utoipa::ToSchema)] | ||
| #[serde(rename_all = "camelCase")] | ||
| pub struct Config { |
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 am sorry, but I would expect this struct to match the old UserSettings struct.
| /// Abstract the users-related configuration from the underlying system. | ||
| pub trait ModelAdapter: Send + 'static { | ||
| /// Reads the system info. | ||
| fn read_system_info(&self) -> SystemInfo { |
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 are you reading the information from the underlying system? Agama just holds the configuration for the first user and the root user. But they has nothing to do with the ones from the live system where Agama is running.

Problem
Current stable version of Agama is mixture of several languages and technologies. Users service was originally written in ruby. As we later on decided to prefer rust for various reasons, it makes sense to rewrite users service to rust.
Testing
Added a new unit testDocumentation (TODO)
Look for relevant sections and adjust:
change the
///comments (rust doc)and update the .md with
cargo xtask markdowngit ls-files '*.md'