Skip to content

Conversation

@mchf
Copy link
Contributor

@mchf mchf commented Dec 11, 2025

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 test
  • Tested manually

Documentation (TODO)

Look for relevant sections and adjust:

@mchf mchf force-pushed the users_service branch 3 times, most recently from a186334 to 4fb73c9 Compare December 16, 2025 12:43
@mchf mchf force-pushed the users_service branch 2 times, most recently from d82fbb1 to 09b2013 Compare January 6, 2026 17:57
@mchf
Copy link
Contributor Author

mchf commented Jan 8, 2026

Current state as a picture (curl -k -H @headers.txt -X GET $AGAMA_URL/api/v2/system):
agama-users
once I publish even set config message there will also appear password (with values {type: hashed} or {type: plain, value: "whatever set by user"}, field next to name or may be slightly different - until it is set to stone, it can vary ;-)

Copy link
Contributor

@imobachgs imobachgs left a 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 {
Copy link
Contributor

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 {
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants