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

providerdata

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package providerdata defines the value passed from the provider Configure phase to every resource, data source, list resource, and action Configure call. It is in its own package (rather than internal/provider) to avoid an import cycle: internal/provider imports every resource package for registration, so resource packages cannot import it.

Index

Constants

View Source
const AppStoreMaxConcurrent = 5

AppStoreMaxConcurrent caps the App Store lookups one configured provider instance runs at once. Apple publishes no rate limit and drew no 429 at 44 requests per second (2026-10-16), so this is not a measured ceiling: it matches the Jamf API load budget the rest of the provider keeps, because an undocumented limit is still a limit and a for_each over a large app list would otherwise fan out at Terraform's full parallelism.

View Source
const ProviderMinJamfProVersion = "11.31.0"

ProviderMinJamfProVersion is the provider-wide recommended minimum Jamf Pro tenant version. Surfaces as a WARNING (not an error) when the tenant is below it, and is rendered to users as "Built against API as of" in the provider description, docs/index.md and README.md.

It tracks the SDK's jamfplatform.JamfProAPIVersion — the API surface the linked SDK build was generated against — and is bumped with the SDK dependency. It is NOT the maximum of the per-resource floors: those are almost all empty (one resource declares 11.25.0), so a max-of-floors rule would move this backwards and make the rendered "built against" claim wrong.

Bump at release time to match jamfplatform.JamfProAPIVersion, then run `make generate` for docs/index.md and hand-edit the table in README.md, which is not generated and will otherwise drift silently.

This is deliberately advisory: it says which API the provider was built for, not what a tenant must run. Anything with a real requirement declares its own minJamfProVersion and hard-fails Configure — grep BOTH internal/resources/pro/ and internal/actions/pro/ for those. Only one construct declares a non-empty floor today (service_discovery_enrollment, 11.25.0) and no action does, but keep checking both trees: actions have carried floors before and will again.

Variables

View Source
var (
	AccountScopes              = resolveFamily("Jamf Account", account.Privileges)
	AIGovernanceScopes         = resolveFamily("Jamf AI Governance", aigovernance.Privileges)
	BlueprintsScopes           = resolveFamily("Blueprints", blueprints.Privileges)
	ComplianceBenchmarksScopes = resolveFamily("Compliance Benchmarks", compliancebenchmarks.Privileges)
	DeviceActionsScopes        = resolveFamily("Platform device actions", deviceactions.Privileges)
	DeviceGroupsScopes         = resolveFamily("Platform device groups", devicegroups.Privileges)
	DevicesScopes              = resolveFamily("Platform devices", devices.Privileges)
	ProScopes                  = resolveFamily("Jamf Pro", pro.Privileges, proclassic.Privileges)
	SecurityCloudScopes        = resolveFamily("Jamf Security Cloud", securitycloud.Privileges)
)

Scope sets per API family, in the preference order RequireScope documents.

AccountScopes resolves to organization alone from the SDK's own config.scopeTypes rather than from a published extension: no account spec declares x-scope-types, and the routes resolve the organization from the access token. It is the one family whose set is a wire-evidenced assertion on the SDK's side too — read MethodPrivileges.ScopesSource to tell that apart from a transcription.

Functions

func ConfigureAccount

func ConfigureAccount(_ context.Context, providerData any, resourceType string) (*account.Client, diag.Diagnostics)

ConfigureAccount is the shared Configure boilerplate for every Jamf Account resource, data source, list resource and action. It type-asserts providerData into *Data, gates on the API integration scope, and returns an *account.Client.

Like ConfigureSecurityCloud it deliberately bypasses configureSub: Jamf Account is organization-level and has no customer-tenant version, so the Jamf Pro version read that helper performs would be meaningless here — and fatal on an organization that holds no Jamf Pro tenant at all.

