mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2025-12-23 14:25:50 +00:00
Add a bunch of groups
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user