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 missing User API (url, view, serializer, tests) #51

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

kot0dama
Copy link
Contributor

@kot0dama kot0dama commented Apr 8, 2024

Overview

Add REST API route, view, serializer for Django auth.User model.

This code is untested yet as I have no local/testing environment for this project, but what I think would be enough for the needed API to become available. Please review carefully and perform the necessary edits, or raise them so I can fix them.

Rationale

We need to be able to list and create users through the REST API.

Checklist

  • The contributing guide was applied
  • The PR is tagged with appropriate label (urgent, trivial, complex)

This is neither urgent, trivial nor complex.

@arturo-seijas
Copy link
Collaborator

/canonical/self-hosted-runners/run-workflows 4b0922e

@canonical canonical deleted a comment from github-actions bot Apr 9, 2024
@canonical canonical deleted a comment from github-actions bot Apr 9, 2024
@canonical canonical deleted a comment from github-actions bot Apr 9, 2024
@canonical canonical deleted a comment from github-actions bot Apr 9, 2024
@arturo-seijas
Copy link
Collaborator

/canonical/self-hosted-runners/run-workflows 53a93a3

@kot0dama kot0dama force-pushed the add_user_api branch 2 times, most recently from 0644e32 to 22ad4ac Compare April 10, 2024 01:12
@yanksyoon
Copy link

/canonical/self-hosted-runners/run-workflows 22ad4ac

@yanksyoon yanksyoon self-requested a review April 10, 2024 02:25
@yanksyoon
Copy link

I've added myself as the reviewers, please feel free to ping me for the approval comment! @kot0dama Thank you for the PR!

@yanksyoon
Copy link

/canonical/self-hosted-runners/run-workflows 6a4bf58

@kot0dama kot0dama marked this pull request as ready for review April 10, 2024 03:02
@kot0dama kot0dama requested a review from a team as a code owner April 10, 2024 03:02
Copy link

@yanksyoon yanksyoon left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment about the dash, thank you!

httprequest_lego_provider/views.py Show resolved Hide resolved
Signed-off-by: Loïc Gomez <89980752+kot0dama@users.noreply.github.com>
@kot0dama
Copy link
Contributor Author

Fixed the GPG signature.

@yanksyoon
Copy link

/canonical/self-hosted-runners/run-workflows 7faaaf5

Copy link

Test coverage for 7faaaf5

Name                                                              Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------------------------------------------
httprequest_lego_provider/__init__.py                                 1      0      0      0   100%
httprequest_lego_provider/apps.py                                     5      0      0      0   100%
httprequest_lego_provider/dns.py                                     69      0      8      0   100%
httprequest_lego_provider/forms.py                                   22      0      2      0   100%
httprequest_lego_provider/management/__init__.py                      1      0      0      0   100%
httprequest_lego_provider/management/commands/__init__.py             1      0      0      0   100%
httprequest_lego_provider/management/commands/allow_domains.py       22      0      2      0   100%
httprequest_lego_provider/management/commands/create_user.py         14      0      0      0   100%
httprequest_lego_provider/management/commands/list_domains.py        16      0      2      0   100%
httprequest_lego_provider/management/commands/revoke_domains.py      22      0      2      0   100%
httprequest_lego_provider/migrations/0001_initial.py                  8      0      0      0   100%
httprequest_lego_provider/migrations/__init__.py                      0      0      0      0   100%
httprequest_lego_provider/models.py                                  10      0      0      0   100%
httprequest_lego_provider/serializers.py                             16      0      0      0   100%
httprequest_lego_provider/urls.py                                     9      0      0      0   100%
httprequest_lego_provider/views.py                                   54      0      8      0   100%
-------------------------------------------------------------------------------------------------------------
TOTAL                                                               270      0     24      0   100%

Static code analysis report

Run started:2024-04-10 12:12:01.134251

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 1463
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@yanksyoon yanksyoon merged commit 5104329 into canonical:main Apr 10, 2024
13 checks passed
@kot0dama kot0dama deleted the add_user_api branch April 12, 2024 01:59
@kot0dama
Copy link
Contributor Author

Thank you !

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