Documentation
¶
Overview ¶
Package groupref finds the objects that reference auth provider groups.
Index ¶
- func HasPrefix(prefix string) func(groupID string) bool
- func RemoveGroupSubjects(ctx context.Context, c kclient.Client, namespace string, ...) (map[Kind]int, error)
- func RemoveSubjects(subjects []types.Subject, match func(groupID string) bool) ([]types.Subject, bool)
- func VMCPProfileSubjects(manifest types.VMCPManifest) []types.Subject
- func WriteNewGroups(ctx context.Context, gateway *gclient.Client, storage kclient.Reader, ...) error
- func WriteNewSubjects(ctx context.Context, gateway *gclient.Client, storage kclient.Reader, ...) error
- type Finder
- type Kind
- type Reference
- type References
- type RoleAssignmentLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveGroupSubjects ¶
func RemoveGroupSubjects(ctx context.Context, c kclient.Client, namespace string, match func(groupID string) bool) (map[Kind]int, error)
RemoveGroupSubjects removes the group subjects that match from every access policy in namespace, and returns the number of objects of each kind that it changed.
It changes neither group role assignments, which live in the gateway database, nor the profiles of virtual MCP servers, which must keep at least one subject. A subject naming a group that no longer exists matches nobody.
func RemoveSubjects ¶
func RemoveSubjects(subjects []types.Subject, match func(groupID string) bool) ([]types.Subject, bool)
RemoveSubjects returns subjects without the group subjects that match, and whether any were removed. The order of the remaining subjects is kept.
func VMCPProfileSubjects ¶
func VMCPProfileSubjects(manifest types.VMCPManifest) []types.Subject
VMCPProfileSubjects returns the subjects of every profile of a virtual MCP server.
func WriteNewGroups ¶
func WriteNewGroups(ctx context.Context, gateway *gclient.Client, storage kclient.Reader, groupIDs []string, write func() error) error
WriteNewGroups runs write, which saves new references to groupIDs, as WriteNewSubjects does.
func WriteNewSubjects ¶
func WriteNewSubjects(ctx context.Context, gateway *gclient.Client, storage kclient.Reader, subjects, previous []types.Subject, write func() error) error
WriteNewSubjects runs write, which saves subjects in place of previous, and returns what write returns. The group subjects that subjects adds must reach groups of a SCIM connection's auth provider: a group of the provider must have the ID, and must not be being deleted because nothing referenced it. Such a reference would match nobody, and no pushed group could bind to it. Subjects that previous already has are left alone, so an old reference to a missing group does not block unrelated edits.
The write is recorded while it runs, so a deletion of unreferenced groups either waits for it and reads the new references, or marks its groups first and write is refused. A refusal is a bad request that names the provider by its display name, which is read from storage.
Types ¶
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder finds the objects that reference groups: every access policy type (model access policies are the LLM gateway's profiles, which carry its budgets and guardrail policies), group role assignments, the profiles of virtual MCP servers, and guardrail filters.
type Kind ¶
type Kind string
Kind is a kind of object that can reference groups.
const ( KindAccessControlRule Kind = "accessControlRule" KindModelAccessPolicy Kind = "modelAccessPolicy" KindSkillAccessRule Kind = "skillAccessRule" KindMessagePolicy Kind = "messagePolicy" KindGroupRoleAssignment Kind = "groupRoleAssignment" KindVMCPProfile Kind = "vmcpProfile" KindMCPGuardrailFilter Kind = "mcpGuardrailFilter" )
type Reference ¶
type Reference struct {
Kind Kind
// Name identifies the object: its name, or the group ID for a group role assignment.
Name string
DisplayName string
// Detail says where in the object the reference is, such as the profile of a virtual MCP server or the role a
// group role assignment grants.
Detail string
}
Reference is one object that references a group.
type References ¶
References maps group IDs to the objects that reference them.
type RoleAssignmentLister ¶
type RoleAssignmentLister interface {
ListGroupRoleAssignments(ctx context.Context) ([]gatewaytypes.GroupRoleAssignment, error)
}
RoleAssignmentLister lists group role assignments, which live in the gateway database.