AuthN: Add IsAuthenticatedBy to identity interface and replace checks (#85262)
Add IsAuthenticatedBy to identity interface and replace checks
This commit is contained in:
@@ -217,6 +217,15 @@ func (u *SignedInUser) GetNamespacedID() (string, string) {
|
||||
return parts[0], parts[1]
|
||||
}
|
||||
|
||||
func (u *SignedInUser) IsAuthenticatedBy(providers ...string) bool {
|
||||
for _, p := range providers {
|
||||
if u.AuthenticatedBy == p {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// FIXME: remove this method once all services are using an interface
|
||||
func (u *SignedInUser) IsNil() bool {
|
||||
return u == nil
|
||||
|
||||
Reference in New Issue
Block a user