MCPcopy Index your code
hub / github.com/tinyauthapp/tinyauth / IsInLdapGroup

Method IsInLdapGroup

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

Source from the content-addressed store, hash-verified

500}
501
502func (auth *AuthService) IsInLdapGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool {
503 if requiredGroups == "" {
504 return true
505 }
506
507 for userGroup := range strings.SplitSeq(context.LdapGroups, ",") {
508 if utils.CheckFilter(requiredGroups, strings.TrimSpace(userGroup)) {
509 tlog.App.Trace().Str("group", userGroup).Str("required", requiredGroups).Msg("User group matched")
510 return true
511 }
512 }
513
514 tlog.App.Debug().Msg("No groups matched")
515 return false
516}
517
518func (auth *AuthService) IsAuthEnabled(uri string, path config.AppPath) (bool, error) {
519 // Check for block list

Callers 1

proxyHandlerMethod · 0.80

Calls 1

CheckFilterFunction · 0.92

Tested by

no test coverage detected