Chore: Cleanup namespace and ID resolution (#79360)

* Chore: Cleanup namespace ID resolution

* Check for negative userID when relevant

* Reuse existing function for parsing ID as int

* Fix imports
This commit is contained in:
Vardan Torosyan
2023-12-21 20:42:05 +01:00
committed by GitHub
parent d160638c67
commit 63cd5a5625
8 changed files with 65 additions and 46 deletions
@@ -40,7 +40,7 @@ type OAuthTokenSync struct {
}
func (s *OAuthTokenSync) SyncOauthTokenHook(ctx context.Context, identity *authn.Identity, _ *authn.Request) error {
namespace, _ := identity.NamespacedID()
namespace, _ := identity.GetNamespacedID()
// only perform oauth token check if identity is a user
if namespace != authn.NamespaceUser {
return nil