Scope: ScopeOrganization alone, and this is the first construct family in the provider to require it. Wire-probed on 2026-09-02 against two independent organization-scoped integrations, which reach /sso/v1 while a tenant-scoped one is refused BAD_PERMISSIONS on the same URL in the same region — the refusal is provably an authorization decision rather than an unmapped route, because a different credential answers 200 there. Environment scope is deliberately *not* listed: it is untested, because the namespace exists only on the US gateway and no US environment-scoped integration was available. Widening the gate is therefore a fresh probe, not a one-token edit.

An organization-scoped integration sends no scope header at all — the gateway resolves the organization from the access token, and /sso/v1 ignores X-Environment-Id and X-Tenant-Id entirely when one is present. So there is no organization ID for the provider to carry and none for the SDK to send.

resourceType is the fully-qualified Terraform type name used in diagnostics (e.g. "jamfplatform_account_sso_domain"). Returns (nil, nil) when providerData is nil — the framework calls Configure with a nil ProviderData during early lifecycle, and the construct stays unconfigured until a later call supplies it.

func ConfigureCollision added in v1.7.0

func ConfigureCollision(providerData any) *collision.Checker

ConfigureCollision returns the shared name collision checker from providerData, or nil when the check is off or providerData is not yet available. It never produces diagnostics.

func ConfigureImpact

func ConfigureImpact(providerData any) *impact.Cache

ConfigureImpact returns the shared impact cache from providerData, or nil when impact alerts are off or providerData is not yet available. It never produces diagnostics: impact reporting is advisory and must not affect whether a resource configures successfully.

func ConfigurePro

func ConfigurePro(ctx context.Context, providerData any, minVer, resourceType string) (*pro.Client, diag.Diagnostics)

ConfigurePro is the shared Configure boilerplate for every Pro resource, data source, list resource, and action. It type-asserts providerData into *Data, fetches the Jamf Pro tenant version (lazily, cached on the Data value), runs the per-resource minimum version gate when minVer is non-empty, and surfaces the provider-floor advisory warning when the tenant is below the provider build target.

resourceType is the fully-qualified Terraform type name used in diagnostic messages (e.g. "jamfplatform_pro_category"). Returns a *pro.Client ready for use; callers should check resp.Diagnostics.HasError() before using it.

Returns (nil, nil) when providerData is nil — the framework calls Configure with a nil ProviderData during early lifecycle and that is not an error; the resource simply remains unconfigured until a later Configure call provides the data.

Once the floor warning has been considered for a Data value, subsequent Configure calls with empty minVer skip the version fetch entirely.

func ConfigureProClassic

func ConfigureProClassic(ctx context.Context, providerData any, minVer, resourceType string) (*proclassic.Client, diag.Diagnostics)

ConfigureProClassic is the shared Configure boilerplate for every ProClassic resource, data source, list resource, and action. Semantics are identical to ConfigurePro — same Data value, same version cache, same one-shot floor warning, same nil-providerData and minVer contracts — but the returned client speaks XML against the classic API surface.

func ConfigureSecurityCloud

func ConfigureSecurityCloud(_ context.Context, providerData any, resourceType string) (*securitycloud.Client, diag.Diagnostics)

ConfigureSecurityCloud is the shared Configure boilerplate for every Jamf Security Cloud resource, data source, list resource and action. It type-asserts providerData into *Data, gates on the API integration scope, and returns a *securitycloud.Client.

It deliberately does NOT go through configureSub. That helper fetches the Jamf Pro tenant version and can surface the provider-floor advisory, which is meaningless here: Security Cloud is a separate product with its own release train, and a tenant can hold it without holding Jamf Pro at all. Routing Security Cloud through configureSub would make every Security Cloud construct depend on a Jamf Pro read it has no use for — and, on a Pro-less tenant, turn a working construct into a Configure failure.

Scope: environment first (the preferred integration scope), then tenant. Both reach Security Cloud — the DNS surface was wire-verified under a tenant-scoped integration against production EU on 2026-08-27. Organization scope is rejected, as everywhere else.

