Help us shape the future of Go! Take the 2026 Go Developer Survey

wire

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package wire mirrors the JFrog JSON forms that pkg/types converts: the legacy v1 and v2 permission targets, the Access v2 permission, and the legacy and Access user and group documents. Field names match JFrog exactly, which is why this package (with pkg/repo) is exempt from the project's snake_case tag rule (decision 0002). It holds no logic; the conversions live in pkg/types so this package never depends on the domain model.

Booleans whose default is not false are pointers so a converter can tell "absent" from "false" when a client omits them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessActions

type AccessActions struct {
	Users  map[string][]string `json:"users,omitempty"`
	Groups map[string][]string `json:"groups,omitempty"`
}

AccessActions maps principal names to Access action names.

type AccessGroup

type AccessGroup struct {
	Name            string   `json:"name"`
	Description     string   `json:"description,omitempty"`
	AutoJoin        *bool    `json:"auto_join,omitempty"`
	AdminPrivileges *bool    `json:"admin_privileges,omitempty"`
	ExternalID      string   `json:"external_id,omitempty"`
	Members         []string `json:"members,omitempty"`
	ReportsManager  *bool    `json:"reports_manager,omitempty"`
	WatchManager    *bool    `json:"watch_manager,omitempty"`
	PolicyManager   *bool    `json:"policy_manager,omitempty"`
	PolicyViewer    *bool    `json:"policy_viewer,omitempty"`
	ManageResources *bool    `json:"manage_resources,omitempty"`
	ManageWebhook   *bool    `json:"manage_webhook,omitempty"`
	Realm           string   `json:"realm,omitempty"`
	RealmAttributes string   `json:"realm_attributes,omitempty"`
}

AccessGroup is /access/api/v2/groups/{name}.

type AccessPermission

type AccessPermission struct {
	Name        string                    `json:"name"`
	Description string                    `json:"description,omitempty"`
	Resources   map[string]AccessResource `json:"resources"`
}

AccessPermission is /access/api/v2/permissions/{name}.

type AccessResource

type AccessResource struct {
	Actions AccessActions           `json:"actions,omitzero"`
	Targets map[string]AccessTarget `json:"targets"`
}

AccessResource is one resource section of an Access v2 permission.

type AccessTarget

type AccessTarget struct {
	IncludePatterns []string `json:"include_patterns"`
	ExcludePatterns []string `json:"exclude_patterns"`
}

AccessTarget holds the patterns of one target.

type AccessUser

type AccessUser struct {
	Username                 string   `json:"username"`
	Email                    string   `json:"email,omitempty"`
	Password                 string   `json:"password,omitempty"`
	Groups                   []string `json:"groups,omitempty"`
	Admin                    *bool    `json:"admin,omitempty"`
	ProfileUpdatable         *bool    `json:"profile_updatable,omitempty"`
	InternalPasswordDisabled *bool    `json:"internal_password_disabled,omitempty"`
	DisableUIAccess          *bool    `json:"disable_ui_access,omitempty"`
	WatchManager             *bool    `json:"watch_manager,omitempty"`
	PolicyViewer             *bool    `json:"policy_viewer,omitempty"`
	PolicyManager            *bool    `json:"policy_manager,omitempty"`
	ReportsManager           *bool    `json:"reports_manager,omitempty"`
	ResourcesManager         *bool    `json:"resources_manager,omitempty"`
	ManageWebhook            *bool    `json:"manage_webhook,omitempty"`
	PlatformAuditor          *bool    `json:"platform_auditor,omitempty"`
	EffectiveAdmin           *bool    `json:"effective_admin,omitempty"`
	LastLoggedIn             *string  `json:"last_logged_in"`
	Realm                    string   `json:"realm,omitempty"`
	Status                   string   `json:"status,omitempty"`
}

AccessUser is /access/api/v2/users/{username}. EffectiveAdmin, Realm, Status and LastLoggedIn are server-owned; Password is write-only. LastLoggedIn is always present and null for a user who never logged in, as Artifactory answers since 7.98.7.

type ActionsV2

type ActionsV2 struct {
	Users  map[string][]string `json:"users,omitempty"`
	Groups map[string][]string `json:"groups,omitempty"`
}

ActionsV2 maps principal names to legacy action names (read, annotate, write, delete, manage, managedXrayMeta, distribute).

type BlobMirror

type BlobMirror struct {
	Tier        string `json:"tier"`
	Zone        string `json:"zone,omitempty"`
	Redundancy  int    `json:"redundancy"`
	WriteQuorum int    `json:"writeQuorum"`
	// UnderReplicatedBlobs counts blobs with fewer present copies than
	// Redundancy, not counting blobs being deleted.
	UnderReplicatedBlobs int64              `json:"underReplicatedBlobs"`
	Members              []BlobMirrorMember `json:"members"`
	// RemovedMembers are members with replica records that are no longer
	// configured; always present, empty when there are none.
	RemovedMembers []BlobMirrorRemovedMember `json:"removedMembers"`
}

BlobMirror is one mirrored blob tier, "blob" or "cold_blob".

type BlobMirrorMember

type BlobMirrorMember struct {
	Name         string `json:"name"`
	Zone         string `json:"zone,omitempty"`
	Backend      string `json:"backend,omitempty"`
	WriteEnabled bool   `json:"writeEnabled"`
	// Available is false while the member's breaker is open.
	Available        bool  `json:"available"`
	AverageLatencyMs int64 `json:"averageLatencyMs"`
	// Replicas is keyed by replica state (present, pending, deleting,
	// failed) and always holds all four.
	Replicas map[string]ReplicaTally `json:"replicas"`
	// SoleCopies counts the blobs whose only present copy is on this
	// member; a drained member is safe to remove once it is zero.
	SoleCopies int64 `json:"soleCopies"`
}

