-
-
Notifications
You must be signed in to change notification settings - Fork 338
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 users with roles and finish role-based page authorization #3002
Conversation
@@ -47,6 +75,31 @@ | |||
] | |||
}, | |||
"description": "Available roles for this application. These can be assigned to users." | |||
}, | |||
"users": { |
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 think we can start with authentication only for this PR.
I don't think it makes sense at the moment for the toolpad configuration to act as a user pool. This would require developers to have to hardcode each user in the configuration. And likely be a privacy problem for public repos.
We will create a role mapping once we have an authentication provider that supports passing roles. So not for GitHub/Google. We don't support RBAC for our free version anyway.
edit: just realized that the authentication part of this PR is stacked from another PR. The comment still stands though. We won't support rbac for the free version. We should probably add azure AD provider first before creating a role mapping.
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.
Ok, I can keep most of this PR on hold if that's the best course and see what can be merged for now.
We can also have a more in-depth discussion about this and see if there's any more solutions we can agree on.
id: profile.email ?? String(profile.id), | ||
name: profile.name, | ||
email: profile.email, | ||
image: profile.avatar_url, |
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.
id: profile.id.toString(),
name: profile.name ?? profile.login,
email: profile.email,
image: profile.avatar_url,
const roles = await getProfileRoles(profile.email, project); | ||
|
||
return { | ||
id: profile.email, |
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.
id: profile.email, | |
id: profile.sub, |
?
Replaced by #3077, can revisit later if we decide to add our own role assignments. |
Still under a feature flag, as runtime RPC protection is needed next and can be done in a separate PR.
List of features:
@auth/core
to map roles from a service and I'm not sure if that would even be desirable or straightforward for users).