Authn: Add function to resolve identity from org and namespace id (#84555)
* Add function to get the namespaced id * Add function to resolve an identity through authn.Service from org and namespace id * Switch to resolve identity for re-authenticate in another org
This commit is contained in:
@@ -87,6 +87,18 @@ type Identity struct {
|
||||
IDToken string
|
||||
}
|
||||
|
||||
func (i *Identity) GetID() string {
|
||||
return i.ID
|
||||
}
|
||||
|
||||
func (i *Identity) GetNamespacedID() (namespace string, identifier string) {
|
||||
split := strings.Split(i.GetID(), ":")
|
||||
if len(split) != 2 {
|
||||
return "", ""
|
||||
}
|
||||
return split[0], split[1]
|
||||
}
|
||||
|
||||
func (i *Identity) GetAuthenticatedBy() string {
|
||||
return i.AuthenticatedBy
|
||||
}
|
||||
@@ -122,16 +134,6 @@ func (i *Identity) GetLogin() string {
|
||||
return i.Login
|
||||
}
|
||||
|
||||
func (i *Identity) GetNamespacedID() (namespace string, identifier string) {
|
||||
split := strings.Split(i.ID, ":")
|
||||
|
||||
if len(split) != 2 {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
return split[0], split[1]
|
||||
}
|
||||
|
||||
// GetOrgID implements identity.Requester.
|
||||
func (i *Identity) GetOrgID() int64 {
|
||||
return i.OrgID
|
||||
|
||||
Reference in New Issue
Block a user