resourceType is the fully-qualified Terraform type name used in diagnostics (e.g. "jamfplatform_security_cloud_dns_zone"). Returns (nil, nil) when providerData is nil — the framework calls Configure with a nil ProviderData during early lifecycle, and the construct simply stays unconfigured until a later call supplies it.

func SecurityCloudTenantScopeID added in v1.2.2

func SecurityCloudTenantScopeID(providerData any) string

SecurityCloudTenantScopeID returns the tenant ID the provider is scoped to when it runs under tenant scope, and "" under any other scope or before Configure has supplied providerData.

A Security Cloud construct configured under tenant scope is necessarily talking to a Security Cloud tenant, so this is that tenant's ID: the value internal/common/securitycloudtenant defaults a gateway's tenant_ids to. It is read off the built SDK client, like Data.scope, so it can never disagree with the X-Tenant-Id the client sends.

Types

type AppStoreCache added in v1.5.0

type AppStoreCache struct {
	// contains filtered or unexported fields
}

AppStoreCache holds the App Store listings one configured provider instance has looked up.

A listing cannot change within one plan in any way the plan could use, and a configuration that looks up the same app twice (once per target, or from two modules) should pay one request. Two outcomes are stored: a listing, and a definitive miss (*appstore.NotFoundError or *appstore.StorefrontMismatchError), because Apple answers both with a 200 and asking again returns the same answer. A transport or status failure is not stored, so the next caller retries it, the same rule this package applies to the Jamf Pro version fetch.

The map lock is never held across a request: concurrent callers for one query collapse onto a per-key sync.Once, as in aischemas.Cache, while callers for different queries proceed independently up to AppStoreMaxConcurrent.

func NewAppStoreCache added in v1.5.0

func NewAppStoreCache(client *appstore.Client) *AppStoreCache

NewAppStoreCache builds a cache over client.

func (*AppStoreCache) Lookup added in v1.5.0

func (c *AppStoreCache) Lookup(ctx context.Context, q appstore.Query) (*appstore.App, error)

Lookup returns the listing q names, from the cache when an earlier caller already asked.

Nil-receiver-safe for the same reason AppTitleCatalogCache is: a data source that never received provider data must report the failure rather than panic.

type AppTitleCatalogCache

type AppTitleCatalogCache struct {
	// contains filtered or unexported fields
}

AppTitleCatalogCache holds one snapshot of the tenant's Jamf App Catalog title list per configured provider instance, read on first use.

The catalog is tenant-global and identical for every App Installer in a configuration, and each deployment needs it in both directions — a configured app_title_name resolved to a catalog id at plan time and again on apply, and the stored app_title_id reverse-resolved to its display name on every refresh. Without this a configuration with N App Installers pays 2N catalog requests on every plan on top of the N deployment reads, tripling the request count of a no-op plan. One unfiltered list answers all of it: the catalog is a few hundred titles and the SDK's list call pages at 2000, so the whole of it arrives in one round-trip.

A failed read is not cached: the next caller retries it. A transient blip or a momentary privilege problem on the first deployment must not blank every later deployment's app_title_name for the rest of the run — the same rule this package applies to the Jamf Pro version fetch and to the patch source catalogues.

The read itself is injected rather than written here. The SDK call it makes belongs to the App Installer package: that package declares the privileges it requires, and its tests derive that declaration from the call sites in its own files.

func ConfigureAppTitleCatalog

func ConfigureAppTitleCatalog(providerData any, read func(context.Context, *pro.Client) ([]pro.AppTitle, error)) *AppTitleCatalogCache

ConfigureAppTitleCatalog returns the App Catalog title cache shared by every construct configured from this provider instance, building it on first use with read.

