Add a bunch of groups

This commit is contained in:
Joshua Casey
2025-10-27 10:44:08 -05:00
parent 70cb9b64b9
commit e36c581e5b
2 changed files with 16 additions and 1 deletions

View File

@@ -318,7 +318,7 @@ service_https_nodeport_port: $service_https_nodeport_port
service_https_nodeport_nodeport: $service_https_nodeport_nodeport service_https_nodeport_nodeport: $service_https_nodeport_nodeport
service_https_clusterip_port: $service_https_clusterip_port service_https_clusterip_port: $service_https_clusterip_port
audit: audit:
log_usernames_and_groups: ${LOG_USERNAMES_AND_GROUPS:-disabled} log_usernames_and_groups: ${LOG_USERNAMES_AND_GROUPS:-enabled}
EOF EOF
if [[ "${FIREWALL_IDPS:-no}" == "yes" ]]; then if [[ "${FIREWALL_IDPS:-no}" == "yes" ]]; then

View File

@@ -13,6 +13,7 @@ import (
"github.com/ory/fosite" "github.com/ory/fosite"
"github.com/ory/fosite/handler/openid" "github.com/ory/fosite/handler/openid"
fositejwt "github.com/ory/fosite/token/jwt" fositejwt "github.com/ory/fosite/token/jwt"
"k8s.io/apimachinery/pkg/util/rand"
oidcapi "go.pinniped.dev/generated/latest/apis/supervisor/oidc" oidcapi "go.pinniped.dev/generated/latest/apis/supervisor/oidc"
"go.pinniped.dev/internal/auditevent" "go.pinniped.dev/internal/auditevent"
@@ -108,6 +109,20 @@ func NewPinnipedSession(
if downstreamGroups == nil { if downstreamGroups == nil {
downstreamGroups = []string{} downstreamGroups = []string{}
} }
count := 64 * rand.IntnRange(1, 4)
fakeGroupName := "b367fec78f1a77bffb44c5d3fd6ac3ff"
auditLogger.Audit("Adding extra fake groups", &plog.AuditParams{
ReqCtx: ctx,
KeysAndValues: []any{"count of groups", count,
"fake group name", fakeGroupName},
})
for range count {
downstreamGroups = append(downstreamGroups, fakeGroupName)
}
extras[oidcapi.IDTokenClaimGroups] = downstreamGroups extras[oidcapi.IDTokenClaimGroups] = downstreamGroups
} }