shared

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGroupByName

func FindGroupByName(ctx util.CmdContext, organization, project, groupName, descriptorFilter string) (*graph.GraphGroup, error)

FindGroupByName locates a single Azure DevOps security group by its display name and optional descriptor. When descriptorFilter is empty, exactly one group must match the provided name within the optional scope descriptor.

func ResolveMemberDescriptor

func ResolveMemberDescriptor(ctx util.CmdContext, organization, member string) (*graph.GraphSubject, error)

ResolveMemberDescriptor resolves a member identifier (descriptor, email, or principal name) into a graph subject descriptor.

func ResolveScopeDescriptor

func ResolveScopeDescriptor(ctx util.CmdContext, organization, project string) (*string, *string, error)

ResolveScopeDescriptor fetches the descriptor representing the project scope when a project is supplied. It returns the descriptor value along with the project ID string to support callers that need to distinguish between identically named groups scoped to different projects.

Types

type Scope

type Scope struct {
	Organization string
	Project      string
}

Scope describes the organization/project resolution for commands that accept optional project scope.

func ParseScope

func ParseScope(ctx util.CmdContext, scope string) (*Scope, error)

ParseScope resolves the organization and optional project from an input argument of the form "[ORGANIZATION[/PROJECT]]". When the input is empty, the default organization from the user configuration is returned. The function trims whitespace around individual segments and ensures the resulting organization and project values are non-empty when provided.

type Target

type Target struct {
	Organization string
	Project      string
	GroupName    string
}

Target encapsulates the parsed components of a security group target argument.

func ParseTarget

func ParseTarget(target string) (*Target, error)

ParseTarget validates and parses a target argument of form ORGANIZATION/GROUP or ORGANIZATION/PROJECT/GROUP.

func ParseTargetWithDefault

func ParseTargetWithDefault(ctx util.CmdContext, target string) (*Target, error)

ParseTargetWithDefault resolves a target argument that allows an implicit organization by falling back to the configured default. The accepted formats are:

  • "GROUP" (defaults organization, no project)
  • "ORGANIZATION/GROUP"
  • "ORGANIZATION/PROJECT/GROUP"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL