-
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
Add skeleton of IDP interface for resolving friendly names #2391
Conversation
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 abstraction makes sense to me. Is the idea also to abstract the OIDC token validation into the implementations here?
// Provider is the identity provider that vended this identity. Note that | ||
// UserID and HumanName are only unique within the context of a single | ||
// identity provider. | ||
Provider IdentityProvider |
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.
Do we want to add email to this? For some IdPs we wouldn't quite have a preferred user name and the email would be more relevant.
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 email is the preferred username (HumanName
) for some providers. For others (e.g. GitHub Actions) users may not have email addresses.
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.
Makes sense, I think that's fine
|
||
// IdentityProvider provides an abstract interface for looking up identities | ||
// in a remote identity provider. | ||
type IdentityProvider interface { |
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.
is IdentityProvider assumed to be OIDC-compatible? if so, let's mark that in the docs.
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'm not sure that we want to require it. I imagined this as being decoupled from specific identity provider implementations, so we'd still need something like OIDC (or x.509 client certs) to assert the user's identity. Once we have their identity, we can then go through this interface to map it to/from database representation.
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.
Looking at zitadel.RelyingParty
, that interface looks a lot bigger (and more OIDC-specific) than what I was looking for here, but I could be convinced to expand to include that if we find it generally useful; it looks like it covers a lot more OIDC functionality. (The URL
method is admittedly a bit OIDC-specific at the moment.)
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 got some email comments from Ria that didn't show up here, adding them and then I'm going to polish this a little tonight and finish tomorrow.
|
||
// IdentityProvider provides an abstract interface for looking up identities | ||
// in a remote identity provider. | ||
type IdentityProvider interface { |
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.
Looking at zitadel.RelyingParty
, that interface looks a lot bigger (and more OIDC-specific) than what I was looking for here, but I could be convinced to expand to include that if we find it generally useful; it looks like it covers a lot more OIDC functionality. (The URL
method is admittedly a bit OIDC-specific at the moment.)
This PR needs additional information before we can continue. It is now marked as stale because it has been open for 30 days with no activity. Please provide the necessary details to continue or it will be closed in 30 days. |
f41c3b1
to
b691248
Compare
This PR needs additional information before we can continue. It is now marked as stale because it has been open for 30 days with no activity. Please provide the necessary details to continue or it will be closed in 30 days. |
We did this in #3155 |
See discussion in #2326. The goal here is to enable the following:
minder project role grant -r viewer -u JAORMX
(which should look up the "JAORMX"preferred_username
in Keycloak (populated from GitHub), and then store the (stable) Keycloak ID in the OpenFGA grant. We don't want to storeJAORMX
, because he might change his account name later.JAORMX
as the username coming back from ListRoleAssignments, so that we can read the output. We can also include the Keycloak userids in the RPC response, but no one will read them. 😁actions
IdentityProvider for GitHub actions which would be distinct from KeyCloak + GitHub users in 2minder project role grant -r editor -u actions/repo:stacklok/minder-rules-and-profiles:ref:refs/heads/main
. (Yeah, action names are pretty awesome...)To fit the interface into existing code, we'll need to replace:
ParseAndValidate
(4 calls,handlers_token.go
and 3xhandlers_user.go
)authzClient
(default_project.go
,handlers_authz.go
,handlers_user.go
) which will need to use the canonicalIdentity.String()
forWrite
,Check
, andProjectsForUser
, andIdentity.Human()
forAssignmentsToProject
.