It mirrors ConfigurePatchSources: no diagnostics, and nil when providerData is not a *Data — including the nil ProviderData the framework passes during early lifecycle. A caller that receives nil resolves nothing and reports it, which is the same outcome an unconfigured client already produced.

The first caller's read function is the cache's read function; later callers reuse the cache they find. Every caller passes the same package-level function, so which one registered it cannot matter.

func (*AppTitleCatalogCache) Titles

func (c *AppTitleCatalogCache) Titles(ctx context.Context) ([]pro.AppTitle, error)

Titles returns the catalog snapshot, reading it at most once per configured provider instance.

The lock is held across the read, so concurrent callers collapse into one round-trip instead of racing to fill the same snapshot — the same shape as PatchSourceCache.Catalogues, and for the same reason: there is exactly one snapshot to fill.

Nil-receiver-safe: resolving a title name is a plan-time preflight and a best-effort refresh everywhere except import, so a construct that never received a cache must report the failure rather than panic mid-plan.

type BenchmarkLock added in v1.6.0

type BenchmarkLock struct {
	// contains filtered or unexported fields
}

BenchmarkLock serializes compliance benchmark creates and deletes within one configured provider instance.

A benchmark is not one object: Jamf deploys it to Jamf Pro as about sixty (configuration profiles, policies, smart groups, extension attributes and scripts) and tears them down asynchronously after the delete is accepted. Wire-observed on the EU gateway 2026-10-18, deleting several benchmarks at once leaves some of those objects behind (two to eleven configuration profiles and policies per run) while every benchmark still reports a clean delete, and the same deletes run one at a time leave nothing. Terraform runs independent resources concurrently, so the resource holds this lock from the write until the benchmark has finished syncing or disappeared.

It is a one-slot channel rather than a sync.Mutex so a caller waiting for it still honours cancellation and its timeout. It serializes one provider process only: two `terraform apply` runs against the same environment can still overlap.

func (*BenchmarkLock) Acquire added in v1.6.0

func (l *BenchmarkLock) Acquire(ctx context.Context) (func(), error)

Acquire blocks until the lock is free or ctx is done, and returns the function that releases it. A nil lock is always free, which is what a resource that never received provider data holds.

type Data

type Data struct {
	Client *jamfplatform.Client
	// contains filtered or unexported fields
}

Data is the value passed via ResourceData/DataSourceData/ListResourceData/ActionData. It bundles the authenticated SDK client with lazy Jamf Pro version state shared across all Pro resource Configure calls in a single terraform invocation.

Caching semantics:

  • Successful version fetches are cached for the lifetime of the Data value.
  • Errors are NOT cached — subsequent Configure calls will retry the fetch. This avoids a transient network/auth blip in the first Pro Configure poisoning every later Configure on the same terraform invocation.
  • The provider-floor advisory warning is emitted at most once per Data value to prevent N duplicate warnings in configs that use N Pro resources.
  • Once the floor advisory has been considered (emitted or determined not to be applicable), further Configure calls with empty minVer skip the version fetch entirely — there is nothing left to check on those code paths.

It also carries the API integration scope (environment, tenant, or organization) the provider was configured with, fixed before any construct runs and read via RequireScope; see scope.go.

func New

func New(client *jamfplatform.Client) *Data

New wraps a configured SDK client in a Data value, reading the API integration scope back off the client so it cannot disagree with the scope option the client was actually built with.

SDK v0.18.0 added Client.Scope() for exactly this; before it the scope had to be passed in alongside, because the transport exposed only TenantID() — which returns "" for both environment and organization scope and so cannot tell them apart — and its scope type was unreachable in internal/client.

func (*Data) AISchemaCache

func (d *Data) AISchemaCache() *aischemas.Cache

AISchemaCache returns the shared AI Governance product catalogue and vendor schema cache, building it on first use. Unlike the impact cache this is not behind a provider flag: it backs validation the AI Governance policy resource always performs, and it costs nothing until something asks it for a schema.

