-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow authenticated users without Minder projects to accept credentials #3909
Allow authenticated users without Minder projects to accept credentials #3909
Conversation
@kantord -- this changes the flow such that we don't need to call |
cmd/cli/app/auth/common.go
Outdated
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.
Most of the remainder of this file is common table-rendering code, which I left in place because I didn't want to move too much at once.
internal/util/cli/rpc_client.go
Outdated
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.
This didn't have tests before when it was in cmd/cli/app/auth
, but it shows up in coverage now, because it's in internal
. I think that's fair, but I'm not prepared to write tests for it yet.
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 don't think anything here would break the frontend, but there would need to be some frontend changes to make the behaviour consistent with the CLI.
return nil | ||
// Create a user if necessary, see https://github.com/stacklok/minder/pull/3837/files#r1674108001 | ||
if errors.Is(err, sql.ErrNoRows) { | ||
return store.CreateUser(ctx, sub) |
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.
There is an edge case where the invited user will also have installed the GitHub App from the Marketplace, in which case we would want to call claimGitHubInstalls
as well.
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.
Ah, good catch! Fixing!
…vite and creating a Minder account
Summary
See discussion here: #3837 (comment)
When a user is invited to a project (and they haven't used Minder before),
minder auth invite accept <code>
should set up what they need to use theinvited project, without requiring them to call
CreateUser
and set up a"personal project".
Along the way, I ended up moving the login functions to
internal/util/cli
,because it felt strange to have a bunch of shared logic in
cmd/cli/app/auth
.Fixes #3795
Change Type
Mark the type of change your PR introduces:
Testing
Added a unit test and tested manually with the new
minder auth invite accept
.Review Checklist: