Skip to content
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

Add endpoint to save SUMA credentials #2271

Merged
merged 6 commits into from
Feb 12, 2024
Merged

Add endpoint to save SUMA credentials #2271

merged 6 commits into from
Feb 12, 2024

Conversation

jamie-suse
Copy link
Contributor

Description

Adds endpoint to save SUMA credentials.

Using this endpoint, (new) credentials can only be saved if there currently aren't existing saved credentials.

How was this tested?

Added unit tests

@jamie-suse jamie-suse added enhancement New feature or request elixir Pull requests that update Elixir code labels Feb 7, 2024
@jamie-suse jamie-suse force-pushed the save-suma-settings branch 2 times, most recently from 01637d2 to 6a47488 Compare February 9, 2024 09:28
@jamie-suse jamie-suse marked this pull request as ready for review February 9, 2024 09:29
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super! Just a few notes

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same things Nelson advised plus a bonus tip

Comment on lines 43 to 44
with {:ok, saved_settings} <-
body_params |> Map.from_struct() |> SoftwareUpdates.save_settings() do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: just be careful with the pipes in with statements, they can become pretty unreadable fast (personal PTSD moment with that)

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@jamie-suse jamie-suse merged commit be0d7d2 into main Feb 12, 2024
24 checks passed
@jamie-suse jamie-suse deleted the save-suma-settings branch February 12, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

3 participants