One cache per configured provider instance is the point. The Claude Code schema alone is 184 KB, and every policy in a configuration would otherwise fetch its own copy on every plan.

func (*Data) AppStoreCache added in v1.5.0

func (d *Data) AppStoreCache() *AppStoreCache

AppStoreCache returns the App Store lookup cache for this configured provider instance, building one over a default client when Configure installed none.

func (*Data) BenchmarkLock added in v1.6.0

func (d *Data) BenchmarkLock() *BenchmarkLock

BenchmarkLock returns the benchmark write lock for this configured provider instance, building it on first use so every resource receives the same one.

func (*Data) CollisionChecker added in v1.7.0

func (d *Data) CollisionChecker() *collision.Checker

CollisionChecker returns the shared name collision checker, or nil when the check is off. Nil-receiver-safe, like ImpactCache: the check is advisory about the plan, so a resource whose Configure never ran must degrade to disabled.

func (*Data) EnableImpactAlerts

func (d *Data) EnableImpactAlerts()

EnableImpactAlerts turns on plan-time impact alerts for this provider instance, backed by one shared tenant read. Called from provider Configure when the impact_alerts attribute is set.

func (*Data) EnableNameCollisionCheck added in v1.7.0

func (d *Data) EnableNameCollisionCheck(cfg collision.Config)

EnableNameCollisionCheck builds the shared plan-time name collision checker from the provider's name_collision_check setting. A mode of off leaves it nil.

func (*Data) EnrollmentWriteLock

func (d *Data) EnrollmentWriteLock() *sync.Mutex

EnrollmentWriteLock returns the process-shared mutex that serializes writes to the shared enrollment-settings backing store. Both the user-initiated-enrollment-settings (/v4) and re-enrollment-settings (/v1) resources must lock it around their entire read→modify→write critical section. Because Data is shared by pointer across every resource's Configure, all callers receive the same *sync.Mutex instance.

func (*Data) FiredOnce

func (d *Data) FiredOnce(key string) bool

FiredOnce records and reports whether an event keyed by name has already been handled for this Data value. Returns true the first time it is called for a given key (meaning: "caller should fire"); returns false on every subsequent call. Used by cross-API bridging paths (e.g. the device_group jamf_pro_id lookup) to emit a single warning per provider invocation even when the same failure is encountered across many resource Read/Create/Update calls.

Keys are namespaced by callers — use a stable, descriptive identifier such as "device_group.jamf_pro_id.forbidden" so distinct latches do not collide.

func (*Data) GetJamfProVersion

func (d *Data) GetJamfProVersion(ctx context.Context) (string, error)

GetJamfProVersion fetches the tenant's Jamf Pro version. Successful results are cached for the lifetime of the Data value. Errors are not cached — the next call retries the fetch. Resources with empty minJamfProVersion should not call this — fetching only fires when a Pro resource with a version requirement is in the config.

func (*Data) ImpactCache

func (d *Data) ImpactCache() *impact.Cache

ImpactCache returns the shared impact cache, or nil when impact alerts are off. Resources pass the result straight into impact.Report, which treats nil as disabled. Nil-receiver-safe: impact reporting is advisory, so a resource whose Configure never ran must degrade to disabled, not panic mid-plan.

func (*Data) RequireScope

func (d *Data) RequireScope(resourceType string, allowed ...ScopeKind) diag.Diagnostics

RequireScope gates a construct on the provider's integration scope, returning an error diagnostic when the configured scope is not in allowed.

Scope is enforced per construct rather than once in provider Configure because the answer differs per API family, and it has already differed twice: Jamf Pro is reachable under either an environment- or a tenant-scoped integration, while Blueprints and Compliance Benchmarks became environment-only at the Platform API GA. A single provider-level assertion could not express that, and hard-failing Configure on an organization-scoped integration would block the jamfplatform_account_* family.