BlobMirrorMember is one member store of a BlobMirror.

type BlobMirrorRemovedMember

type BlobMirrorRemovedMember struct {
	Name       string                  `json:"name"`
	Replicas   map[string]ReplicaTally `json:"replicas"`
	SoleCopies int64                   `json:"soleCopies"`
}

BlobMirrorRemovedMember is a member removed from the configuration that still has replica records. The mirror no longer reads from it, so its SoleCopies are out of reach until it is configured again.

type LegacyGroup

type LegacyGroup struct {
	Name            string   `json:"name"`
	Description     string   `json:"description,omitempty"`
	AutoJoin        *bool    `json:"autoJoin,omitempty"`
	AdminPrivileges *bool    `json:"adminPrivileges,omitempty"`
	Realm           string   `json:"realm,omitempty"`
	RealmAttributes string   `json:"realmAttributes,omitempty"`
	UserNames       []string `json:"userNames,omitempty"`
	WatchManager    *bool    `json:"watchManager,omitempty"`
	PolicyManager   *bool    `json:"policyManager,omitempty"`
	ReportsManager  *bool    `json:"reportsManager,omitempty"`
}

LegacyGroup is /artifactory/api/security/groups/{name}.

type LegacyUser

type LegacyUser struct {
	Name                     string   `json:"name"`
	Email                    string   `json:"email,omitempty"`
	Password                 string   `json:"password,omitempty"`
	Admin                    *bool    `json:"admin,omitempty"`
	ProfileUpdatable         *bool    `json:"profileUpdatable,omitempty"`
	DisableUIAccess          *bool    `json:"disableUIAccess,omitempty"`
	InternalPasswordDisabled *bool    `json:"internalPasswordDisabled,omitempty"`
	Groups                   []string `json:"groups,omitempty"`
	Realm                    string   `json:"realm,omitempty"`
	LastLoggedIn             string   `json:"lastLoggedIn,omitempty"`
	Status                   string   `json:"status,omitempty"`
	MFAStatus                string   `json:"mfaStatus,omitempty"`
	PolicyViewer             *bool    `json:"policyViewer,omitempty"`
	PolicyManager            *bool    `json:"policyManager,omitempty"`
	WatchManager             *bool    `json:"watchManager,omitempty"`
	ReportsManager           *bool    `json:"reportsManager,omitempty"`
}

LegacyUser is /artifactory/api/security/users/{name}. Password is write-only; status, realm, lastLoggedIn and mfaStatus are server-owned.

type MultipartUploadStatus

type MultipartUploadStatus struct {
	Status        string `json:"status"`
	Error         string `json:"error,omitempty"`
	Progress      *int   `json:"progress,omitempty"`
	ChecksumToken string `json:"checksumToken,omitempty"`
}

MultipartUploadStatus answers the JFrog CLI's multipart upload status poll (POST /artifactory/api/v1/uploads/status), in the shape jfrog-client-go decodes (artifactory/services/utils/multipartupload.go).

type PermissionTargetV1

type PermissionTargetV1 struct {
	Name            string       `json:"name"`
	IncludesPattern string       `json:"includesPattern,omitempty"`
	ExcludesPattern string       `json:"excludesPattern,omitempty"`
	Repositories    []string     `json:"repositories"`
	Principals      PrincipalsV1 `json:"principals,omitzero"`
}

PermissionTargetV1 is /artifactory/api/security/permissions/{name}. Patterns are single comma-separated strings and the target covers repositories only.

type PermissionTargetV2

type PermissionTargetV2 struct {
	Name          string     `json:"name"`
	Repo          *SectionV2 `json:"repo,omitempty"`
	Build         *SectionV2 `json:"build,omitempty"`
	ReleaseBundle *SectionV2 `json:"releaseBundle,omitempty"`
}

PermissionTargetV2 is /artifactory/api/v2/security/permissions/{name}.

type PrincipalsV1

type PrincipalsV1 struct {
	Users  map[string][]string `json:"users,omitempty"`
	Groups map[string][]string `json:"groups,omitempty"`
}

PrincipalsV1 maps principal names to action letters (r n w d m mxm x).

type ReplicaTally

type ReplicaTally struct {
	Count int64  `json:"count"`
	Bytes int64  `json:"bytes"`
	Size  string `json:"size"`
}

ReplicaTally counts a member's replica records in one state; Size is Bytes human-formatted as the rest of the summary is.

type SectionV2

type SectionV2 struct {
	IncludePatterns []string  `json:"include-patterns"`
	ExcludePatterns []string  `json:"exclude-patterns"`
	Repositories    []string  `json:"repositories"`
	Actions         ActionsV2 `json:"actions,omitzero"`
}

SectionV2 is one section of a legacy v2 target. The pattern keys are kebab-case inside an otherwise camelCase document, as JFrog defines them.

type StorageSummaryMirrors

type StorageSummaryMirrors struct {
	BlobMirrors []BlobMirror `json:"blobMirrors"`
}

StorageSummaryMirrors is artifactweave's addition to the storage summary (GET /artifactory/api/storageinfo, decision 0028). Artifactory reports nothing per shard, so these fields have no JFrog counterpart; they follow the summary's camelCase so the document reads as one.

Jump to

Keyboard shortcuts

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