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

feat: Expose the login code as extra parameter in the QRCode model #387

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

3v1n0
Copy link
Collaborator

@3v1n0 3v1n0 commented Jun 17, 2024

Expose the qrcode code as a required argument, while make possible for UI not to support qrcode rendering, but still being able to login via login code.

UDENG-3013

The output of skip2/go-qrcode ToSmallString() includes an extra trailing
empty line that we don't want to show, so drop it
It's nicer to have it aligned to the qrcode itself
We need to expose the code separately as different field so that the UI
can show it properly both in GDM and in PAM client.

The field is required
@3v1n0 3v1n0 requested a review from a team as a code owner June 17, 2024 00:04
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 91.07143% with 5 lines in your changes missing coverage. Please review.

Project coverage is 84.92%. Comparing base (de41096) to head (8c610cf).
Report is 3 commits behind head on main.

Files Patch % Lines
pam/internal/adapter/authmodeselection.go 83.33% 2 Missing ⚠️
pam/internal/adapter/qrcodemodel.go 87.50% 1 Missing and 1 partial ⚠️
examplebroker/broker.go 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #387      +/-   ##
==========================================
+ Coverage   84.86%   84.92%   +0.06%     
==========================================
  Files          76       76              
  Lines        6091     6129      +38     
  Branches       85       85              
==========================================
+ Hits         5169     5205      +36     
- Misses        646      648       +2     
  Partials      276      276              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jibel
Copy link
Collaborator

jibel commented Jun 17, 2024

It adds more that an optional QR code. The impact on the project is deeper than initially discussed. Lets park this for now.

@3v1n0
Copy link
Collaborator Author

3v1n0 commented Jun 17, 2024

It adds more that an optional QR code. The impact on the project is deeper than initially discussed. Lets park this for now.

First commits just add the code support, so I can just drop the last one and move it to another PR to keep it simpler.

I added it all here since it looked related enough.

This allows to keep supporting gdm, until it doesn't get updated since
it has not support for the qrcode code yet
@3v1n0 3v1n0 changed the title Qrcode: expose the login code as extra parameters and support contentless qrcode Qrcode: expose the login code as extra parameter Jun 20, 2024
Copy link
Member

@denisonbarbosa denisonbarbosa left a comment

Choose a reason for hiding this comment

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

Looks good to me. Well done!

@denisonbarbosa denisonbarbosa changed the title Qrcode: expose the login code as extra parameter feat: Expose the login code as extra parameter in the QRCode model Jun 20, 2024
Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

I’m not a big fan we expose that before the v2 API reshape, but I think we had enough discussions on this. So let’s move foward. The current diff is small enough despite the addition to the TUI. Approving. Thanks!

@3v1n0 3v1n0 merged commit e378686 into ubuntu:main Jun 21, 2024
5 checks passed
denisonbarbosa added a commit to ubuntu/authd-oidc-brokers that referenced this pull request Jun 26, 2024
After the change introduced in authd by
ubuntu/authd#387, we can now provide the device
code as a separate field in the layout to improve the way it's rendered
by PAM.
denisonbarbosa added a commit to ubuntu/authd-oidc-brokers that referenced this pull request Jun 26, 2024
After the change introduced in authd by
ubuntu/authd#387, we can now provide the device
code as a separate field in the layout to improve the way it's rendered
by PAM.
denisonbarbosa added a commit to ubuntu/authd-oidc-brokers that referenced this pull request Jun 27, 2024
This contains a couple of adjustments to our AuthenticationModes-related
functions: GetAuthenticationModes and SelectAuthenticationMode (very
minor). Details are explained in more detail in the commit messages, but
the TLDR is:
1- Simplify a bit of the logic in the functions;
2- Add support for the new `code` layout field introduced in
[authd#387](ubuntu/authd#387);
3- Use a more comprehensive name for the authentication mode related to
the device authentication;
4- Only show device authentication as a valid authentication mode if the
provider is reachable and supports this mode;

UDENG-3121
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.

5 participants