Pass allowed in preference order — it is the order the diagnostic lists them in, so the scope a user should reach for first comes first. Pass one of the derived family sets in scopes.go rather than writing the kinds out: they are resolved from the SDK privilege registry, so a spec ingest that moves a family's scope arrives as one changed value with a pinned expectation to agree with, instead of going stale silently at each of the call sites.

resourceType is the fully-qualified Terraform type name used in the diagnostic (e.g. "jamfplatform_pro_category"). An empty allowed list and a nil receiver both pass: the framework calls Configure with nil ProviderData during early lifecycle, and callers already guard that before reaching here.

func (*Data) Scope

func (d *Data) Scope() ScopeKind

Scope reports the integration scope the provider was configured with. Nil-receiver-safe so a construct whose Configure never ran reports the zero scope rather than panicking.

func (*Data) SetAppStoreClient added in v1.5.0

func (d *Data) SetAppStoreClient(client *appstore.Client)

SetAppStoreClient installs the App Store client the provider built in Configure, carrying its User-Agent and, under TF_LOG=debug, its request logger. Call it before any construct runs.

type PatchSourceCache

type PatchSourceCache struct {
	// contains filtered or unexported fields
}

PatchSourceCache holds one PatchSourceCatalogues snapshot per configured provider instance, read on first use.

Both catalogues are tenant-global and identical for every patch software title in a configuration, and every title read outside the managed-resource steady state needs them, so without this a configuration with N patch software title data sources pays 2N identical catalogue requests on every plan and again on every apply.

A failed read is not cached: the next caller retries it. A transient blip or a momentary privilege problem on the first title must not blank every later title's source_id for the rest of the run — the same rule this package applies to the Jamf Pro version fetch and aischemas to its vendor schemas.

The read itself is injected rather than written here. The two SDK calls it makes belong to the patch software title package: that package declares the privileges they require, and its tests derive that declaration from the call sites in its own files.

func ConfigurePatchSources

func ConfigurePatchSources(providerData any, read func(context.Context, *proclassic.Client) (PatchSourceCatalogues, error)) *PatchSourceCache

ConfigurePatchSources returns the patch source cache shared by every construct configured from this provider instance, building it on first use with read.

It mirrors ConfigureImpact: no diagnostics, and nil when providerData is not a *Data — including the nil ProviderData the framework passes during early lifecycle. A caller that receives nil still resolves nothing and reports it, because a null source_id outside import is advisory.

The first caller's read function is the cache's read function; later callers reuse the cache they find. Every caller passes the same package-level function, so which one registered it cannot matter.

func (*PatchSourceCache) Catalogues

Catalogues returns the snapshot, reading it at most once per configured provider instance.

The lock is held across the read, so concurrent callers collapse into one round-trip instead of racing to fill the same snapshot. There is exactly one snapshot to fill — unlike the AI Governance schema cache, where a lock held across a fetch would make callers wanting different schemas wait on each other.

Nil-receiver-safe: resolving a patch source name is best-effort everywhere except import, so a construct that never received a cache must report an unresolved id rather than panic mid-plan.

type PatchSourceCatalogues

type PatchSourceCatalogues struct {
	Internal []proclassic.IDName
	External []proclassic.IDName
}

PatchSourceCatalogues is a snapshot of the tenant's two Jamf Pro patch source catalogues, internal and external, as one value.

It carries the catalogue entries as read rather than a name → id index, because the question its consumer asks is not a plain lookup: a patch software title names its source but never numbers it, a name present in both catalogues cannot be resolved at all, and the refusal has to name the candidate ids. Keeping the snapshot as-read leaves that decision in one pure function over these two slices (in the patch software title package, which owns the law and the calls that fill this), so the cache only ever answers "what does this tenant have", never "which id is it".

type ScopeKind

type ScopeKind int

ScopeKind is the request context a Jamf API integration is bound to.

