models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureEligibleTarget

type AzureEligibleTarget struct {
	OrganizationID string        `json:"organizationId"`
	WorkspaceID    string        `json:"workspaceId"`
	WorkspaceName  string        `json:"workspaceName"`
	WorkspaceType  WorkspaceType `json:"workspaceType"`
	RoleInfo       RoleInfo      `json:"roleInfo"`
}

AzureEligibleTarget represents a target the user is eligible to elevate to.

func (*AzureEligibleTarget) UnmarshalJSON

func (t *AzureEligibleTarget) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling to handle both "roleInfo" (live API) and "role" (OpenAPI spec) field names.

type CSP

type CSP string

CSP represents a cloud service provider.

const (
	CSPAzure CSP = "AZURE"
	CSPAWS   CSP = "AWS"
	CSPGCP   CSP = "GCP"
)

type ElevateAccessResult

type ElevateAccessResult struct {
	CSP            CSP                   `json:"csp"`
	OrganizationID string                `json:"organizationId"`
	Results        []ElevateTargetResult `json:"results"`
}

ElevateAccessResult contains the overall elevation response.

type ElevateRequest

type ElevateRequest struct {
	CSP            CSP             `json:"csp"`
	OrganizationID string          `json:"organizationId"`
	Targets        []ElevateTarget `json:"targets"`
}

ElevateRequest is the request body for POST /api/access/elevate.

type ElevateResponse

type ElevateResponse struct {
	Response ElevateAccessResult `json:"response"`
}

ElevateResponse is the response from POST /api/access/elevate.

type ElevateTarget

type ElevateTarget struct {
	WorkspaceID string `json:"workspaceId"`
	RoleID      string `json:"roleId,omitempty"`
	RoleName    string `json:"roleName,omitempty"`
}

ElevateTarget represents a single target for elevation.

type ElevateTargetResult

type ElevateTargetResult struct {
	WorkspaceID       string     `json:"workspaceId"`
	RoleID            string     `json:"roleId"`
	SessionID         string     `json:"sessionId"`
	AccessCredentials *string    `json:"accessCredentials"`
	ErrorInfo         *ErrorInfo `json:"errorInfo"`
}

ElevateTargetResult is the per-target result of an elevation request.

type EligibilityResponse

type EligibilityResponse struct {
	Response  []AzureEligibleTarget `json:"response"`
	NextToken *string               `json:"nextToken"`
	Total     int                   `json:"total"`
}

EligibilityResponse is the response from GET /api/access/{CSP}/eligibility.

type ErrorInfo

type ErrorInfo struct {
	Code        string `json:"code"`
	Message     string `json:"message"`
	Description string `json:"description"`
	Link        string `json:"link,omitempty"`
}

ErrorInfo describes the reason for an elevation failure.

type RoleInfo

type RoleInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

RoleInfo contains the ID and name of a role.

type SessionInfo

type SessionInfo struct {
	SessionID       string `json:"session_id"`
	UserID          string `json:"user_id"`
	CSP             CSP    `json:"csp"`
	WorkspaceID     string `json:"workspace_id"`
	RoleID          string `json:"role_id"`
	SessionDuration int    `json:"session_duration"`
}

SessionInfo represents an active elevated session. Note: The live SCA API uses snake_case field names, which differs from the OpenAPI spec's camelCase. The role_id field contains the role display name (e.g., "User Access Administrator"), not an ARM resource path.

type SessionsResponse

type SessionsResponse struct {
	Response  []SessionInfo `json:"response"`
	NextToken *string       `json:"nextToken"`
	Total     int           `json:"total"`
}

SessionsResponse is the response from GET /api/access/sessions.

type WorkspaceType

type WorkspaceType string

WorkspaceType represents the type of Azure workspace.

const (
	WorkspaceTypeResource        WorkspaceType = "RESOURCE"
	WorkspaceTypeResourceGroup   WorkspaceType = "RESOURCE_GROUP"
	WorkspaceTypeSubscription    WorkspaceType = "SUBSCRIPTION"
	WorkspaceTypeManagementGroup WorkspaceType = "MANAGEMENT_GROUP"
	WorkspaceTypeDirectory       WorkspaceType = "DIRECTORY"
)

Jump to

Keyboard shortcuts

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