MCPcopy
hub / github.com/tinyauthapp/tinyauth / IsInOAuthGroup

Method IsInOAuthGroup

internal/service/auth_service.go:479–500  ·  view source on GitHub ↗
(c *gin.Context, context config.UserContext, requiredGroups string)

Source from the content-addressed store, hash-verified

477}
478
479func (auth *AuthService) IsInOAuthGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool {
480 if requiredGroups == "" {
481 return true
482 }
483
484 for id := range config.OverrideProviders {
485 if context.Provider == id {
486 tlog.App.Info().Str("provider", id).Msg("OAuth groups not supported for this provider")
487 return true
488 }
489 }
490
491 for userGroup := range strings.SplitSeq(context.OAuthGroups, ",") {
492 if utils.CheckFilter(requiredGroups, strings.TrimSpace(userGroup)) {
493 tlog.App.Trace().Str("group", userGroup).Str("required", requiredGroups).Msg("User group matched")
494 return true
495 }
496 }
497
498 tlog.App.Debug().Msg("No groups matched")
499 return false
500}
501
502func (auth *AuthService) IsInLdapGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool {
503 if requiredGroups == "" {

Callers 1

proxyHandlerMethod · 0.80

Calls 1

CheckFilterFunction · 0.92

Tested by

no test coverage detected