NewCREnricher (auth/enricher.go)

AgentTeams · agentteams-controller/internal/auth/enricher.go · go · Apache-2.0
auth, tag:embed-classified

Kubernetes identity enricher that adds worker and team info to caller identities.

// Source: https://github.com/agentscope-ai/AgentTeams | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package auth

import (
	"context"
	"fmt"

	v1beta1 "github.com/agentscope-ai/AgentTeams/agentteams-controller/api/v1beta1"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/fields"
	"sigs.k8s.io/controller-runtime/pkg/client"
)

// Team field indexers registered by app.initFieldIndexers. Duplicated as
// string constants here (instead of importing the controller package) to
// avoid a circular dependency between auth and controller.
const teamWorkerMembersField = "spec.workerMembers.name"

// IdentityEnricher resolves additional identity fields (role, team

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key