The three kinds are the three choices Jamf offers when an integration is created — *Organization management*, *Platform environment*, and *Tenant*. The gateway resolves which one applies from a request header (`X-Environment-Id` or `X-Tenant-Id`, stamped on every call by the SDK) or, when neither header is sent, from the access token alone. It is a property of the configured client, not of an individual call: the SDK carries exactly one scope and every request inherits it. That is why the check lives on Data and runs in Configure rather than per-request.

Scoping used to be a URL path segment (`/api/{namespace}/{version}/tenant/{id}`). The Platform API GA moved it to headers, and SDK v0.17.0 followed — its `APIPrefix` no longer embeds an ID, and `WithEnvironmentID` / `WithTenantID` set a header instead. Nothing in this provider builds URLs, so that transition cost no call-site changes; what it added is a second scope to choose between.

The value on a Data is read back off the SDK client via `Client.Scope()` (added in v0.18.0) rather than tracked separately, so it always reflects the header the client will actually send. See scopeFromClient for why this enum is not simply an alias of the SDK's.

const (
	// ScopeOrganization is the absence of an environment or tenant header: the
	// gateway resolves the context from the access token alone. It corresponds
	// to Jamf's *Organization management* integration scope, which covers what a
	// practitioner manages above and across individual tenants — single sign-on
	// today. AI Governance reads as organization-level and is not: it is
	// environment-scoped, wire-probed, and a request carrying no scope header is
	// refused REQUEST_CONTEXT_NOT_PROVIDED.
	//
	// It is deliberately the zero value, because a provider block setting
	// neither `environment_id` nor `tenant_id` is exactly this case.
	//
	// It is the only scope that reaches the jamfplatform_account_* family, and
	// RequireScope rejects it everywhere else. Both directions matter: an
	// organization-scoped integration pointed at a Jamf Pro resource, and an
	// environment-scoped one pointed at a Jamf Account resource, each otherwise
	// produce an opaque gateway error deep in an apply instead of a named
	// diagnostic at Configure.
	ScopeOrganization ScopeKind = iota
	// ScopeEnvironment scopes every request to a platform environment — a group
	// of tenants across product types with interconnected capabilities — sent as
	// `X-Environment-Id`. **This is the preferred scope**, and the one Jamf
	// intends new integrations to be created with. Blueprints, Compliance
	// Benchmarks and AI Governance are reachable only this way.
	ScopeEnvironment
	// ScopeTenant scopes every request to a single Jamf Pro, Jamf School, Jamf
	// Protect or Jamf Security Cloud tenant, sent as `X-Tenant-Id`. Jamf
	// describes this as the legacy method for targeting integrations without a
	// platform environment, and the Platform API GA began retiring it: six
	// Platform specs deleted the header outright, leaving Jamf Pro, ProClassic
	// and Security Cloud as the families still declaring it. Some Jamf Pro
	// surfaces remain reachable only this way, so it is supported rather than
	// deprecated — but a new integration should not be created with it. Which
	// families still accept it is resolved from the SDK registry in scopes.go
	// rather than asserted here.
	ScopeTenant
)

func ScopeOrder

func ScopeOrder() []ScopeKind

ScopeOrder returns the order this package reports a resolved scope set in.

It is exported for one caller, and that caller is a test rather than production code: internal/common/permissions renders the same preference into every construct's documentation, from its own scopeOrder over the SDK's enum rather than this one, because the two packages speak different vocabularies — this one names a scope the way a diagnostic must ("environment"), that one the way Jamf Account's picker does ("Platform environment"). Two orderings of one user-facing decision can disagree, and the disagreement would be invisible: each package's own test checks its order against itself. Handing the order out lets the docs side assert the two agree kind-for-kind. The returned slice is a copy, so a caller cannot reorder the authorization path's own preference.

func (ScopeKind) String

func (k ScopeKind) String() string

String names the scope the way a practitioner would recognise it.

Jump to

Keyboard shortcuts

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